mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
OAS: levels
This commit is contained in:
File diff suppressed because one or more lines are too long
206
openapi.yaml
206
openapi.yaml
@@ -83,6 +83,10 @@ paths:
|
|||||||
description: OK
|
description: OK
|
||||||
/api/v1/account/delete:
|
/api/v1/account/delete:
|
||||||
post:
|
post:
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
summary: Delete account
|
||||||
|
operationId: deleteAccount
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
requestBody:
|
requestBody:
|
||||||
@@ -290,7 +294,7 @@ paths:
|
|||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
'400':
|
'400':
|
||||||
description: "Bad request: challenge is courrupt"
|
description: 'Bad request: challenge is courrupt'
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -334,7 +338,7 @@ paths:
|
|||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
'400':
|
'400':
|
||||||
description: "Bad request: Submited URI is not a URI"
|
description: 'Bad request: Submited URI is not a URI'
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -378,7 +382,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/MCaptchaDetails'
|
$ref: '#/components/schemas/MCaptchaDetails'
|
||||||
|
|
||||||
'400':
|
'400':
|
||||||
description: "Bad request: Submited URI is not a URI or duplicate token name"
|
description: 'Bad request: Submited URI is not a URI or duplicate token name'
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -422,7 +426,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/MCaptchaDetails'
|
$ref: '#/components/schemas/MCaptchaDetails'
|
||||||
|
|
||||||
'400':
|
'400':
|
||||||
description: "Bad request: Submited URI is not a URI or duplicate token name"
|
description: 'Bad request: Submited URI is not a URI or duplicate token name'
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -440,7 +444,6 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
|
||||||
/api/v1/mcaptcha/domain/token/get:
|
/api/v1/mcaptcha/domain/token/get:
|
||||||
post:
|
post:
|
||||||
security:
|
security:
|
||||||
@@ -467,7 +470,7 @@ paths:
|
|||||||
$ref: '#/components/schemas/MCaptchaDetails'
|
$ref: '#/components/schemas/MCaptchaDetails'
|
||||||
|
|
||||||
'400':
|
'400':
|
||||||
description: "Bad request: Submited URI is not a URI"
|
description: 'Bad request: Submited URI is not a URI'
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -496,11 +499,12 @@ paths:
|
|||||||
post:
|
post:
|
||||||
security:
|
security:
|
||||||
- cookieAuth: []
|
- cookieAuth: []
|
||||||
summary: Delete domain from mcaptcha
|
summary: Delete token from mcaptcha
|
||||||
operationId: deleteDomain
|
operationId: deleteToken
|
||||||
tags:
|
tags:
|
||||||
- mcaptcha
|
- mcaptcha
|
||||||
- domain
|
- domain
|
||||||
|
- token
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@@ -524,7 +528,156 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
/api/v1/mcaptcha/domain/token/levels/add:
|
||||||
|
post:
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
summary: Add levels to a token
|
||||||
|
operationId: addTokenLevels
|
||||||
|
tags:
|
||||||
|
- mcaptcha
|
||||||
|
- domain
|
||||||
|
- token
|
||||||
|
- levels
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/AddLevels'
|
||||||
|
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
'400':
|
||||||
|
description: 'duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
'401':
|
||||||
|
description: 'authentication failed'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
/api/v1/mcaptcha/domain/token/levels/update:
|
||||||
|
post:
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
summary: Update levels of a token
|
||||||
|
operationId: updateTokenLevels
|
||||||
|
tags:
|
||||||
|
- mcaptcha
|
||||||
|
- domain
|
||||||
|
- token
|
||||||
|
- levels
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/AddLevels'
|
||||||
|
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
'400':
|
||||||
|
description: 'duplicate visitor count or difficulty_factor is zero or difficulty_factor decreases with increase in visitor count'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
'401':
|
||||||
|
description: 'authentication failed'
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
|
/api/v1/mcaptcha/domain/token/levels/delete:
|
||||||
|
post:
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
tags:
|
||||||
|
- mcaptcha
|
||||||
|
- domain
|
||||||
|
- token
|
||||||
|
- levels
|
||||||
|
summary: Delete levels of a token
|
||||||
|
operationId: deleteTokenLevels
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/AddLevels'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
'401':
|
||||||
|
description: (cookie)authentication required or wrong password
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
/api/v1/mcaptcha/domain/token/levels/get:
|
||||||
|
post:
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
tags:
|
||||||
|
- mcaptcha
|
||||||
|
- domain
|
||||||
|
- token
|
||||||
|
- levels
|
||||||
|
summary: Get levels of a token
|
||||||
|
operationId: getTokenLevels
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/AddLevels'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Levels'
|
||||||
|
'401':
|
||||||
|
description: (cookie)authentication required or wrong password
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Error'
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
@@ -644,6 +797,43 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
key:
|
key:
|
||||||
type: string
|
type: string
|
||||||
|
Level:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- visitor_threshold
|
||||||
|
- difficulty_factor
|
||||||
|
properties:
|
||||||
|
visitor_threshold:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 2147483647
|
||||||
|
difficulty_factor:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
GetLevels:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
Levels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Level'
|
||||||
|
|
||||||
|
AddLevels:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- levels
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
levels:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Level'
|
||||||
|
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
cookieAuth:
|
cookieAuth:
|
||||||
|
|||||||
Reference in New Issue
Block a user