Files
lincodex/api/core/routes/my_consent.yml
T

90 lines
4.0 KiB
YAML

put:
operationId: GrantMyConsent
summary: Record an explicit consent grant from settings.
description: |-
Requires a verified session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session. The body names the current text version the user read and requires `accepted: true`; the server verifies that version is still current and stores the hash of the exact text. A stale version answers 400 validation_failed at `/text_version`, without writing a grant.
C1 is available to candidate and employer accounts. C2, C3, and C5 are available only to candidate accounts. C4 is excluded and can be granted only by accepting an invitation. A repeated grant of the same current version returns the existing record; after revocation a grant creates a new record and never reopens a publication or restores an older grant.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- consent
parameters:
- name: purpose
in: path
required: true
description: Independent consent being granted. C4 is not available here.
schema:
$ref: ../components/schemas.yml#/ConsentSettingsPurpose
requestBody:
required: true
content:
application/json:
schema:
$ref: ../components/schemas.yml#/ConsentSettingsGrantRequest
responses:
"200":
description: The created or existing consent record.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/ConsentRecord
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
description: CSRF or Origin validation failed, or an employer tried to grant a candidate-only purpose.
content:
application/problem+json:
schema:
$ref: ../components/schemas.yml#/Problem
examples:
csrf:
$ref: ../components/examples.yml#/CsrfCheckFailed
forbidden:
$ref: ../components/examples.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
delete:
operationId: RevokeMyConsent
summary: Revoke a non-scoped consent from settings.
description: |-
Requires a verified candidate session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session. Revokes every unrevoked record of c2, c3, or c5, including superseded records, and never changes another purpose. Repeating a revocation is harmless and creates no duplicate event.
Revoking c2 immediately closes the stored publication and records privacy history in the same transaction; a downstream revocation intent is written to the outbox. A later c2 grant does not reopen publication or restore old grants. Revoking c3 does not block the manual assessment path. Revoking c5 makes the consent gate deny further FSP import and writes a durable stop/delete intent; an external FSP deletion adapter is not available yet.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- consent
parameters:
- name: purpose
in: path
required: true
description: Consent being revoked. C1 has a deletion-request operation and C4 requires an organization scope.
schema:
$ref: ../components/schemas.yml#/ConsentSettingsRevokePurpose
responses:
"204":
description: Consent revoked, or it was already revoked.
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
description: CSRF or Origin validation failed, or an employer account tried to revoke candidate consent.
content:
application/problem+json:
schema:
$ref: ../components/schemas.yml#/Problem
examples:
csrf:
$ref: ../components/examples.yml#/CsrfCheckFailed
forbidden:
$ref: ../components/examples.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem