Improve credential lifecycle and log hygiene - #1054
Open
EhabY wants to merge 8 commits into
Open
Conversation
Consolidate OAuth revocation into a single revokeTokens() operation (one discovery fetch and client instead of two) and drop the now-unused revokeRefreshToken(). Replace the per-store CredentialClearResult with a boolean since the only consumer checks overall success and the store lists were fabricated on cancel/error paths; the failing store remains in the logs. Narrow buildExtraLogs to take headerCommandKeys directly. Also DRY the new tests: shared loggedOutput() helper for scanning mock logger output, merged duplicate header-redaction cases, and simpler rejection/message assertions.
EhabY
force-pushed
the
fix/credential-log-hygiene
branch
from
July 30, 2026 17:34
3f7e1df to
5710189
Compare
Type the sensitive-name sets as ReadonlySet<Lowercase<string>> with a shared lowercase() helper so wrong-cased entries fail to compile, and make body redaction copy-on-write: clean bodies (the common case) pass through without allocation and clean strings are returned as-is after a single parse. Flatten revokeTokens into one operation with a token loop, extract the session-auth migration out of Remote into src/remote/migration.ts so its test needs no Remote or ServiceContainer stubbing, and tighten the new user-facing messages. Tests: MockUserInteraction now records dialog options and backs the support-bundle disclosure tests, redaction tests assert positives before one collapsed negative, and the migration test is renamed to match the extracted module.
EhabY
force-pushed
the
fix/credential-log-hygiene
branch
from
July 30, 2026 18:43
3e47996 to
2f70bf1
Compare
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.
Small, independent hardening changes around credential handling and what ends up in logs.
Authorization,Cookie,Set-Cookie,X-Api-Key,Coder-Session-Token,Proxy-Authorization) plus every header applied by the configured header command. Known credential fields (access_token,refresh_token,client_secret,code,code_verifier,id_token,password,token) are redacted from logged bodies on all paths, including JSON and form-encoded strings. Redaction is copy-on-write, and log serialization is bounded in depth and length.--yesand nothing was shown in its place.url/sessioncredentials are deleted after migration into secret storage instead of being left on disk. The migration logic now lives insrc/remote/migration.ts.Each change ships with unit tests. No settings or command surface changes beyond the new dialog.