|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485 |
- openapi: 3.0.0
- info:
- title: LessPass Server API
- version: 0.1.0
- servers:
- - url: https://api.lesspass.com/
- paths:
- /auth/users/:
- summary: Create new user
- post:
- tags:
- - Auth
- summary: Create new user
- description: Create a new user
- operationId: authusers
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/user_signup_login'
- description: New user email and password
- required: true
- responses:
- '201':
- description: User creation suscessfully
- content:
- application/json:
- example:
- key: null
- email: user@example.com
- id: 14348
- '400':
- description: User creation error
- content:
- application/json:
- examples:
- email problem:
- value:
- email: [ "Enter a valid email address." ]
- password problem:
- value:
- password:
- - This password is too short. It must contain at least 8 characters.
- - This password is too common.
- - This password is entirely numeric.
- /auth/users/reset_password/:
- summary: Recover lost password
- post:
- tags:
- - Auth
- summary: Recover lost password
- description: Recover lost password of existing user
- operationId: authusersresetpassword
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/user_reset_password'
- description: New user email and password
- required: true
- responses:
- '204':
- description: Recover suscessfully
- /auth/users/set_password/:
- summary: Change user password
- post:
- tags:
- - Auth
- summary: Change user password
- description: Change password of existing user
- operationId: authuserssetpassword
- security:
- - JWTAuth: []
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/user_set_password'
- description: New user email and password
- required: true
- responses:
- '204':
- description: Password changed suscessfully
- '401':
- $ref: '#/components/responses/unauthorized_error'
- /auth/jwt/create/:
- summary: Perform user login
- post:
- tags:
- - Auth
- summary: Authenticate an existing user
- description: Authenticate an existing user
- operationId: authjwtcreate
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/user_signup_login'
- description: New user email and password
- required: true
- responses:
- '200':
- $ref: '#/components/responses/auth_jwt_create'
- /auth/jwt/refresh/:
- summary: Perform token refresh
- post:
- tags:
- - Auth
- summary: Refresh user token
- description: Refresh user token
- operationId: authjwtrefresh
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jwt_token_refresh'
- description: Refresh token
- required: true
- responses:
- '201':
- $ref: '#/components/responses/auth_jwt_refresh'
- '400':
- description: Refresh token is in blank
- content:
- application/json:
- example:
- refresh: [ "This field may not be blank." ]
- '401':
- description: Refresh token has wrong type, is not valid or expired
- content:
- application/json:
- examples:
- token is invalid or expired:
- value:
- detail: Token is invalid or expired
- code: token_not_valid
- token has wrong type:
- value:
- detail: Token has wrong type
- code: token_not_valid
- /passwords/:
- summary: Work with stored passwords
- get:
- tags:
- - Passwords
- summary: Get passwords list
- description: Get passwords list
- operationId: passwordsget
- security:
- - JWTAuth: []
- responses:
- '200':
- $ref: '#/components/responses/passwords'
- '401':
- $ref: '#/components/responses/unauthorized_error'
- post:
- tags:
- - Passwords
- summary: Create new password
- description: Create new password
- operationId: passwordspost
- security:
- - JWTAuth: []
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/password'
- description: Create new password
- required: true
- responses:
- '200':
- $ref: '#/components/responses/password'
- '401':
- $ref: '#/components/responses/unauthorized_error'
- /passwords/{password_id}/:
- summary: Modify or delete stored password
- put:
- tags:
- - Passwords
- summary: Modify existing password
- description: Modify existing password
- operationId: passwordsidput
- security:
- - JWTAuth: []
- parameters:
- - $ref: '#/components/parameters/password_id'
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/password'
- description: Modify existing password
- required: true
- responses:
- '200':
- $ref: '#/components/responses/password'
- '400':
- description: Parse error
- content:
- application/json:
- examples:
- invalid values in fields:
- value:
- field: [ "A valid value is required." ]
- invalid json:
- value:
- detail: "JSON parse error - Expecting value: line 1 column 1 (char 0)"
- '401':
- $ref: '#/components/responses/unauthorized_error'
- '404':
- description: Password ID not found
- content:
- application/json:
- example:
- detail: Not found.
- delete:
- tags:
- - Passwords
- summary: Modify existing password
- description: Modify existing password
- operationId: passwordsiddelete
- security:
- - JWTAuth: []
- parameters:
- - $ref: '#/components/parameters/password_id'
- responses:
- '204':
- description: Deletion done
- '404':
- description: Password ID not found
- content:
- application/json:
- example:
- detail: Not found.
- components:
- parameters:
- password_id:
- in: path
- name: password_id
- required: true
- description: The ID of password
- schema:
- type: string
- responses:
- auth_jwt_create:
- description: successful operation
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jwt_response'
- auth_jwt_refresh:
- description: successful operation
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jwt_response'
- password:
- description: successful operation
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/password_response'
- passwords:
- description: successful operation
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/passwords_response'
- unauthorized_error:
- description: Unauthorized error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/error_response'
- example:
- detail: Given token not valid for any token type
- code: token_not_valid
- messages:
- - token_class: AccessToken
- token_type: access
- message: Token is invalid or expired
- securitySchemes:
- JWTAuth:
- type: http
- scheme: bearer
- bearerFormat: JWT
- schemas:
- user_signup_login:
- required:
- - email
- - password
- type: object
- properties:
- email:
- description: User email
- type: string
- format: email
- password:
- description: User password
- type: string
- minLength: 8
- format: password
- user_reset_password:
- required:
- - email
- type: object
- properties:
- email:
- description: User email
- type: string
- format: email
- user_set_password:
- required:
- - current_password
- - new_password
- - re_new_password
- type: object
- properties:
- current_password:
- description: User current password
- type: string
- minLength: 8
- format: password
- new_password:
- description: User new password
- type: string
- minLength: 8
- format: password
- re_new_password:
- description: Repeat user new password
- type: string
- minLength: 8
- format: password
- jwt_token_refresh:
- required:
- - refresh
- type: object
- properties:
- refresh:
- description: Refresh token
- type: string
- jwt_response:
- type: object
- properties:
- access:
- description: Access token
- type: string
- refresh:
- description: Refresh token
- type: string
- password:
- type: object
- required:
- - login
- - site
- - uppercase
- - lowercase
- - numbers
- - symbols
- - length
- - counter
- - version
- properties:
- login:
- description: User login
- type: string
- example: user@example.com
- site:
- description: User login
- type: string
- example: example.com
- uppercase:
- description: Generated password has uppercase characters
- type: boolean
- default: true
- lowercase:
- description: Generated password has lowercase characters
- type: boolean
- default: true
- numbers:
- description: Generated password has numbers
- type: boolean
- default: true
- symbols:
- description: Generated password has symbol characters
- type: boolean
- default: true
- length:
- description: Password length
- type: integer
- default: 16
- counter:
- description: Password counter
- type: integer
- default: 1
- version:
- description: Password version algorithm
- type: integer
- default: 2
- password_response:
- type: object
- properties:
- id:
- description: Password unique id
- type: string
- format: uuid
- login:
- description: User login
- type: string
- example: user@example.com
- site:
- description: User login
- type: string
- example: example.com
- uppercase:
- description: Generated password has uppercase characters
- type: boolean
- default: true
- lowercase:
- description: Generated password has lowercase characters
- type: boolean
- default: true
- numbers:
- description: Generated password has numbers
- type: boolean
- default: true
- symbols:
- description: Generated password has symbol characters
- type: boolean
- default: true
- length:
- description: Password length
- type: integer
- default: 16
- counter:
- description: Password counter
- type: integer
- default: 1
- version:
- description: Password version algorithm
- type: integer
- default: 2
- created:
- description: Creation date
- type: string
- format: date-time
- modified:
- description: Creation date
- type: string
- format: date-time
- passwords_response:
- type: object
- properties:
- count:
- description: Password items count
- type: integer
- example: 1
- previous:
- description: Previous page
- type: integer
- default: null
- next:
- description: Next page
- type: integer
- default: null
- results:
- description: Password items
- type: array
- items:
- $ref: '#/components/schemas/password_response'
- error_response:
- type: object
- properties:
- detail:
- description: Error detail
- type: string
- code:
- description: Error code
- type: string
- messages:
- description: Error messages
- type: array
- items:
- type: object
|