feat(auth): expose token credential command - #793
Merged
platinummonkey merged 3 commits intoSep 3, 2026
Conversation
Make pup auth token available in native release builds for command-backed bearer-token integrations while omitting it from AI-agent schemas. Document the narrow credential-export exception and add release smoke coverage.
platinummonkey
approved these changes
Sep 3, 2026
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.
What does this PR do?
Makes
pup auth tokenavailable in native release builds as an explicit credential command for programs that need a short-lived Datadog bearer token on stdout.The command keeps Pup's existing authentication behavior:
DD_ACCESS_TOKENtakes precedence, stored OAuth sessions are selected by site/org, and expired access tokens are refreshed during config loading. It emits only the access token plus a trailing newline on stdout; refresh diagnostics and errors stay on stderr. It never exposes refresh tokens or API/application keys.To keep this credential export intentional, the command is:
The PR also documents the narrow security-policy exception and adds unit and release-binary smoke coverage.
Motivation
Trajectory is an OpenAI-compatible local proxy that needs pull-based, command-backed OAuth so it can retrieve and refresh a user's AI Gateway bearer token while it remains running. A Trajectory auth provider can invoke
pup auth tokenon demand, without reading Pup's private keychain/file representation or reimplementing OAuth refresh.Pup extensions do not cover this boundary: auth forwarding is available only to a child process launched by Pup, and an inherited
DD_ACCESS_TOKENcannot be updated inside an already-running Trajectory proxy. Repeated refresh through extensions would therefore require a nested Pup-launched helper process.pup apialso cannot authenticate an arbitrary OpenAI-compatible streaming proxy's upstream requests.This is the concrete integration gap behind the earlier proposal in #348. Unlike a general-purpose token display feature, this PR defines a narrow credential-command contract and deliberately does not advertise it through Pup's AI-agent schemas.
Additional Notes
Local validation:
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo test -- --test-threads=1— 1,912 passedcargo build --releaseplus exact stdout/stderr, missing-credential, help, completion, and schema smoke checkscargo check --target wasm32-wasip2 --no-default-features --features wasigit diff --checkcargo auditwas also run. It reports pre-existing advisories in the unchanged lockfile (h2and tworsaversions; thersaadvisory has no fixed release). This PR adds or updates no dependencies.Checklist
Related Issues
Related context: #348