feat: define administrator auth contracts
This commit is contained in:
@@ -7,5 +7,6 @@ This repository contains schemas, shared enums, error codes, compatibility fixtu
|
||||
The first contract slice is under `contracts/v1/` and `fixtures/v1/`. It covers
|
||||
server readiness, health, errors, and the transport-neutral realtime event
|
||||
envelope so the client and server can be developed and tested together before
|
||||
Twitch integration.
|
||||
Twitch integration. It also defines the first administrator authentication
|
||||
request and response envelopes; bearer values in fixtures are synthetic only.
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://trixie.invalid/contracts/v1/auth-login-request.json",
|
||||
"title": "Trixie Login Request",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["username", "password"],
|
||||
"properties": {
|
||||
"username": { "type": "string", "minLength": 1 },
|
||||
"password": { "type": "string", "minLength": 1 }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://trixie.invalid/contracts/v1/auth-login-response.json",
|
||||
"title": "Trixie Login Response",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["session_token", "must_replace_credentials"],
|
||||
"properties": {
|
||||
"session_token": { "type": "string", "minLength": 1 },
|
||||
"must_replace_credentials": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://trixie.invalid/contracts/v1/auth-session-response.json",
|
||||
"title": "Trixie Session Response",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["authenticated"],
|
||||
"properties": {
|
||||
"authenticated": { "const": true }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"session_token": "fixture-session-token-never-use",
|
||||
"must_replace_credentials": true
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"authenticated": true
|
||||
}
|
||||
Reference in New Issue
Block a user