Files
lincodex/api/core/components/schemas/identity_schemas.yml
T

297 lines
10 KiB
YAML

schemas:
EmailAddress:
type: string
format: email
minLength: 3
maxLength: 254
description: >-
Account email address. The server compares addresses without regard to
letter case and never reveals in a response whether an address belongs
to an account.
examples:
- candidate@example.com
NewPassword:
type: string
minLength: 15
maxLength: 128
description: >-
Password chosen at registration. The server normalizes it to Unicode
NFKC, as NIST SP 800-63B-4 recommends, and then requires 15 to 128 Unicode
code points; a value that the schema accepts can still fail this check
after normalization. The 15-character minimum follows NIST SP
800-63B-4 for a password used as the only authentication factor; there
are no composition rules. The upper bound limits the cost of password
hashing. Generated client validators count UTF-16 code units, so a
password with characters outside the Basic Multilingual Plane can pass
the client check and fail on the server; a later client check should
count code points. A password on the server blocklist of common or
breached passwords answers 400 validation_failed with the pointer
`/password`. The value is never returned, logged, or echoed in a
problem.
LoginPassword:
type: string
minLength: 1
maxLength: 128
description: >-
Password entered at login. The server applies the same NFKC
normalization as at registration before it verifies the hash. Only the
hashing bound applies, so a later change of the registration policy
does not lock out existing accounts and a login error does not reveal
the policy. The value is never returned, logged, or echoed in a
problem.
AccountScenario:
type: string
description: >-
Scenario chosen at registration: `candidate` looks for an offer and
passes the assessment, `employer` represents a company that searches
for candidates. The scenario selects the onboarding steps.
enum:
- candidate
- employer
OnboardingStep:
type: string
description: |-
Saved onboarding step that the account returns to after login. The server stores it and advances it as each step completes; clients route by it and never set it directly.
- candidate_consents: candidate consents beyond C1, which was given at registration.
- candidate_profile: candidate profile.
- candidate_questionnaire: candidate questionnaire.
- candidate_assessment: the assessment. The expected grade is the `self_assessed_grade` saved in the questionnaire, and this step offers it first; only an assessment result confirms a grade. The first successful SaveMyQuestionnaire moves the account from candidate_questionnaire to this step (planned).
- employer_company: company profile of the employer.
- completed: onboarding is finished; the client opens the scenario home.
Candidate steps follow the order above and end with completed; the employer has employer_company and then completed. New steps may be added as onboarding grows; adding a value is a contract change.
enum:
- candidate_consents
- candidate_profile
- candidate_questionnaire
- candidate_assessment
- employer_company
- completed
ConsentPurpose:
type: string
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
ConsentText:
type: object
description: >-
Currently published consent text. The server stores an acceptance with
`text_version` and the hash of exactly this text.
additionalProperties: false
required:
- purpose
- text_version
- text
- published_at
properties:
purpose:
$ref: "./consent_schemas.yml#/schemas/ConsentPurposeCode"
text_version:
$ref: "#/schemas/ConsentTextVersion"
text:
type: string
minLength: 1
maxLength: 100000
description: >-
Full consent text in plain UTF-8; paragraphs are separated by an
empty line. The client shows it as text, never as HTML.
published_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
ConsentTextVersion:
type: string
minLength: 1
maxLength: 64
pattern: "^[A-Za-z0-9._-]+$"
description: >-
Identifier of the published consent text that the user saw and
accepted. The server stores the acceptance with this version and the
hash of its text; the client never sends or receives the hash.
examples:
- c1-2026-10-01
PersonalDataConsentAcceptance:
type: object
description: >-
Consent C1 to the processing of personal data, given at registration.
The client reads the current text and its version with
GetConsentText(c1) and sends that version here. A version that is not
the currently published one answers 400 validation_failed with the
pointer `/consent_c1/text_version`; the client then reads the text
again and asks the user to accept the new version. Unknown fields are
rejected, so registration cannot carry any other consent; in
particular, C4 is never part of registration.
additionalProperties: false
required:
- text_version
- accepted
properties:
text_version:
$ref: "#/schemas/ConsentTextVersion"
accepted:
type: boolean
enum:
- true
description: Explicit acceptance. Only true is valid.
RegistrationRequest:
type: object
description: New account with its scenario and consent C1.
additionalProperties: false
required:
- email
- password
- scenario
- consent_c1
properties:
email:
$ref: "#/schemas/EmailAddress"
password:
$ref: "#/schemas/NewPassword"
scenario:
$ref: "#/schemas/AccountScenario"
consent_c1:
$ref: "#/schemas/PersonalDataConsentAcceptance"
EmailVerificationResendRequest:
type: object
description: Address that should receive a new verification link.
additionalProperties: false
required:
- email
properties:
email:
$ref: "#/schemas/EmailAddress"
IdentityRequestAccepted:
type: object
description: >-
Neutral acknowledgement. Its content is identical whether or not the
address belongs to an account or is already verified, so the response
does not enumerate accounts. The client tells the user to check the
mailbox.
additionalProperties: false
required:
- status
properties:
status:
type: string
enum:
- accepted
VerificationToken:
type: string
minLength: 32
maxLength: 128
pattern: "^[A-Za-z0-9_-]+$"
description: >-
One-time raw token copied from the verification link. It is request
input only: the server stores only its hash and never returns a token.
EmailVerificationRequest:
type: object
description: >-
One-time token copied from the verification link and the password chosen
for the registration that issued it. The password is never included in
the link.
additionalProperties: false
required:
- token
- password
properties:
token:
$ref: "#/schemas/VerificationToken"
password:
type: string
minLength: 1
maxLength: 128
description: >-
Password chosen for the registration that issued this token. It is
sent in the request body and never appears in the verification link.
The server applies NFKC normalization and the login length bounds,
without reapplying the current new-registration blocklist.
EmailVerificationResult:
type: object
description: >-
Result of a successful email verification. It does not start a
session; the user signs in next and continues from `onboarding_step`.
additionalProperties: false
required:
- email_verified
- scenario
- onboarding_step
properties:
email_verified:
type: boolean
enum:
- true
description: Always true in a successful response.
scenario:
$ref: "#/schemas/AccountScenario"
onboarding_step:
$ref: "#/schemas/OnboardingStep"
LoginRequest:
type: object
description: Email and password of the account.
additionalProperties: false
required:
- email
- password
properties:
email:
$ref: "#/schemas/EmailAddress"
password:
$ref: "#/schemas/LoginPassword"
CsrfToken:
type: string
minLength: 32
maxLength: 128
pattern: "^[A-Za-z0-9_-]+$"
description: >-
CSRF token bound to the current session. The client keeps it in memory
only and sends it in the X-CSRF-Token header of every mutating request
that requires a session. It changes when a new session starts.
Account:
type: object
description: >-
Current account view. It never contains password hashes, token hashes,
session identifiers, or other storage secrets.
additionalProperties: false
required:
- id
- email
- email_verified
- scenario
- onboarding_step
- created_at
properties:
id:
type: string
format: uuid
description: Account identifier.
email:
$ref: "#/schemas/EmailAddress"
email_verified:
type: boolean
description: >-
Whether the address is verified. A session exists only for a
verified account, so this is true in every current response.
scenario:
$ref: "#/schemas/AccountScenario"
onboarding_step:
$ref: "#/schemas/OnboardingStep"
created_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
Session:
type: object
description: >-
Current session as the client may see it: the account and the CSRF
token. The session identifier itself travels only in the HttpOnly
session cookie and never appears in a body.
additionalProperties: false
required:
- account
- csrf_token
properties:
account:
$ref: "#/schemas/Account"
csrf_token:
$ref: "#/schemas/CsrfToken"