Identity: add an unlisted attestation pool and take command - #354
Open
drapeau-stripe wants to merge 2 commits into
Open
drapeau-stripe wants to merge 2 commits into
drapeau-stripe wants to merge 2 commits into
Conversation
Store default issuance batches in one managed pool and remove each token before returning it to an agent. Explicit exports let callers manage their own batches without sharing consumption state with the CLI. Serialize pool mutations with an exclusive lock and atomic replacement. Never steal locks based on age, since a paused writer could restore tokens already handed out. Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
Keep the existing non-secret terminal confirmation test aligned with the pool path and version-2 storage format. Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com>
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.
Every AAT request currently creates another batch file, leaving agents to track token usage themselves. Add a CLI-managed pool and
takeso an agent can obtain one token for its browser or HTTP client without managing those files. Explicit batch export remains available for agents that want to own token management.Stacked on #353. All commands remain Unlisted and excluded from MCP; wallet credentials are unchanged.
export LINK_IDENTITY_COMMANDS=1 link-cli identity attestations request --count 10 link-cli identity attestations take --format jsonSample
takeoutput:{"issuer":"https://api.link.com","token_key_id":"…","token":"…","authorization":"PrivateToken token=\"…\""}For an independently managed batch:
Default requests append to
~/.link-cli/attestations/pool.json.takeremoves a token before returning it; an empty pool reportsATTESTATION_POOL_EMPTY. Exports never enter the pool, and existing exports are not auto-imported.listdistinguishes pool batches from exports and retains per-batchstored_token_countand aggregatetotal_token_count.Append and take share an exclusive lock and atomic file replacement. Locks are never stolen based on age; a crashed holder requires explicit recovery after ensuring no commands are active. A crash after removal can lose a token. POSIX syncs the file and directory; Windows uses file sync and atomic rename.
Validation: 38 focused tests passed, including mocked request→list→take/export flows, separate-process concurrency, failed writes, corrupt pools, and export path aliases. A usage agent passed 44 built-CLI checks covering terminals, formats, contention, and MCP exclusion. CI passed, including build, typecheck, lint, the full test suite, Go race tests, and package publishing checks; independent review found no remaining actionable issues. Windows was not runtime-tested.
r? @drapeau-stripe
-- Written by Codex