feat(proxy): add redeem_phantoms for by-value nonce redemption - #59
Closed
kipz wants to merge 2 commits into
Closed
Conversation
Signed-off-by: James Carnegie <me@kipz.org>
Signed-off-by: James Carnegie <me@kipz.org>
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.
Linked Issue
Closes nolabs-ai#1468
Summary
Adds
redeem_phantomsto acustom_credentialsroute — a list of brokercredential names the route resolves from a caller-presented phantom in a request
header (by-value / proof-of-possession). A non-empty list forces interception for
the route's host; resolution is gated by credential name (not value); it composes
with a managed
credential_key/author stands alone. JWT-shaped phantoms arewhole-token replaced so a real JWT stays 3 segments. The broker gains a
name-gated
resolve_nonce_for_credentials(per-nonce name map) and theNonceResolvertrait gains aresolve_for_credentialsmethod (defaultNone).Depends on (do not merge until both land in main):
shape: jwtcapture option /jwt_phantom) — required by theshape-aware replacement.
build_websocket_upstream_requestcall site.
This branch targets the integration base (
kipz/redeem-phantoms-base= main +the current in-flight set incl. nolabs-ai#1443/nolabs-ai#1453), so the diff is just this change.
Will rebase onto
mainonce the dependencies land.Test Plan
make ciclean. New unit tests: shape-aware JWT resolution (3-segment result),opaque substring replacement, route-authoritative name gate + fail-closed,
name-vs-value across per-audience overwrites, raw-value reissue relabel, and
profile validation (composes with
credential_key; rejected withaws_auth/spiffe; empty-name rejected). Second commit makes the git-providertests hermetic against ambient gpg-signing.
Checklist
CHANGELOG.mdif neededAgent Disclosure
This PR was generated by an AI agent. Files consulted/changed:
crates/nono-proxy/src/{config.rs,route.rs,server.rs,token.rs,tls_intercept/{handle.rs,h2_forward.rs}},crates/nono-cli/src/{network_policy.rs,profile/mod.rs,proxy_runtime.rs,tool-sandbox/token_broker.rs},crates/nono-cli/data/nono-profile.schema.json. Reuses the existingNonceResolverand CONNECT intercept dispatch; no new resolver trait, URI scheme, or consumer class.
Agent Compliance Check