feat(identity): Add X-Amz-Bedrock-AgentCore-Identity-WAT header propa… - #607
Open
Sudip2403 wants to merge 1 commit into
Open
feat(identity): Add X-Amz-Bedrock-AgentCore-Identity-WAT header propa…#607Sudip2403 wants to merge 1 commit into
Sudip2403 wants to merge 1 commit into
Conversation
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 14:20 — with
GitHub Actions
Waiting
…gation Add support for workload identity chain propagation across service hops: - Add IDENTITY_WAT_HEADER constant and allowlist it in is_forwardable_header - Add identity_wat context variable to BedrockAgentCoreContext - Extract the WAT header from inbound requests in _build_request_context - Auto-propagate on outbound Runtime/Gateway boto3 calls via event handler - Add @requires_wat decorator that reads WAT from context (provisioned by Runtime platform, no Identity/ACPS calls from customer code) - Register WAT propagation on Runtime data plane client only (Identity is excluded as it is the WAT issuer) - Document manual Gateway MCP call propagation pattern - Add comprehensive tests for all new functionality
Sudip2403
force-pushed
the
feat/identity-wat-propagation
branch
from
July 29, 2026 23:43
d9530c0 to
69d2b34
Compare
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
Sudip2403
requested a deployment
to
manual-approval
July 29, 2026 23:43 — with
GitHub Actions
Waiting
jariy17
requested changes
Jul 30, 2026
jariy17
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR. We already store the workload access token in the context. Can we use that instead?
| Args: | ||
| client: A boto3 client instance (e.g., bedrock-agentcore data plane client). | ||
| """ | ||
| client.meta.events.register( |
Contributor
There was a problem hiding this comment.
Instead of filtering on Line 52, we should call this register for every WAT allowlisted operation (InvokeAgentRuntime).
for op in ("InvokeAgentRuntime", ...):
self.dp_client.meta.events.register(
f"before-sign.bedrock-agentcore.{op}",
_add_identity_wat_header,
unique_id=f"identity-wat-{op}",
)
| request.headers[IDENTITY_WAT_HEADER] = identity_wat | ||
|
|
||
|
|
||
| def register_identity_wat_propagation(client: Any) -> None: |
Contributor
There was a problem hiding this comment.
Please scope this client's type to botocore.client.BaseClient.
| """Unified context manager for Bedrock AgentCore.""" | ||
|
|
||
| _workload_access_token: ContextVar[Optional[str]] = ContextVar("workload_access_token") | ||
| _identity_wat: ContextVar[Optional[str]] = ContextVar("identity_wat", default=None) |
Contributor
There was a problem hiding this comment.
We are already store WAT in _workload_access_token. Can this PR just use this variable instead of creating a whole new one?
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.
…gation
Add support for workload identity chain propagation across service hops:
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.