Commit 004c154e authored by Isaac Pereira's avatar Isaac Pereira

[API] Adiciona configuração de autenticação de Competition-Token à API

parent c63a7eda
...@@ -2,16 +2,33 @@ openapi: 3.0.0 ...@@ -2,16 +2,33 @@ openapi: 3.0.0
info: info:
title: Competition Admin API title: Competition Admin API
description: >- description: >-
Api of the competition administration. This API should be used by the competify API to manage a competition. This API should be used by the competify host to control a single competition
application to control the competition itself version: 0.1.6
version: 1.0.0 servers:
- url: http://competition.competify.test.evologica.com.br/admin
components:
securitySchemes:
auth: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT
competitionToken:
type: apiKey
in: header
name: Competition-Token
responses:
UnauthorizedError:
description: Access token is missing or invalid
security:
- auth: []
competitionToken: []
tags: tags:
- name: auth - name: competition
description: 'Register and authentication' description: 'Competition operations'
- name: admin - name: subscription
description: 'Competition admin operations' description: 'Competition registration operations'
- name: public - name: submissions
description: 'Public operations' description: 'Registration submission operations'
- name: subscription - name: subscription
description: 'Subscription operations' description: 'Subscription operations'
- name: phases - name: phases
...@@ -19,89 +36,10 @@ tags: ...@@ -19,89 +36,10 @@ tags:
- name: exams - name: exams
description: 'Exam operations' description: 'Exam operations'
paths: paths:
/login:
post:
tags:
- auth
summary: Authenticate to retrieve an API auth token
description: Retrieves information about this competition
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
type: string
password:
type: string
required: true
responses:
'200':
description: 'Auth token'
content:
application/json:
schema:
type: object
properties:
token:
type: string
redirectUrl:
type: string
'401':
description: 'Authetication failed'
content:
application/json:
schema:
type: string
/register:
post:
tags:
- auth
summary: Register a new admin user
description: Register a new admin user
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
type: string
fullname:
type: string
email:
type: string
password:
type: string
required: true
responses:
'200':
description: 'registered user'
content:
application/json:
schema:
type: object
properties:
id:
type: integer
username:
type: string
fullname:
type: string
email:
type: string
'422':
description: 'validation error'
content:
application/json:
schema:
type: string
/competition: /competition:
get: get:
tags: tags:
- public - competition
summary: Retrieves information about this competition summary: Retrieves information about this competition
description: Retrieves information about this competition. description: Retrieves information about this competition.
responses: responses:
...@@ -332,7 +270,7 @@ paths: ...@@ -332,7 +270,7 @@ paths:
/subscription/submissions: /subscription/submissions:
get: get:
tags: tags:
- subscription - submissions
summary: Retrieves all submissions for this competition summary: Retrieves all submissions for this competition
description: Retrieves all submissions for this competition. description: Retrieves all submissions for this competition.
responses: responses:
...@@ -348,8 +286,7 @@ paths: ...@@ -348,8 +286,7 @@ paths:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
post: post:
tags: tags:
- public - submissions
- subscription
summary: Creates a submission for the competition summary: Creates a submission for the competition
description: Creates a new submission for the competition. description: Creates a new submission for the competition.
requestBody: requestBody:
...@@ -373,7 +310,7 @@ paths: ...@@ -373,7 +310,7 @@ paths:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
patch: patch:
tags: tags:
- subscription - submissions
summary: Updates multiple Submissions summary: Updates multiple Submissions
description: Updates multiple Submissions. description: Updates multiple Submissions.
requestBody: requestBody:
...@@ -400,7 +337,7 @@ paths: ...@@ -400,7 +337,7 @@ paths:
'/subscription/submissions/{submissionId}': '/subscription/submissions/{submissionId}':
get: get:
tags: tags:
- subscription - submissions
summary: Retrieves a specific subscription summary: Retrieves a specific subscription
description: Retrieves a subscription with the given id. description: Retrieves a subscription with the given id.
responses: responses:
...@@ -423,7 +360,7 @@ paths: ...@@ -423,7 +360,7 @@ paths:
type: integer type: integer
patch: patch:
tags: tags:
- subscription - submissions
summary: Updates the status of a specific application summary: Updates the status of a specific application
description: 'Updates a subscription with the given id, setting a new status.' description: 'Updates a subscription with the given id, setting a new status.'
requestBody: requestBody:
...@@ -447,7 +384,7 @@ paths: ...@@ -447,7 +384,7 @@ paths:
/subscription: /subscription:
get: get:
tags: tags:
- public - subscription
summary: Retrieves the subscription rule summary: Retrieves the subscription rule
responses: responses:
'200': '200':
...@@ -457,11 +394,11 @@ paths: ...@@ -457,11 +394,11 @@ paths:
schema: schema:
type: object type: object
oneOf: oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionRule' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionRule' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
patch: patch:
tags: tags:
- admin - subscription
summary: Updates the subscription rule summary: Updates the subscription rule
requestBody: requestBody:
content: content:
...@@ -478,8 +415,8 @@ paths: ...@@ -478,8 +415,8 @@ paths:
application/json: application/json:
schema: schema:
oneOf: oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionRule' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionRule' - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
# /subscription/templates: # /subscription/templates:
# get: # get:
# tags: # tags:
...@@ -497,7 +434,7 @@ paths: ...@@ -497,7 +434,7 @@ paths:
/subscription/team-template: /subscription/team-template:
get: get:
tags: tags:
- public - subscription
summary: Retrieves the team form template summary: Retrieves the team form template
responses: responses:
'200': '200':
...@@ -508,7 +445,7 @@ paths: ...@@ -508,7 +445,7 @@ paths:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate'
patch: patch:
tags: tags:
- admin - subscription
summary: Updates the team form template summary: Updates the team form template
requestBody: requestBody:
content: content:
...@@ -526,7 +463,7 @@ paths: ...@@ -526,7 +463,7 @@ paths:
/subscription/participant-template: /subscription/participant-template:
get: get:
tags: tags:
- public - subscription
summary: Retrieves the participant form template summary: Retrieves the participant form template
responses: responses:
'200': '200':
...@@ -537,7 +474,7 @@ paths: ...@@ -537,7 +474,7 @@ paths:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate'
patch: patch:
tags: tags:
- admin - subscription
summary: Updates the participant form template summary: Updates the participant form template
requestBody: requestBody:
content: content:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment