-
Type:
Task
-
Resolution: Unresolved
-
Priority:
High
-
Affects Version/s: None
-
Platform
-
Dev
What this is
A quick yes/no answer to "is this allowed?" for every other service, plus a small shared library that services add to their APIs.
API
- Check consent: POST /consent/v1/check
Steps
- Build the check API.
- Build a shared library so a service adds one line above an API: @RequiresConsent(purpose = "P-SHR")
- The library looks in Redis first and asks Consent-API only if the answer is not saved there.
- If not allowed, the API returns 403 with one of these reasons:
- CONSENT_NOT_FOUND
- CONSENT_DENIED
- CONSENT_WITHDRAWN
- CONSENT_EXPIRED
- RECONSENT_REQUIRED
- GUARDIAN_REQUIRED
- When any consent changes, clear the saved answer on all servers so the next check is correct straight away.
- If Consent-API is down, use the saved answer. If there is none, follow rule D-04: block optional uses, allow treatment at the treating facility, and flag it.
Done when
- A service with the one-line annotation gets 403 and the right reason when consent is missing.
- After a withdrawal, the next check says no.
- With Consent-API down, optional uses are blocked and treatment is allowed and flagged.
Source: DPDPA Compliance Proposal v14, sections 3.2.1, 3.2.2, 4, 6 (C19)