feat(accounts): add consent settings and organization management
This commit is contained in:
1 parent
24638d46d2
commit
391af7a1ef
83 files changed
+10198
-613
No files matched your search
@@ -2531,6 +2531,21 @@ ConsentPurposeCode:
|
||||
- c3
|
||||
- c4
|
||||
- c5
|
||||
ConsentSettingsPurpose:
|
||||
type: string
|
||||
description: Consent text that an authenticated account can read and accept in settings. C4 is scoped to an invitation and organization, so it is not available through the general settings flow.
|
||||
enum:
|
||||
- c1
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentSettingsRevokePurpose:
|
||||
type: string
|
||||
description: Consent that can be revoked through the general settings flow. C1 uses the account deletion request, and C4 must be revoked for one organization.
|
||||
enum:
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentState:
|
||||
type: string
|
||||
description: 'State of a consent record, computed from the ledger.
|
||||
@@ -2676,6 +2691,42 @@ ConsentRecordList:
|
||||
$ref: '#/ConsentRecord'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
ConsentSettingsGrantRequest:
|
||||
type: object
|
||||
description: Accept the current published text shown by GetMyConsentText. The server checks its version again before recording the grant.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- text_version
|
||||
- accepted
|
||||
properties:
|
||||
text_version:
|
||||
$ref: '#/ConsentTextVersion'
|
||||
accepted:
|
||||
type: boolean
|
||||
enum:
|
||||
- true
|
||||
description: Must be true to record an explicit acceptance.
|
||||
ConsentDeletionRequest:
|
||||
type: object
|
||||
description: Durable request to delete the account and its personal data. The request is recorded before asynchronous processing starts; it does not mean deletion has completed.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- requested_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the durable deletion request.
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- requested
|
||||
- processing
|
||||
description: Current state of the deletion request.
|
||||
requested_at:
|
||||
$ref: '#/Timestamp'
|
||||
ContactFieldKind:
|
||||
type: string
|
||||
description: 'Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.
|
||||
@@ -2989,7 +3040,7 @@ ConsentText:
|
||||
- published_at
|
||||
properties:
|
||||
purpose:
|
||||
$ref: '#/ConsentPurpose'
|
||||
$ref: '#/ConsentPurposeCode'
|
||||
text_version:
|
||||
$ref: '#/ConsentTextVersion'
|
||||
text:
|
||||
|
||||
@@ -17,6 +17,27 @@ schemas:
|
||||
- c3
|
||||
- c4
|
||||
- c5
|
||||
ConsentSettingsPurpose:
|
||||
type: string
|
||||
description: >-
|
||||
Consent text that an authenticated account can read and accept in
|
||||
settings. C4 is scoped to an invitation and organization, so it is not
|
||||
available through the general settings flow.
|
||||
enum:
|
||||
- c1
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentSettingsRevokePurpose:
|
||||
type: string
|
||||
description: >-
|
||||
Consent that can be revoked through the general settings flow. C1 uses
|
||||
the account deletion request, and C4 must be revoked for one
|
||||
organization.
|
||||
enum:
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentState:
|
||||
type: string
|
||||
description: |-
|
||||
@@ -180,3 +201,44 @@ schemas:
|
||||
$ref: "#/schemas/ConsentRecord"
|
||||
page:
|
||||
$ref: "./common_schemas.yml#/schemas/PageInfo"
|
||||
ConsentSettingsGrantRequest:
|
||||
type: object
|
||||
description: >-
|
||||
Accept the current published text shown by GetMyConsentText. The server
|
||||
checks its version again before recording the grant.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- text_version
|
||||
- accepted
|
||||
properties:
|
||||
text_version:
|
||||
$ref: "./identity_schemas.yml#/schemas/ConsentTextVersion"
|
||||
accepted:
|
||||
type: boolean
|
||||
enum:
|
||||
- true
|
||||
description: Must be true to record an explicit acceptance.
|
||||
ConsentDeletionRequest:
|
||||
type: object
|
||||
description: >-
|
||||
Durable request to delete the account and its personal data. The request
|
||||
is recorded before asynchronous processing starts; it does not mean
|
||||
deletion has completed.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- requested_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the durable deletion request.
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- requested
|
||||
- processing
|
||||
description: Current state of the deletion request.
|
||||
requested_at:
|
||||
$ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
@@ -89,7 +89,7 @@ schemas:
|
||||
- published_at
|
||||
properties:
|
||||
purpose:
|
||||
$ref: "#/schemas/ConsentPurpose"
|
||||
$ref: "./consent_schemas.yml#/schemas/ConsentPurposeCode"
|
||||
text_version:
|
||||
$ref: "#/schemas/ConsentTextVersion"
|
||||
text:
|
||||
|
||||
+247
-11
@@ -88,6 +88,38 @@ paths:
|
||||
$ref: '#/components/responses/ValidationFailed'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/me/consent-texts/{purpose}:
|
||||
get:
|
||||
operationId: GetMyConsentText
|
||||
summary: Read a current consent text for account settings.
|
||||
description: 'Requires a verified session. Returns the current published text and version of c1, c2, c3, or c5 so the user can read the exact text before an explicit settings grant. C4 is excluded: its text includes an organization snapshot and it is granted only during invitation acceptance. The response is private and is not cached.'
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- consent
|
||||
parameters:
|
||||
- name: purpose
|
||||
in: path
|
||||
required: true
|
||||
description: Consent whose current text is requested.
|
||||
schema:
|
||||
$ref: '#/components/schemas/ConsentSettingsPurpose'
|
||||
responses:
|
||||
'200':
|
||||
description: The current published consent text.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: '#/components/headers/CacheControlNoStore'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ConsentText'
|
||||
'400':
|
||||
$ref: '#/components/responses/ValidationFailed'
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthenticated'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/identity/registrations:
|
||||
post:
|
||||
operationId: RegisterAccount
|
||||
@@ -2212,7 +2244,7 @@ paths:
|
||||
|
||||
Without `state` the page lists the whole history; `state=active` lists the consents that hold now, one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the organization with the name its consent text showed (a snapshot that a later rename does not change), the selected contact fields, and the invitation with its terms version; it never carries a contact value. A c2 record proves the consent to the publication text; the published field set and its changes are evidence of the publication history.
|
||||
|
||||
Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations of this tag; c1 is given at registration and c4 only in AcceptMyInvitation.
|
||||
Settings grants of c1, c2, c3, and c5 require the currently published text and an explicit acceptance. Revoking c2, c3, or c5 is available in settings; c1 creates a durable account-deletion request, and c4 is revoked only for one organization. C4 is granted only in AcceptMyInvitation.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed `limit`, `cursor`, or `state` answers 400 validation_failed.
|
||||
security:
|
||||
@@ -2247,6 +2279,159 @@ paths:
|
||||
$ref: '#/components/responses/Unauthenticated'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/me/consents/{purpose}:
|
||||
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/ConsentSettingsPurpose'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ConsentSettingsGrantRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: The created or existing consent record.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: '#/components/headers/CacheControlNoStore'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ConsentRecord'
|
||||
'400':
|
||||
$ref: '#/components/responses/ValidationFailed'
|
||||
'401':
|
||||
$ref: '#/components/responses/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/Problem'
|
||||
examples:
|
||||
csrf:
|
||||
$ref: '#/components/examples/CsrfCheckFailed'
|
||||
forbidden:
|
||||
$ref: '#/components/examples/Forbidden'
|
||||
default:
|
||||
$ref: '#/components/responses/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/ConsentSettingsRevokePurpose'
|
||||
responses:
|
||||
'204':
|
||||
description: Consent revoked, or it was already revoked.
|
||||
'401':
|
||||
$ref: '#/components/responses/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/Problem'
|
||||
examples:
|
||||
csrf:
|
||||
$ref: '#/components/examples/CsrfCheckFailed'
|
||||
forbidden:
|
||||
$ref: '#/components/examples/Forbidden'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/me/consents/c4/organizations/{org_id}:
|
||||
delete:
|
||||
operationId: RevokeMyOrganizationContactConsent
|
||||
summary: Revoke C4 for one organization.
|
||||
description: Requires a verified candidate session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session; `org_id` is the only scope the caller may choose. The server revokes every unrevoked C4 record for this subject and organization, using the fields stored on those records to request downstream grant revocation. It does not affect another organization. Repeating the request is harmless and creates no duplicate event.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- consent
|
||||
parameters:
|
||||
- name: org_id
|
||||
in: path
|
||||
required: true
|
||||
description: Organization whose stored C4 grants this account revokes. A well-formed identifier outside the account's stored records changes nothing and does not reveal whether that organization exists.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
'204':
|
||||
description: C4 revoked for this organization, or no active C4 was present.
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthenticated'
|
||||
'403':
|
||||
description: CSRF or Origin validation failed, or the caller is not a candidate.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Problem'
|
||||
examples:
|
||||
csrf:
|
||||
$ref: '#/components/examples/CsrfCheckFailed'
|
||||
forbidden:
|
||||
$ref: '#/components/examples/Forbidden'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/me/account-deletion-requests:
|
||||
post:
|
||||
operationId: RequestMyAccountDeletion
|
||||
summary: Revoke C1 and request account deletion.
|
||||
description: Requires a verified session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session. In one transaction, revokes any active C1 record, creates or returns the subject's active durable deletion request, and writes the outbox intent. The API does not delete the account synchronously. Repeating the request returns the same active request; a later C1 grant never cancels it.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- consent
|
||||
responses:
|
||||
'202':
|
||||
description: The durable account-deletion request is queued for processing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: '#/components/headers/CacheControlNoStore'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ConsentDeletionRequest'
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthenticated'
|
||||
'403':
|
||||
description: CSRF or Origin validation failed.
|
||||
$ref: '#/components/responses/CsrfCheckFailed'
|
||||
default:
|
||||
$ref: '#/components/responses/Problem'
|
||||
/api/v1/me/privacy:
|
||||
get:
|
||||
operationId: GetMyPrivacySettings
|
||||
@@ -2990,6 +3175,21 @@ components:
|
||||
description: 'Consent whose text the client may read before an account exists. Only the consents given at registration are listed: `c1` is the consent to the processing of personal data.'
|
||||
enum:
|
||||
- c1
|
||||
ConsentSettingsPurpose:
|
||||
type: string
|
||||
description: Consent text that an authenticated account can read and accept in settings. C4 is scoped to an invitation and organization, so it is not available through the general settings flow.
|
||||
enum:
|
||||
- c1
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentSettingsRevokePurpose:
|
||||
type: string
|
||||
description: Consent that can be revoked through the general settings flow. C1 uses the account deletion request, and C4 must be revoked for one organization.
|
||||
enum:
|
||||
- c2
|
||||
- c3
|
||||
- c5
|
||||
ConsentText:
|
||||
type: object
|
||||
description: Currently published consent text. The server stores an acceptance with `text_version` and the hash of exactly this text.
|
||||
@@ -3001,7 +3201,7 @@ components:
|
||||
- published_at
|
||||
properties:
|
||||
purpose:
|
||||
$ref: '#/components/schemas/ConsentPurpose'
|
||||
$ref: '#/components/schemas/ConsentPurposeCode'
|
||||
text_version:
|
||||
$ref: '#/components/schemas/ConsentTextVersion'
|
||||
text:
|
||||
@@ -7785,6 +7985,42 @@ components:
|
||||
$ref: '#/components/schemas/ConsentRecord'
|
||||
page:
|
||||
$ref: '#/components/schemas/PageInfo'
|
||||
ConsentSettingsGrantRequest:
|
||||
type: object
|
||||
description: Accept the current published text shown by GetMyConsentText. The server checks its version again before recording the grant.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- text_version
|
||||
- accepted
|
||||
properties:
|
||||
text_version:
|
||||
$ref: '#/components/schemas/ConsentTextVersion'
|
||||
accepted:
|
||||
type: boolean
|
||||
enum:
|
||||
- true
|
||||
description: Must be true to record an explicit acceptance.
|
||||
ConsentDeletionRequest:
|
||||
type: object
|
||||
description: Durable request to delete the account and its personal data. The request is recorded before asynchronous processing starts; it does not mean deletion has completed.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- status
|
||||
- requested_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the durable deletion request.
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- requested
|
||||
- processing
|
||||
description: Current state of the deletion request.
|
||||
requested_at:
|
||||
$ref: '#/components/schemas/Timestamp'
|
||||
OrganizationVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -9864,6 +10100,15 @@ components:
|
||||
pointer: /salary_from
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
Unauthenticated:
|
||||
summary: No valid session
|
||||
value:
|
||||
type: urn:lincodex:problem:unauthenticated
|
||||
title: Authentication required
|
||||
status: 401
|
||||
code: unauthenticated
|
||||
detail: Sign in and repeat the request.
|
||||
trace_id: 4f2d1c3b-6a5e-4d7f-8b9a-0c1d2e3f4a5b
|
||||
RegistrationValidationFailed:
|
||||
summary: The password is too short and the consent text is outdated
|
||||
value:
|
||||
@@ -9979,15 +10224,6 @@ components:
|
||||
code: email_not_verified
|
||||
detail: Confirm the email address with the link from the verification message.
|
||||
trace_id: 7f8a9b0c-1d2e-4f3a-8b4c-5d6e7f8a9b0c
|
||||
Unauthenticated:
|
||||
summary: No valid session
|
||||
value:
|
||||
type: urn:lincodex:problem:unauthenticated
|
||||
title: Authentication required
|
||||
status: 401
|
||||
code: unauthenticated
|
||||
detail: Sign in and repeat the request.
|
||||
trace_id: 4f2d1c3b-6a5e-4d7f-8b9a-0c1d2e3f4a5b
|
||||
CandidateAccount:
|
||||
summary: A verified candidate on the questionnaire step
|
||||
value:
|
||||
|
||||
@@ -81,6 +81,8 @@ paths:
|
||||
$ref: ./routes/healthz.yml
|
||||
/api/v1/identity/consent-texts/{purpose}:
|
||||
$ref: ./routes/identity_consent_texts.yml
|
||||
/api/v1/me/consent-texts/{purpose}:
|
||||
$ref: ./routes/my_consent_texts.yml
|
||||
/api/v1/identity/registrations:
|
||||
$ref: ./routes/identity_registrations.yml
|
||||
/api/v1/identity/email-verification-requests:
|
||||
@@ -149,6 +151,12 @@ paths:
|
||||
$ref: ./routes/candidate_invitation_cancel.yml
|
||||
/api/v1/me/consents:
|
||||
$ref: ./routes/consents.yml
|
||||
/api/v1/me/consents/{purpose}:
|
||||
$ref: ./routes/my_consent.yml
|
||||
/api/v1/me/consents/c4/organizations/{org_id}:
|
||||
$ref: ./routes/my_consent_c4.yml
|
||||
/api/v1/me/account-deletion-requests:
|
||||
$ref: ./routes/account_deletion_requests.yml
|
||||
/api/v1/me/privacy:
|
||||
$ref: ./routes/candidate_privacy.yml
|
||||
/api/v1/me/privacy/publication:
|
||||
@@ -195,6 +203,10 @@ components:
|
||||
$ref: ./components/schemas.yml#/OnboardingStep
|
||||
ConsentPurpose:
|
||||
$ref: ./components/schemas.yml#/ConsentPurpose
|
||||
ConsentSettingsPurpose:
|
||||
$ref: ./components/schemas.yml#/ConsentSettingsPurpose
|
||||
ConsentSettingsRevokePurpose:
|
||||
$ref: ./components/schemas.yml#/ConsentSettingsRevokePurpose
|
||||
ConsentText:
|
||||
$ref: ./components/schemas.yml#/ConsentText
|
||||
ConsentTextVersion:
|
||||
@@ -731,6 +743,10 @@ components:
|
||||
$ref: ./components/schemas.yml#/ConsentRecord
|
||||
ConsentRecordList:
|
||||
$ref: ./components/schemas.yml#/ConsentRecordList
|
||||
ConsentSettingsGrantRequest:
|
||||
$ref: ./components/schemas.yml#/ConsentSettingsGrantRequest
|
||||
ConsentDeletionRequest:
|
||||
$ref: ./components/schemas.yml#/ConsentDeletionRequest
|
||||
OrganizationVersion:
|
||||
$ref: ./components/schemas.yml#/OrganizationVersion
|
||||
OrganizationName:
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
post:
|
||||
operationId: RequestMyAccountDeletion
|
||||
summary: Revoke C1 and request account deletion.
|
||||
description: |-
|
||||
Requires a verified session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session. In one transaction, revokes any active C1 record, creates or returns the subject's active durable deletion request, and writes the outbox intent. The API does not delete the account synchronously. Repeating the request returns the same active request; a later C1 grant never cancels it.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- consent
|
||||
responses:
|
||||
"202":
|
||||
description: The durable account-deletion request is queued for processing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/ConsentDeletionRequest
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
description: CSRF or Origin validation failed.
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailed
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -8,7 +8,7 @@ get:
|
||||
|
||||
Without `state` the page lists the whole history; `state=active` lists the consents that hold now, one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the organization with the name its consent text showed (a snapshot that a later rename does not change), the selected contact fields, and the invitation with its terms version; it never carries a contact value. A c2 record proves the consent to the publication text; the published field set and its changes are evidence of the publication history.
|
||||
|
||||
Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations of this tag; c1 is given at registration and c4 only in AcceptMyInvitation.
|
||||
Settings grants of c1, c2, c3, and c5 require the currently published text and an explicit acceptance. Revoking c2, c3, or c5 is available in settings; c1 creates a durable account-deletion request, and c4 is revoked only for one organization. C4 is granted only in AcceptMyInvitation.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed `limit`, `cursor`, or `state` answers 400 validation_failed.
|
||||
security:
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
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
|
||||
@@ -0,0 +1,39 @@
|
||||
delete:
|
||||
operationId: RevokeMyOrganizationContactConsent
|
||||
summary: Revoke C4 for one organization.
|
||||
description: |-
|
||||
Requires a verified candidate session, its CSRF token in X-CSRF-Token, and the exact configured Origin. The subject comes from the session; `org_id` is the only scope the caller may choose. The server revokes every unrevoked C4 record for this subject and organization, using the fields stored on those records to request downstream grant revocation. It does not affect another organization. Repeating the request is harmless and creates no duplicate event.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- consent
|
||||
parameters:
|
||||
- name: org_id
|
||||
in: path
|
||||
required: true
|
||||
description: >-
|
||||
Organization whose stored C4 grants this account revokes. A well-formed
|
||||
identifier outside the account's stored records changes nothing and
|
||||
does not reveal whether that organization exists.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
"204":
|
||||
description: C4 revoked for this organization, or no active C4 was present.
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
description: CSRF or Origin validation failed, or the caller is not a candidate.
|
||||
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
|
||||
@@ -0,0 +1,36 @@
|
||||
get:
|
||||
operationId: GetMyConsentText
|
||||
summary: Read a current consent text for account settings.
|
||||
description: >-
|
||||
Requires a verified session. Returns the current published text and version
|
||||
of c1, c2, c3, or c5 so the user can read the exact text before an explicit
|
||||
settings grant. C4 is excluded: its text includes an organization snapshot
|
||||
and it is granted only during invitation acceptance. The response is
|
||||
private and is not cached.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- consent
|
||||
parameters:
|
||||
- name: purpose
|
||||
in: path
|
||||
required: true
|
||||
description: Consent whose current text is requested.
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/ConsentSettingsPurpose
|
||||
responses:
|
||||
"200":
|
||||
description: The current published consent text.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/ConsentText
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
Reference in new issue
Block a user