Repository navigation
fix(secrets): refuse a secret upload that would overwrite a concurrent access change - #435
Draft
PiquelChips wants to merge 2 commits into
Draft
PiquelChips wants to merge 2 commits into
PiquelChips wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: truePre-merge checks:
|
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
from
November 11, 2026 12:20
d4729d1 to
87e7ebd
Compare
PiquelChips
force-pushed
the
fix/secret-upload-access-precondition
branch
2 times, most recently
from
November 11, 2026 13:00
1548df6 to
642de7e
Compare
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
from
November 11, 2026 13:41
476185f to
6464980
Compare
PiquelChips
force-pushed
the
fix/secret-upload-access-precondition
branch
from
November 11, 2026 13:44
642de7e to
a6f0bfa
Compare
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
from
November 12, 2026 21:37
6464980 to
c8be3c8
Compare
PiquelChips
force-pushed
the
fix/secret-upload-access-precondition
branch
from
November 12, 2026 21:51
a6f0bfa to
c598baa
Compare
…t access change - The value upload takes `expected_environments` and `expected_previews`, the access the caller read. Replacing an existing secret then fails with 409 `secret_access_conflict` if its access changed meanwhile, checked in the same transaction, like the access endpoint. - `app secret set` and the dashboard's Save send the access they read whenever they replace it.
…ncurrent access change Share the expected-access check, name the write precondition, mention the expected parameters in the query error, and check the upload conflict over HTTP.
PiquelChips
force-pushed
the
fix/secret-access-precondition
branch
from
November 13, 2026 13:05
c8be3c8 to
1da8f1d
Compare
PiquelChips
force-pushed
the
fix/secret-upload-access-precondition
branch
from
November 13, 2026 13:05
c598baa to
3d4fa80
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.
#429 guarded the access endpoint, but a secret upload could still lose a concurrent access change.
app secret set --previews, and the dashboard's Save when its form changed the access, merge their change into the access they read and send the whole list with the value. The upload was only checked against the generation, and an access change doesn't bump it, so the other change was overwritten.PUT …/secrets/{name}) takesexpected_environmentsandexpected_previews, the access the caller read, in the same form asenvironmentsandpreviews. Replacing an existing secret then fails with 409secret_access_conflictif its access changed meanwhile, checked in the same transaction, as fix(secrets): refuse access edits made from an outdated access list #429 does. Without them, uploads behave as before.app secret setand the dashboard's Save send the access they read whenever they replace it. A value-only upload sends none, since it keeps the current access and has nothing to overwrite.Store::put_stored_secret_guardedtakes aSecretPrecondition(expected generation, and access when read), and sharescheck_expected_accesswith the access endpoint.put_stored_secretdelegates to it unguarded, so its many test callers are unchanged. The 400 for an undecodable query also namesexpected_environmentsandexpected_previews.The OpenAPI document, the generated client,
api.mdandcli.mdare updated.This is based on #429's branch. Once #429 merges, I'll rebase it onto
mainand retarget it.Proof: a contract test checks the 409 over HTTP for both the access endpoint and the upload. A store test shows an upload made from an outdated access read fails with
SecretAccessConflict, and one made from the current access applies. A CLI test checks thatsecret set --previewssendsexpected_environments=all&expected_previews=false.cargo nextest run -p piquelctl -p piqueld-client(148), the daemon's secret and promotion tests (67), the Playwright secrets spec (3),just lint,just openapi-checkand fmt pass.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code