feat: Add HTTP Headers to ServerCallContext for Improved Handler Access #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances our A2A framework by adding HTTP headers to the
ServerCallContext, making them accessible viacontext.state['headers']. The call context is a key component of our request-handling system, designed to provide handlers with request-specific information—like user details and additional state—in a structured, modular way. This abstraction keeps our handlers clean and decoupled from the raw HTTP request.Why Add Headers to the Context?
state['auth']). Adding headers follows this established pattern, keeping our design cohesive.context.state['headers'], developers can work more efficiently and with fewer errors.Addressing Concerns:
This change makes our framework more intuitive and developer-friendly. I encourage the team to merge this PR to improve handler efficiency and maintain a consistent, modular architecture.
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.nox -s formatfrom the repository root to format)