Repository navigation
fix(secrets): refuse access edits made from an outdated access list - #429
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PiquelChips
marked this pull request as ready for review
November 10, 2026 18:04
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
3 times, most recently
from
November 12, 2026 21:37
6464980 to
c8be3c8
Compare
- `PUT …/secrets/{name}/access` takes a `SecretAccessChange` body: the new
`environments` and `previews`, and optionally `expected`, the access the
caller read. The store compares it in the transaction and answers 409
`secret_access_conflict` when someone changed the access meanwhile, instead
of overwriting their change. Old bodies, without `expected`, still work.
- piquelctl and the dashboard send the access they read.
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
from
November 13, 2026 13:05
c8be3c8 to
1da8f1d
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.
Two people editing a stored secret's access list at once through the access endpoint (
piquelctl app secret access, the dashboard's access form) silently lost one change. Both read the list, change it, and PUT the whole list back with no precondition, and an access change doesn't bump the secret's generation, so nothing else caught it either.SecretAccessChangebody, made of the newenvironmentsandpreviewsplus an optionalexpectedaccess the caller read. The store comparesexpectedwith the current access inside the same transaction and answers 409secret_access_conflicton a mismatch;secret_access_changedstays the event kind of a successful change. Bodies withoutexpected, as old clients send, behave as before. There is no migration.app secret set --previewsor the dashboard's Save, goes throughput_stored_secret, which is guarded by generation alone and can still overwrite a concurrent access change.SecretAccessdenies unknown fields such asexpected. That's accepted.expected.SecretAccessChangerepeatsSecretAccess's two fields rather than flattening it, becauseSecretAccessdenies unknown fields and the generated client doesn't handleallOf. OpenAPI, the generated client andapi.mdare updated.Proof: a focused store test shows that a change made from an outdated access list fails with
SecretAccessConflictand keeps the newer one, while one made from the current access applies. The piquelctl and client tests (147), the daemon's secret tests (52) and the Playwright secrets spec (3) pass, as dojust lint(native and wasm),just openapi-checkand fmt.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code