feat(breg): enforce Evidence and linked-record guards at request Apply - #1051
Draft
jeremi wants to merge 6 commits into
Draft
feat(breg): enforce Evidence and linked-record guards at request Apply#1051jeremi wants to merge 6 commits into
jeremi wants to merge 6 commits into
Conversation
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ards Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
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.
Problem and behavior
A reviewed request can outlive the facts that justified its proposal. Add configured application preconditions so BREG checks authoritative linked records and fresh signed Evidence when the request is applied. Missing, stale, changed, ineligible or unavailable Evidence refuses application without partial effects. Historical retained evidence does not grant current authority.
The change extends the compiled request contract, generated PostgreSQL privileges and apply path. Read-only guard targets receive the permissions needed for guarded reads and row locking. Provider activation includes request preconditions even when no immediate action consumes Evidence. Approval and application remain separate. Original proposal task authority is checked before Evidence disclosure and again at the transaction boundary; attachment-only request-self permissions remain independent of application targets.
Security review notes
The protected boundary is applying a previously reviewed mutation after its source facts or task authority changed. Enforcement is in the BREG application preflight and transactional apply checks. External Evidence never substitutes for the caller's profile, row or grant authority. Focused PostgreSQL tests cover original-task revocation before disclosure and before commit, wrong nonce, expired or negative Evidence, unavailable providers, idempotent replay, attachment visibility and immutable linked targets. No acceptance-only runtime switches are included.
Validation
Broader protected CI and maintainer review remain pending. Refreshing provider credentials and the wider client/composition integrations are separate changes.