Initial application stub

This commit is contained in:
Eike Kettner
2019-07-17 22:03:10 +02:00
commit 6154e6a387
54 changed files with 2447 additions and 0 deletions

View File

@ -0,0 +1,127 @@
openapi: 3.0.0
info:
title: Docspell
version: 0.1.0-SNAPSHOT
servers:
- url: /api/v1
description: Current host
paths:
/open/auth/login:
post:
summary: Authenticate with account name and password.
description: |
Authenticate with account name and password. The account name
is comprised of the collective id and user id separated by
slash, backslash or whitespace.
If successful, an authentication token is returned that can be
used for subsequent calls to protected routes.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserPass"
responses:
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResult"
/sec/auth/session:
post:
summary: Authentication with a token
description: |
Authenticate with a token. This can be used to get a new
authentication token based on another valid one.
security:
- authTokenHeader: []
responses:
200:
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResult"
/sec/auth/logout:
post:
summary: Logout.
description: |
This route informs the server about a logout. This is not
strictly necessary.
security:
- authTokenHeader: []
responses:
200:
description: Ok
components:
schemas:
UserPass:
description: |
Account name and password.
required:
- account
- password
properties:
account:
type: string
password:
type: string
AuthResult:
description: |
The response to a authentication request.
required:
- collective
- user
- success
- message
- validMs
properties:
collective:
type: string
user:
type: string
success:
type: boolean
message:
type: string
token:
description: |
The authentication token that should be used for
subsequent requests to secured endpoints.
type: string
validMs:
description: |
How long the token is valid in ms.
type: integer
format: int64
VersionInfo:
description: |
Information about the software.
required:
- version
- builtAtMillis
- builtAtString
- gitCommit
- gitVersion
properties:
version:
type: string
builtAtMillis:
type: integer
format: int64
builtAtString:
type: string
gitCommit:
type: string
gitVersion:
type: string
securitySchemes:
authTokenHeader:
type: apiKey
in: header
name: X-Docspell-Auth