114 lines
2.5 KiB
YAML
114 lines
2.5 KiB
YAML
openapi: "3.0.0"
|
|
info:
|
|
version: 0.1.0
|
|
title: Swagger Hackathon
|
|
description: A hackathon, hosted in JIS API specification created by Hamza Ali.
|
|
contact:
|
|
name: Hamza Ali
|
|
email: me@hamzantal.pw
|
|
license:
|
|
name: MIT License
|
|
url: "https://hamza.mit-license.org/"
|
|
|
|
paths:
|
|
/auth/code:
|
|
get:
|
|
tags: ["Auth"]
|
|
operationId: gen oauth
|
|
parameters:
|
|
- name: callback
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: uri
|
|
responses:
|
|
'200':
|
|
description: OAuth Consent Page URI
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/ConsentPage"
|
|
default:
|
|
$ref: "#/components/responses/DefaultResponse"
|
|
|
|
/auth/authorize:
|
|
get:
|
|
tags: ["Auth"]
|
|
operationId: authorize callback
|
|
parameters:
|
|
- name: state
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
- name: code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'302':
|
|
description: Redirect to webpage
|
|
headers:
|
|
Location:
|
|
schema:
|
|
type: string
|
|
format: uri
|
|
default:
|
|
$ref: "#/components/responses/DefaultResponse"
|
|
|
|
/auth/token:
|
|
delete:
|
|
tags: ["Auth"]
|
|
operationId: delete token
|
|
parameters:
|
|
- name: all
|
|
in: query
|
|
required: false
|
|
schema:
|
|
type: boolean
|
|
default: false
|
|
- name: token
|
|
in: cookie
|
|
description: User authentication token
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'204':
|
|
description: User successfully logged out
|
|
default:
|
|
$ref: "#/components/responses/DefaultResponse"
|
|
|
|
components:
|
|
responses:
|
|
DefaultResponse:
|
|
description: Unexpected server error or invalid user input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Error'
|
|
|
|
schemas:
|
|
ConsentPage:
|
|
type: object
|
|
required:
|
|
- url
|
|
properties:
|
|
url:
|
|
type: string
|
|
format: uri
|
|
|
|
Error:
|
|
type: object
|
|
required:
|
|
- code
|
|
- message
|
|
properties:
|
|
code:
|
|
type: integer
|
|
default: 400
|
|
message:
|
|
type: string
|