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
info:
title: Competition Admin API
description: >-
Api of the competition administration. This API should be used by the competify
application to control the competition itself
version: 1.0.0
API to manage a competition. This API should be used by the competify host to control a single competition
version: 0.1.6
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:
- name: auth
description: 'Register and authentication'
- name: admin
description: 'Competition admin operations'
- name: public
description: 'Public operations'
- name: competition
description: 'Competition operations'
- name: subscription
description: 'Competition registration operations'
- name: submissions
description: 'Registration submission operations'
- name: subscription
description: 'Subscription operations'
- name: phases
......@@ -19,89 +36,10 @@ tags:
- name: exams
description: 'Exam operations'
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:
get:
tags:
- public
- competition
summary: Retrieves information about this competition
description: Retrieves information about this competition.
responses:
......@@ -332,7 +270,7 @@ paths:
/subscription/submissions:
get:
tags:
- subscription
- submissions
summary: Retrieves all submissions for this competition
description: Retrieves all submissions for this competition.
responses:
......@@ -348,8 +286,7 @@ paths:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
post:
tags:
- public
- subscription
- submissions
summary: Creates a submission for the competition
description: Creates a new submission for the competition.
requestBody:
......@@ -373,7 +310,7 @@ paths:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
patch:
tags:
- subscription
- submissions
summary: Updates multiple Submissions
description: Updates multiple Submissions.
requestBody:
......@@ -400,7 +337,7 @@ paths:
'/subscription/submissions/{submissionId}':
get:
tags:
- subscription
- submissions
summary: Retrieves a specific subscription
description: Retrieves a subscription with the given id.
responses:
......@@ -423,7 +360,7 @@ paths:
type: integer
patch:
tags:
- subscription
- submissions
summary: Updates the status of a specific application
description: 'Updates a subscription with the given id, setting a new status.'
requestBody:
......@@ -447,7 +384,7 @@ paths:
/subscription:
get:
tags:
- public
- subscription
summary: Retrieves the subscription rule
responses:
'200':
......@@ -457,11 +394,11 @@ paths:
schema:
type: object
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/#/TeamSubscriptionRule'
- $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/#/TeamSubscription'
patch:
tags:
- admin
- subscription
summary: Updates the subscription rule
requestBody:
content:
......@@ -478,8 +415,8 @@ paths:
application/json:
schema:
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/#/TeamSubscriptionRule'
- $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/#/TeamSubscription'
# /subscription/templates:
# get:
# tags:
......@@ -497,7 +434,7 @@ paths:
/subscription/team-template:
get:
tags:
- public
- subscription
summary: Retrieves the team form template
responses:
'200':
......@@ -508,7 +445,7 @@ paths:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate'
patch:
tags:
- admin
- subscription
summary: Updates the team form template
requestBody:
content:
......@@ -526,7 +463,7 @@ paths:
/subscription/participant-template:
get:
tags:
- public
- subscription
summary: Retrieves the participant form template
responses:
'200':
......@@ -537,7 +474,7 @@ paths:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate'
patch:
tags:
- admin
- subscription
summary: Updates the participant form template
requestBody:
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