Repository navigation
RUN: brokered credentials can ride a named header (#374) - #380
Merged
Merged
Conversation
A credential source may now be prefixed header:<Name>= to send its value as that header instead of Authorization: Bearer: --credential 'vendor=header:X-Api-Key=cmd:cat /run/secrets/key' It wraps env, cmd: and vault: sources and keeps their TTL, re-minting, owner binding and withholding. One parser serves the CLI (run start/resume, trigger run) and the Node/Python credentials arguments. The header name is checked at parse time: an RFC 9110 token (so no CR/LF), not broker-owned, not one that frames the message. Dispatch, redirect confinement, reflected-value scrubbing and guest-collision refusal already handled Credential::Header. An env-sourced value holding a control character is now refused, as a minted one already was. Tests: spec grammar and refusals, an end-to-end broker test against a loopback upstream (key only in X-Api-Key, guest collision refused, absent from call records and refusals), cross-origin redirect, and CR/LF in a minted value. Node and Python binding tests park a run, rotate the key, resume, and assert the upstream got the current key only in X-Api-Key. The Node test also has a CLI resume leg. Closes #374 Co-Authored-By: Claude <noreply@anthropic.com>
Merged
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.
Closes #374.
What
A credential source may be prefixed
header:<Name>=to send its value in that header instead ofAuthorization: Bearer:The same string works on the CLI (
run start,run resume,trigger run,$AREEV_RUN_CREDENTIAL) and in the Node and Pythoncredentialsarguments and trigger credential maps, because they all share one parser (CredentialSource::from_spec). Bearer specs are unchanged.How
CredentialSource::Command/Vaultgainheader: Option<String>. A static env source becomesCredential::Header.resolve_credentialbuilds whichever form the source selects. TTL, re-minting on 401,@principalbinding and env withholding are unchanged.Authorization,Cookie,Host,Proxy-Authorization) or message-framing (Content-Length,Transfer-Encoding,Connection,TE,Trailer,Upgrade,Keep-Alive,Expect). Selecting a header twice is refused.Credential::Headerin dispatch, cross-origin redirect stripping, reflected-value scrubbing and guest-header collision (RUN-E022). This change makes it reachable from the public spec.header:selector, via the newCredentialSource::source_spec.Tests
areev-run/tests/egress_tests.rs: grammar for every source plus each refusal. End to end against a loopback upstream: the key arrives only inX-Api-Keywith noAuthorization, a guestX-API-KEYgets 403, and the key never appears in an upstream failure, the call record or a refusal. Also: a cross-origin redirect drops the header, and a minted value containing CR/LF is refused by credential name.smoke.mjs) and Python (test_egress.py): a declared capability tool behind a human gate. The run parks, the key file is rotated, and resume runs. The upstream gets only the current key, only inX-Api-Key. The module's environment, tool result and journal never contain either key. The guest collision is refused and journaled, and bad header names are refused before anything is journaled. The Node test adds a CLIrun resumeleg.cargo test -p areev-run(all pass),cargo test -p areev -p areev-trigger(no failures), full Node smoke 99/99, pytest 181 passed / 1 skipped (Postgres tests deselected), clippy-D warningsclean,repo_stats --checkandcheck_versionspass.Docs
docs/run.md(a new section with a complete Node, Python and CLI example),docs/security-model.md, the CLIUSAGE, binding error strings, andCHANGELOG.md.index.d.tsis unchanged because no signatures changed.🤖 Generated with Claude Code