Consent-API: Consent check API and shared consent-check library

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: High
    • 3.14
    • Affects Version/s: None

      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

      1. Build the check API.
      2. Build a shared library so a service adds one line above an API: @RequiresConsent(purpose = "P-SHR")
      3. The library looks in Redis first and asks Consent-API only if the answer is not saved there.
      4. 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
      1. When any consent changes, clear the saved answer on all servers so the next check is correct straight away.
      2. 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)

              Assignee:
              Vanitha S
              Reporter:
              Shivani Garg
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: