752 lines
20 KiB
YAML
752 lines
20 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: API Title
|
|
version: '1.0'
|
|
servers:
|
|
- url: http://localhost:8080/api
|
|
paths:
|
|
/auth/signin:
|
|
post:
|
|
operationId: login
|
|
summary: Anmeldung
|
|
description: Nutzer meldet sich mit Name und Passwort an
|
|
tags:
|
|
- login
|
|
requestBody:
|
|
description: Anmeldedaten
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
responses:
|
|
'200':
|
|
description: Anmeldung erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginResponse'
|
|
'401':
|
|
description: Benutzername/Passwort falsch
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
- error
|
|
- message
|
|
- path
|
|
additionalProperties: false
|
|
properties:
|
|
path:
|
|
type: string
|
|
description: Pfad auf den versucht wurde zuzugreifen
|
|
example: /api/users
|
|
error:
|
|
type: string
|
|
description: Error Cause
|
|
example: Unauthorized
|
|
status:
|
|
type: number
|
|
description: Statuscode
|
|
example: 401
|
|
|
|
|
|
/auth/signup:
|
|
put:
|
|
operationId: registrate
|
|
summary: Registierung
|
|
description: Ein Nutzer registriert sich mit Nutzername, Email und Passwort
|
|
tags:
|
|
- login
|
|
requestBody:
|
|
description: Anmeldedaten
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: '#/components/schemas/SignUpRequest'
|
|
responses:
|
|
'200':
|
|
description: Registrierung erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
409:
|
|
description: Nutzer existiert bereits
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
errCode:
|
|
type: string
|
|
description: Fehlergrund
|
|
example: "mail"
|
|
enum:
|
|
- "mail"
|
|
- "username"
|
|
403:
|
|
description: Keine Berechtigung
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- "status"
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
/users:
|
|
get:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- users
|
|
summary: Alle Nutzer abfragen
|
|
description: Zeigt alle registerten Nutzer an
|
|
responses:
|
|
200:
|
|
description: Liste aller registrierten Benutzer
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/UserInfo'
|
|
put:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- users
|
|
summary: Nutzer hinzufügen
|
|
description: Fügt einen Nutzer hinzu
|
|
requestBody:
|
|
description: Benutzerinformationen
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: '#/components/schemas/UserAddInfo'
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
403:
|
|
description: Keine Berechtigung
|
|
409:
|
|
description: Nutzer existiert bereits
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
errCode:
|
|
type: string
|
|
description: Fehlergrund
|
|
example: "mail"
|
|
enum:
|
|
- "mail"
|
|
- "username"
|
|
/users/{username}:
|
|
post:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- users
|
|
summary: Benutzer ändern
|
|
description: Ändert einen Benutzer
|
|
parameters:
|
|
- name: username
|
|
in: path
|
|
description: Benutzername
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: Fawkes100
|
|
requestBody:
|
|
description: Benutzerinformationen
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: '#/components/schemas/UserUpdateInfo'
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
403:
|
|
description: Keine Berechtigung
|
|
404:
|
|
description: Falls der Benutzer nicht vorhanden ist
|
|
delete:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- users
|
|
summary: Benutzer löschen
|
|
description: Löscht einen Benutzer
|
|
parameters:
|
|
- name: username
|
|
in: path
|
|
description: Benutzername
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: Fawkes100
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
403:
|
|
description: Keine Berechtigung
|
|
404:
|
|
description: Falls der Benutzer unbekannt ist
|
|
/account/change-password:
|
|
post:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- account
|
|
summary: Passwort ändern
|
|
description: Ändert das Passwort
|
|
requestBody:
|
|
description: Altes und neues Passwort
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/PasswordChangeRequest"
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
409:
|
|
description: Nicht angemeldet
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
/account/change-email:
|
|
post:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- account
|
|
summary: Email ändern
|
|
description: Ändert die hinterlegte mailadresse
|
|
requestBody:
|
|
description: Neue Email und Passwort
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/EMailChangeRequest"
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
409:
|
|
description: Nicht angemeldet
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
/account/user-details:
|
|
get:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- account
|
|
summary: Nutzerinformationen
|
|
description: Fragt Nutzerdetails wie Email ab
|
|
responses:
|
|
200:
|
|
description: Anfrage erfolgreich
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: '#/components/schemas/UserInfo'
|
|
409:
|
|
description: Invalided Passwort
|
|
401:
|
|
description: Nicht angemeldet
|
|
/account/delete-request:
|
|
post:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- account
|
|
summary: Eigenen Account löschen
|
|
description: Löscht eigenen Account
|
|
requestBody:
|
|
description: Informationen zur Sicherheitsüberprürfung
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: "#/components/schemas/AccountDeleteRequest"
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
409:
|
|
description: Ungültiges Passwort
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
'401':
|
|
description: Nicht angemeldet
|
|
/properties/signup:
|
|
get:
|
|
tags:
|
|
- properties
|
|
summary: Eigenschaft Registierung abfragen
|
|
description: Fragt ab, ob Registrierung aktiviert ist
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PropertyInfo'
|
|
404:
|
|
description: Eigenschaft nicht gefunden
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
/settings/update:
|
|
post:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- properties
|
|
summary: Eigenschaften aktualisieren
|
|
description: Aktualisiert Einstellungen
|
|
requestBody:
|
|
description: Aktualisierte Einstellungen
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: "#/components/schemas/PropertyUpdateRequest"
|
|
responses:
|
|
200:
|
|
description: Operation erfolgreich
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "success"
|
|
enum:
|
|
- "success"
|
|
401:
|
|
description: Nicht angemeldet
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
403:
|
|
description: Keine Berechtigung
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
/settings:
|
|
get:
|
|
security:
|
|
- API_TOKEN: []
|
|
tags:
|
|
- properties
|
|
summary: Einstellungen auflisten
|
|
description: Listet Einstellungen auf
|
|
responses:
|
|
200:
|
|
description: Anfrage erfolgreich
|
|
content:
|
|
'application/json':
|
|
schema:
|
|
$ref: '#/components/schemas/PropertiesInfo'
|
|
403:
|
|
description: Keine Berechtigung
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
401:
|
|
description: Keine Berechtigung
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- status
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: "failed"
|
|
enum:
|
|
- "failed"
|
|
components:
|
|
securitySchemes:
|
|
API_TOKEN:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
schemas:
|
|
LoginRequest:
|
|
required:
|
|
- username
|
|
- password
|
|
additionalProperties: false
|
|
properties:
|
|
username:
|
|
type: string
|
|
description: Benutzername des Users
|
|
example: user
|
|
password:
|
|
type: string
|
|
description: Password des Users
|
|
example: pa$$word
|
|
format: password
|
|
LoginResponse:
|
|
required:
|
|
- status
|
|
additionalProperties: true
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: Status
|
|
example: successfull
|
|
jwt:
|
|
type: string
|
|
description: JWT Token
|
|
example: jwttoken
|
|
UserAddInfo:
|
|
required:
|
|
- username
|
|
- email
|
|
- password
|
|
- admin
|
|
additionalProperties: false
|
|
properties:
|
|
username:
|
|
type: string
|
|
description: Benutzername
|
|
example: "FawKes100"
|
|
email:
|
|
type: string
|
|
description: "Mailadresse"
|
|
example: "mail@fawkes100.de"
|
|
format: "email"
|
|
password:
|
|
type: string
|
|
description: Passwort
|
|
example: "pa$$word"
|
|
format: password
|
|
admin:
|
|
type: boolean
|
|
description: Adminstatus
|
|
example: true
|
|
SignUpRequest:
|
|
required:
|
|
- username
|
|
- email
|
|
- password
|
|
additionalProperties: false
|
|
properties:
|
|
username:
|
|
type: string
|
|
description: Benutzername
|
|
example: "FawKes100"
|
|
email:
|
|
type: string
|
|
description: "Mailadresse"
|
|
example: "mail@fawkes100.de"
|
|
format: "email"
|
|
password:
|
|
type: string
|
|
description: Passwort
|
|
example: "pa$$word"
|
|
format: password
|
|
UserInfo:
|
|
required:
|
|
- username
|
|
- email
|
|
- admin
|
|
additionalProperties: false
|
|
properties:
|
|
username:
|
|
type: string
|
|
description: Benutzername
|
|
example: "covvacmap"
|
|
email:
|
|
type: string
|
|
description: "Mailadresse"
|
|
example: mail@fawkes100.de
|
|
admin:
|
|
type: boolean
|
|
description: Adminrechte erteilt
|
|
example: true
|
|
UserUpdateInfo:
|
|
description: Felder eines Benutzers die zu ändern sind
|
|
additionalProperties: false
|
|
properties:
|
|
password:
|
|
type: string
|
|
description: Zu setzendes Password des Nutzers
|
|
example: "Pa$$word"
|
|
admin:
|
|
type: boolean
|
|
description: Adminrechte erteilt
|
|
example: true
|
|
email:
|
|
type: string
|
|
description: "Email-Adresse des Nutzers"
|
|
example: mail@fawkes100.de
|
|
PasswordChangeRequest:
|
|
required:
|
|
- oldPassword
|
|
- newPassword
|
|
additionalProperties: false
|
|
properties:
|
|
oldPassword:
|
|
type: string
|
|
description: Bisheriges Passwort des Nutzers
|
|
example: "Pa$$word1"
|
|
newPassword:
|
|
type: string
|
|
description: Neues Passwort des Nutzers
|
|
example: "Pa$$word"
|
|
EMailChangeRequest:
|
|
required:
|
|
- password
|
|
- email
|
|
additionalProperties: false
|
|
properties:
|
|
password:
|
|
type: string
|
|
description: Passwort des Nutzers zu Sicherheitsüberpürfung
|
|
example: "Pa$$word1"
|
|
email:
|
|
type: string
|
|
description: Zusetzende Emailadresse des Nutzers
|
|
example: test@fawkes100.de
|
|
AccountDeleteRequest:
|
|
required:
|
|
- password
|
|
additionalProperties: false
|
|
properties:
|
|
password:
|
|
type: string
|
|
description: Passwort zur Sicherheitsüberprürfung
|
|
example: "Pa$$word1"
|
|
PropertyInfo:
|
|
required:
|
|
- property
|
|
- status
|
|
additionalProperties: false
|
|
properties:
|
|
property:
|
|
type: string
|
|
description: Name der Eigenschaft
|
|
example: "Registration disabled"
|
|
status:
|
|
type: boolean
|
|
description: Zustand der Eigenschaft
|
|
example: false
|
|
PropertyUpdateRequest:
|
|
required:
|
|
- settings
|
|
additionalProperties: false
|
|
properties:
|
|
settings:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/PropertyInfo'
|
|
PropertiesInfo:
|
|
required:
|
|
- settings
|
|
additionalProperties: false
|
|
properties:
|
|
settings:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/PropertyInfo' |