Repository navigation
feat(api): record which key a request used, masked - #93
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
fylorn
added a commit
that referenced
this pull request
Sep 22, 2026
Requests record which key they used, masked (#93). Additive; CONTROL_API_VERSION unchanged. Co-authored-by: Claude Opus 5 <noreply@anthropic.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 request record and security log entry now carries the gateway key it used, masked the way the keys page shows it (
tw-re…wb4e), so the desktop app can write "tw-re…wb4e (claude-code)" instead of the key's name alone.Why record it
The name alone does not say which key: names are free text and change, and a key can be rotated under the same name. Looking the mask up by name when the page is drawn would put the current key's tail on requests made with the old one. For a security log that is the wrong answer, so the mask is taken when the request arrives and stored with it.
What changes
key_maskedonRequestStartedandLocallyAnswered, taken from the matched client entry's key withtw_secret::mask_secret.requests.key_masked(schema 16), out throughHistoryRowandSecurityEventView.Sender, rather than adding another argument to the pipeline.Additive;
CONTROL_API_VERSIONunchanged.Tests
key_maskedtw-re…wb4eand nopeer, since it came from this machine. The toolwall tests now use a key of realistic length; a ten-character one masks to all dots.cargo test --workspace(1512 passed),clippy -D warnings,fmt.🤖 Generated with Claude Code