Skip to main content

Module consent_contract

Module consent_contract 

Source
Expand description

Consent grant and revocation service contract (HLT-03).

Provides time-bounded, category-scoped consent grants and immutable revocation receipts. Enforces cryptographic authorization, strict fail-closed expiry, and permanent, non-reactivatable revocation.

Maps directly to Deontic Super-Quins (OP_PERMIT / DEFEATER_BIT | OP_FORBID) in qualia-core-db::modalities::logic::deontic.

Structs§

ConsentGrant
A time-bounded, category-scoped cryptographic consent grant.
ConsentLedger
Bounded, zero-heap registry: replay of (grant_id, nonce) and remembered revocations so omitting a receipt cannot reactivate a grant.
ConsentScope
Bitflag representations for health record categories that can be consented.
RevocationReceipt
An immutable revocation receipt permanently terminating a consent grant.

Enums§

ConsentError
Errors occurring during consent authorization or revocation.

Constants§

MAX_CONSENT_LEDGER
Maximum grant/revocation slots in the fail-closed in-memory ledger.

Functions§

authorize_category_access
Authorize access to a scoped category under a grant and a receipt slice.