Repository navigation
refactor(credentials): resolve Vanta tokens through the coordinated client-token resolver - #9919
Merged
Merged
Conversation
…lient-token resolver vanta-token.ts carried a second copy of the lock-and-memo protocol in coordinated-client-token.ts. Vanta now calls resolveCoordinatedClientToken and invalidateCoordinatedClientToken through four optional inputs whose defaults leave Shopify, Atlassian, and Linear rows unchanged: - minRemainingMs: Vanta keeps its 30-second reuse margin - failureKeyQualifier: Vanta's failure memo stays keyed by secret and scope - accessTokenDigestTag: Vanta's token digest stays keyed by API domain - pinnedState: Vanta's scope is stored with the token and checked against every stored record, expired ones included, under the lock Row ids, the advisory lock name and key, token digests, and encrypted payloads are unchanged, so old and new workers read each other's rows and contend on the same lock during a rollout. Unit tests pin those formats for Vanta and for the shared defaults; they pass against the previous code too.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge, with no actionable issues found. SummaryVanta now uses
|
…rdinated resolver
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…eal Postgres Replace the mock-based unit tests for the coordinated resolver and the Vanta token chain with integration tests that seed rows exactly as the previous build wrote them (inline sha256 ids and digests, real encryptSecret) and read back what the new resolver writes. They cover a fresh stored token, a remembered refusal, the expired-row scope pin, mint and refusal payloads at the old ids, invalidation by the old digest, the old build's advisory lock blocking a new resolution, and the default Shopify-style formats.
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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.
Summary
vanta-token.tsis now a thin wrapper overresolveCoordinatedClientToken. The duplicated lock-and-memo machinery is gone: digests,lock_timeout, advisory lock, failure memo, decode helpers, upsert and invalidation by digest. About 180 lines are removed, so later fixes to the coordinated token chain reach Vanta too.CoordinatedClientTokenInputgains four optional fields:minRemainingMs,failureKeyQualifier,accessTokenDigestTag(also accepted byinvalidateCoordinatedClientToken) andpinnedState. When a field is omitted the behavior is unchanged, so Shopify, Atlassian and Linear are unaffected.Type of Change
Testing
vanta-token.integration.ts(19 pass) andcoordinated-client-token.integration.ts(11 pass). Fixture rows are seeded exactly as the previous build wrote them, using inline sha256 ids and digests and real encryption. The tests show that:bunx biome check,check:test-patterns,check:comment-hygieneandcheck:unused-exportspass.Checklist
test-auditauthoring gate)