feat(api): declare identity contract for registration, verification, and sessions
This commit is contained in:
1 parent
197661145e
commit
653f3775f8
86 files changed
+11826
-148
No files matched your search
@@ -70,8 +70,13 @@ schemas:
|
||||
Stable public error code. Adding a code is a contract change; renaming or removing one is a breaking change. Clients must handle an unknown code by its HTTP status.
|
||||
|
||||
- validation_failed (400): parameters or body do not match the contract, or a body violates a domain rule such as salary_from <= salary_to; `errors` points at the fields.
|
||||
- verification_token_invalid (400): the email verification token is unknown, already used, or replaced by a newer one; request a new link or sign in.
|
||||
- verification_token_expired (400): the email verification token is past its lifetime; request a new link.
|
||||
- unauthenticated (401): no valid session or credentials.
|
||||
- invalid_credentials (401): the email and password do not match an account; an unknown email and a wrong password are not distinguished.
|
||||
- forbidden (403): the caller is authenticated but not allowed.
|
||||
- email_not_verified (403): the credentials are correct but the email is not verified yet.
|
||||
- csrf_check_failed (403): the request failed cross-site request protection: a missing or wrong X-CSRF-Token or a disallowed Origin.
|
||||
- not_found (404): the route or object does not exist or is not visible.
|
||||
- method_not_allowed (405): the route does not support the method.
|
||||
- idempotency_in_progress (409): a request with the same Idempotency-Key is still being processed.
|
||||
@@ -86,8 +91,13 @@ schemas:
|
||||
- not_implemented (501): the operation is in the contract but not implemented yet.
|
||||
enum:
|
||||
- validation_failed
|
||||
- verification_token_invalid
|
||||
- verification_token_expired
|
||||
- unauthenticated
|
||||
- invalid_credentials
|
||||
- forbidden
|
||||
- email_not_verified
|
||||
- csrf_check_failed
|
||||
- not_found
|
||||
- method_not_allowed
|
||||
- idempotency_in_progress
|
||||
|
||||
Reference in new issue
Block a user