Skip to content

feat(proxy): add redeem_phantoms for by-value nonce redemption - #59

Closed
kipz wants to merge 2 commits into
kipz/redeem-phantoms-basefrom
kipz/redeem-phantoms
Closed

feat(proxy): add redeem_phantoms for by-value nonce redemption#59
kipz wants to merge 2 commits into
kipz/redeem-phantoms-basefrom
kipz/redeem-phantoms

Conversation

@kipz

@kipz kipz commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Linked Issue

Closes nolabs-ai#1468

Summary

Adds redeem_phantoms to a custom_credentials route — a list of broker
credential 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/auth or stands alone. JWT-shaped phantoms are
whole-token replaced so a real JWT stays 3 segments. The broker gains a
name-gated resolve_nonce_for_credentials (per-nonce name map) and the
NonceResolver trait gains a resolve_for_credentials method (default None).

Depends on (do not merge until both land in main):

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 main once the dependencies land.

Test Plan

make ci clean. 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 with
aws_auth/spiffe; empty-name rejected). Second commit makes the git-provider
tests hermetic against ambient gpg-signing.

Checklist

  • An issue exists and is linked above
  • All commits are signed-off, using DCO
  • All new code follows the project's coding standards (CLAUDE.md) and is covered by tests
  • Public-facing changes are paired with documentation updates
  • Release note has been added to CHANGELOG.md if needed

Agent 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 existing NonceResolver
and CONNECT intercept dispatch; no new resolver trait, URI scheme, or consumer class.

Agent Compliance Check

  • I am not prohibited from contributing under this policy
  • An issue already exists (Route-gated by-value resolution of caller-presented capture nonces nolabs-ai/nono#1468)
  • I disclosed that I am an agent in the issue discussion
  • I described my intent and approach in the issue discussion
  • I reviewed repository coding and security rules for the affected area
  • I provided required attribution for reused or adapted code
  • I did not use forbidden patterns such as unwrap/expect
  • I used NonoError where required
  • I validated and canonicalized all relevant paths
  • This PR matches the approved or disclosed issue scope

kipz added 2 commits July 21, 2026 09:56
Signed-off-by: James Carnegie <me@kipz.org>
Signed-off-by: James Carnegie <me@kipz.org>
@kipz kipz closed this Jul 21, 2026
@kipz
kipz deleted the kipz/redeem-phantoms branch July 21, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant