Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API GET /api/auth documentation #1700

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions src/api/docs/content/specs/auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,23 @@ components:
- $ref: 'auth.yaml#/components/schemas/session'
- $ref: 'common.yaml#/components/schemas/took'
examples:
login_okay:
$ref: 'auth.yaml#/components/examples/login_okay'
auth_okay:
$ref: 'auth.yaml#/components/examples/auth_okay'
no_login_required:
$ref: 'auth.yaml#/components/examples/no_login_required'
'401':
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: 'auth.yaml#/components/schemas/session'
- $ref: 'common.yaml#/components/schemas/took'
examples:
login_required:
$ref: 'auth.yaml#/components/examples/login_required'
login_required_2fa:
$ref: 'auth.yaml#/components/examples/login_required_2fa'
post:
summary: Submit password for login
tags:
Expand Down Expand Up @@ -358,15 +369,24 @@ components:
nullable: true

examples:
login_okay:
summary: Login successful
auth_okay:
summary: Authentication valid
value:
session:
valid: true
totp: false
sid: null
csrf: null
validity: 300
login_okay:
summary: Login successful
value:
session:
valid: true
totp: false
sid: "vFA+EP4MQ5JJvJg+3Q2Jnw="
csrf: "Ux87YTIiMOf/GKCefVIOMw="
validity: 300
no_login_required:
summary: No login required for this client
value:
Expand All @@ -377,14 +397,23 @@ components:
csrf: null
validity: -1
login_required:
summary: Login required
summary: Login required, 2FA disabled
value:
session:
valid: false
totp: false
sid: null
csrf: null
validity: -1
login_required_2fa:
summary: Login required, 2FA enabled
value:
session:
valid: false
totp: true
sid: null
csrf: null
validity: -1
login_failed:
summary: Login failed
value:
Expand Down