Consent lifecycle
The secondary flow — originating consent through OpenG2P (request → authenticate → approve → artefact → receipt), plus revocation and expiry.
The secondary flow covers cases where OpenG2P itself collects consent rather than receiving a pre-signed object from a partner. It also defines revocation and expiry, which apply to every artefact regardless of how it was created.
Origination
Steps
Create request — a subject app, staff portal, or partner integration creates a
ConsentRequest(statuspending) naming the subject, the partner (audience), requested scopes, and purpose. The request is validated against the partner's policy up front, so an impossible request is rejected early.Authenticate — the subject authenticates with the configured OIDC provider and the ID token is posted to the CM. The CM validates the token signature and claims (
iss,aud,exp,auth_time,amr) against the IdP's JWKS, stores only the hash, and builds anAuthContext. See Security & trust.Approve — the subject chooses which requested scopes to grant. The CM computes
effective = granted ∩ policy.allowed_data_scopes, issues aConsentArtefact(source = originated, statusactive) linked to theAuthContext, and signs aConsentReceipt.Deny — alternatively the subject denies; the request becomes
denied. No artefact or receipt is created on denial.
Key rules
An artefact is only ever created on approval — never on a request or a denial.
A receipt is only created after an artefact exists.
The granted scope can never exceed policy, even if the subject "approves" more.
Approval requires a valid AuthContext — the subject must have authenticated.
Revocation
A subject (or the controller, or the partner) can revoke an active consent at any time.
Revocation is append-only: the artefact moves to
revoked, aRevocationRecordis written, and the original timestamps are preserved.A
revokedconsent fails validation immediately (reasonrevoked).Revocation is propagated two ways: a live status endpoint (
GET /consents/{id}/status, OCSP-like) that enforcement points consult, and webhook / notification to the partner and subject. This closes the gap where a cached "permit" could outlive a revocation.
Expiry
A background job runs on a schedule:
Select artefacts where
status = activeandvalid_until < now.Set
status = expired, stampexpired_at, and (origination flow) move the linked request toexpired.Enqueue an expiry notification to the subject.
Validation also performs a lazy expiry check so an artefact past valid_until is treated as expired even before the batch job runs (reason expired).
State machine
Every transition is recorded immutably in the decision/audit log for non-repudiation.
Last updated
Was this helpful?