openapi: add session endpoints

This commit is contained in:
Quaternions 2025-03-25 16:45:30 -07:00
parent 894851c0e8
commit 8da1c9346b
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131

@ -6,6 +6,8 @@ info:
servers:
- url: https://submissions.strafes.net/v1
tags:
- name: Session
description: Session operations
- name: Submissions
description: Submission operations
- name: Scripts
@ -15,6 +17,63 @@ tags:
security:
- cookieAuth: []
paths:
/session/user:
get:
summary: Get information about the currently logged in user
operationId: sessionUser
tags:
- Session
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/User"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/session/roles:
get:
summary: Get list of roles for the current session
operationId: sessionRoles
tags:
- Session
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/Roles"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/session/validate:
get:
summary: Ask if the current session is valid
operationId: sessionValidate
tags:
- Session
responses:
"200":
description: Successful response
content:
application/json:
schema:
type: boolean
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/submissions:
get:
summary: Get list of submissions
@ -619,6 +678,30 @@ components:
ID:
type: integer
format: int64
Roles:
required:
- Roles
type: object
properties:
Roles:
type: integer
format: int32
User:
required:
- UserID
- Username
- AvatarURL
type: object
properties:
UserID:
type: integer
format: int64
Username:
type: string
maxLength: 128
AvatarURL:
type: string
maxLength: 256
Submission:
required:
- ID