feat: Add HTTP Headers to ServerCallContext for Improved Handler Access#182
Merged
mikeas1 merged 1 commit intoa2aproject:mainfrom Jun 11, 2025
Merged
Conversation
Include HTTP headers in the ServerCallContext to provide handlers with easy access to critical request metadata. This change maintains consistency with the existing design pattern of using the call context for request-specific data and simplifies handler implementation by making headers readily available via `context.state['headers']`.
mikeas1
approved these changes
Jun 11, 2025
Contributor
mikeas1
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
holtskinner
pushed a commit
that referenced
this pull request
Jun 12, 2025
🤖 I have created a release *beep* *boop* --- ## [0.2.8](v0.2.7...v0.2.8) (2025-06-12) ### Features * Add HTTP Headers to ServerCallContext for Improved Handler Access ([#182](#182)) ([d5e5f5f](d5e5f5f)) * Update A2A types from specification 🤖 ([#191](#191)) ([174230b](174230b)) ### Bug Fixes * Add `protobuf==6.31.1` to dependencies ([#189](#189)) ([ae1c31c](ae1c31c)), closes [#185](#185) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)