feat(invitations): check contact grants on every read, cap pending invitations, and expire them at the deadline

This commit is contained in:
shira committed 2026-10-09 19:06:50 +03:00
1 parent 676b3c6e24
commit 12a7213d4a
67 files changed
+4255 -149

No files matched your search

+11 -13
View File
@@ -57,25 +57,23 @@ type AccountDeletionRequests interface {
CreateOrGet(ctx context.Context, request domain.AccountDeletionRequest) (record domain.AccountDeletionRequest, created bool, err error)
}
// ConsentRevocationEffects applies every currently available local privacy
// change and records downstream revocation intents in the same transaction as
// the ledger stamps. Future C2 and C4 grant adapters must bind each downstream
// grant to its source consent record ID and synchronously close grants for
// revoked record IDs before returning; a later consent record may create a
// new grant, but must never reactivate an older record's grant. Future C5
// readers and importers must check the current consent ledger before reading
// ConsentRevocationEffects applies every local privacy change of a revocation
// and records downstream revocation intents in the same transaction as the
// ledger stamps. The local grants are closed synchronously there: a C4
// revocation closes the grants that name the revoked records, and a C2
// revocation closes every grant of the candidate. A later consent record may
// create a new grant, but must never reactivate an older record's grant. Future
// C5 readers and importers must check the current consent ledger before reading
// or synchronizing data and fail closed on a missing grant or ledger error.
// An outbox event communicates a committed change; it is never an
// authorization check and cannot make a revoked grant current again. This
// release has no external FSP or downstream contact-grant adapter, so those
// external effects are not claimed as complete.
type ConsentRevocationEffects interface {
// Apply synchronously closes and records a C2 publication when present,
// then appends one bounded durable outbox intent per affected consent record
// with its stored scope. It must not truncate or omit affected records. A
// future local C2/C4 grant adapter must implement record-bound closure in
// this same UnitOfWork before the outbox intent is appended. An empty record
// set is not a valid call.
// Apply closes the local grants and the C2 publication when present, in the
// caller's transaction, then appends one bounded durable outbox intent per
// affected consent record with its stored scope. It must not truncate or
// omit affected records. An empty record set is not a valid call.
Apply(ctx context.Context, revocation domain.ConsentRevocation, records []domain.ConsentRecord) error
}