Compare commits
1 Commits
master
...
jwt-experi
Author | SHA1 | Date | |
---|---|---|---|
73b94e8aa2
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,6 +1,2 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
ENV
|
ENV
|
||||||
*~
|
|
||||||
~*
|
|
||||||
.*~
|
|
||||||
|
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
stages:
|
|
||||||
- check
|
|
||||||
- dockerize
|
|
||||||
|
|
||||||
variables:
|
|
||||||
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
|
|
||||||
|
|
||||||
|
|
||||||
check:
|
|
||||||
image: registry.hottis.de/dockerized/base-build-env:latest
|
|
||||||
stage: check
|
|
||||||
tags:
|
|
||||||
- hottis
|
|
||||||
- linux
|
|
||||||
- docker
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
script:
|
|
||||||
- checksemver.py -v
|
|
||||||
--versionToValidate "$CI_COMMIT_TAG"
|
|
||||||
--validateMessage
|
|
||||||
--messageToValidate "$CI_COMMIT_MESSAGE"
|
|
||||||
|
|
||||||
dockerize:
|
|
||||||
image: registry.hottis.de/dockerized/docker-bash:latest
|
|
||||||
stage: dockerize
|
|
||||||
tags:
|
|
||||||
- hottis
|
|
||||||
- linux
|
|
||||||
- docker
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
script:
|
|
||||||
- docker build --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$CI_COMMIT_TAG .
|
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
||||||
- docker push $IMAGE_NAME:latest
|
|
||||||
- docker push $IMAGE_NAME:$CI_COMMIT_TAG
|
|
@ -20,7 +20,9 @@ RUN \
|
|||||||
pip3 install connexion && \
|
pip3 install connexion && \
|
||||||
pip3 install connexion[swagger-ui] && \
|
pip3 install connexion[swagger-ui] && \
|
||||||
pip3 install uwsgi && \
|
pip3 install uwsgi && \
|
||||||
pip3 install flask-cors
|
pip3 install flask-cors && \
|
||||||
|
pip3 install python-jose[cryptography] && \
|
||||||
|
pip3 install six
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
mkdir -p ${APP_DIR} && \
|
mkdir -p ${APP_DIR} && \
|
||||||
|
23
Mieter.py
23
Mieter.py
@ -21,29 +21,6 @@ SELECT m.id as id,
|
|||||||
w.id = m.wohnung
|
w.id = m.wohnung
|
||||||
""", [], "Mieter")
|
""", [], "Mieter")
|
||||||
|
|
||||||
def get_mieters_active():
|
|
||||||
return getMany("""
|
|
||||||
SELECT m.id as id,
|
|
||||||
o.id as objekt,
|
|
||||||
w.id as wohnung,
|
|
||||||
w.shortname as wohnung_shortname,
|
|
||||||
o.shortname as objekt_shortname,
|
|
||||||
COALESCE(m.anrede, '-') as anrede,
|
|
||||||
COALESCE(m.vorname, '-') as vorname,
|
|
||||||
m.nachname as nachname,
|
|
||||||
COALESCE(m.strasse, '-') as strasse,
|
|
||||||
COALESCE(m.plz, '-') as plz,
|
|
||||||
COALESCE(m.ort, '-') as ort,
|
|
||||||
COALESCE(m.telefon, '-') as telefon,
|
|
||||||
m.einzug as einzug,
|
|
||||||
COALESCE(m.auszug, '-') as auszug
|
|
||||||
FROM wohnung w, objekt o, mieter m
|
|
||||||
WHERE o.id = w.objekt AND
|
|
||||||
w.id = m.wohnung AND
|
|
||||||
m.einzug <= curdate() and
|
|
||||||
(m.auszug is null or m.auszug > curdate())
|
|
||||||
""", [], "Mieter")
|
|
||||||
|
|
||||||
def get_mieter(id=None):
|
def get_mieter(id=None):
|
||||||
return getOne("""
|
return getOne("""
|
||||||
SELECT m.id as id,
|
SELECT m.id as id,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from dbpool import getConnection, getOne, getMany, putOne, call
|
from dbpool import getConnection, getOne, getMany, putOne
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
import dateparser
|
import dateparser
|
||||||
@ -106,22 +106,11 @@ WHERE mieter = ? AND
|
|||||||
"zahlungen": float(sumZ)
|
"zahlungen": float(sumZ)
|
||||||
}
|
}
|
||||||
|
|
||||||
def put_zahlung(**args):
|
def put_zahlung(zahlung):
|
||||||
try:
|
print("Input of put_zahlung: {} {}".format(type(zahlung), zahlung))
|
||||||
body = args["body"]
|
datum_soll = dateparser.parse(zahlung["datum_soll"], languages=["de"])
|
||||||
datum_soll_raw = body["datum_soll"]
|
datum_ist = dateparser.parse(zahlung["datum_ist"], languages=["de"])
|
||||||
datum_ist_raw = body["datum_ist"]
|
|
||||||
|
|
||||||
print("Input of put_zahlung: {}".format(body))
|
|
||||||
datum_soll = dateparser.parse(datum_soll_raw, languages=["de"])
|
|
||||||
datum_ist = dateparser.parse(datum_ist_raw, languages=["de"])
|
|
||||||
return putOne("""
|
return putOne("""
|
||||||
INSERT INTO zahlung (datum_soll, datum_ist, mieter, betrag, kommentar)
|
INSERT INTO zahlung (datum_soll, datum_ist, mieter, betrag, kommentar)
|
||||||
VALUES(?, ?, ?, ?, ?)
|
VALUES(?, ?, ?, ?, ?)
|
||||||
""", [ datum_soll, datum_ist, body["mieter"], body["betrag"], body["kommentar"] ], "Zahlung")
|
""", [ datum_soll, datum_ist, zahlung["mieter"], zahlung["betrag"], zahlung["kommentar"] ], "Zahlung")
|
||||||
except KeyError as e:
|
|
||||||
print("Some parameter missing: {}".format(e))
|
|
||||||
return str(e), 500
|
|
||||||
|
|
||||||
def insertAllForMonth():
|
|
||||||
return call("insert_monatl_miet_forderung")
|
|
||||||
|
44
auth.py
Normal file
44
auth.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
import connexion
|
||||||
|
import six
|
||||||
|
from werkzeug.exceptions import Unauthorized
|
||||||
|
|
||||||
|
from jose import JWTError, jwt
|
||||||
|
|
||||||
|
JWT_ISSUER = 'de.hottis.hausverwaltung'
|
||||||
|
JWT_SECRET = 'streng_geheim'
|
||||||
|
JWT_LIFETIME_SECONDS = 600
|
||||||
|
JWT_ALGORITHM = 'HS256'
|
||||||
|
|
||||||
|
|
||||||
|
def generate_token(user_id):
|
||||||
|
timestamp = _current_timestamp()
|
||||||
|
payload = {
|
||||||
|
"iss": JWT_ISSUER,
|
||||||
|
"iat": int(timestamp),
|
||||||
|
"exp": int(timestamp + JWT_LIFETIME_SECONDS),
|
||||||
|
"sub": str(user_id),
|
||||||
|
}
|
||||||
|
|
||||||
|
return jwt.encode(payload, JWT_SECRET, algorithm=JWT_ALGORITHM)
|
||||||
|
|
||||||
|
|
||||||
|
def decode_token(token):
|
||||||
|
try:
|
||||||
|
return jwt.decode(token, JWT_SECRET, algorithms=[JWT_ALGORITHM])
|
||||||
|
except JWTError as e:
|
||||||
|
six.raise_from(Unauthorized, e)
|
||||||
|
|
||||||
|
|
||||||
|
def get_secret(user, token_info) -> str:
|
||||||
|
return '''
|
||||||
|
You are user_id {user} and the secret is 'wbevuec'.
|
||||||
|
Decoded token claims: {token_info}.
|
||||||
|
'''.format(user=user, token_info=token_info)
|
||||||
|
|
||||||
|
|
||||||
|
def _current_timestamp() -> int:
|
||||||
|
return int(time.time())
|
||||||
|
|
2
build.sh
2
build.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
IMAGE_NAME="registry.hottis.de/hv/hv-service"
|
IMAGE_NAME="registry.hottis.de/hv/hv-service"
|
||||||
VERSION=0.0.4
|
VERSION=0.0.3
|
||||||
|
|
||||||
docker build -t ${IMAGE_NAME}:${VERSION} .
|
docker build -t ${IMAGE_NAME}:${VERSION} .
|
||||||
docker push ${IMAGE_NAME}:${VERSION}
|
docker push ${IMAGE_NAME}:${VERSION}
|
||||||
|
24
dbpool.py
24
dbpool.py
@ -83,7 +83,6 @@ def putOne(stmt, params, objName):
|
|||||||
except mariadb.Error as err:
|
except mariadb.Error as err:
|
||||||
dbh.rollback()
|
dbh.rollback()
|
||||||
print("Database error in putOne({}): {}".format(objName, err))
|
print("Database error in putOne({}): {}".format(objName, err))
|
||||||
return str(err), 500
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
dbh.rollback()
|
dbh.rollback()
|
||||||
print("Error in putOne({}): {}".format(objName, err))
|
print("Error in putOne({}): {}".format(objName, err))
|
||||||
@ -95,26 +94,3 @@ def putOne(stmt, params, objName):
|
|||||||
if dbh:
|
if dbh:
|
||||||
dbh.close()
|
dbh.close()
|
||||||
|
|
||||||
def call(procName):
|
|
||||||
dbh = None
|
|
||||||
cur = None
|
|
||||||
try:
|
|
||||||
dbh = getConnection()
|
|
||||||
cur = dbh.cursor(dictionary=True)
|
|
||||||
cur.execute("CALL {}(null)".format(procName))
|
|
||||||
dbh.commit()
|
|
||||||
return "{} successfully called".format(procName), 202
|
|
||||||
except mariadb.Error as err:
|
|
||||||
dbh.rollback()
|
|
||||||
print("Database error in call {}: {}".format(procName, err))
|
|
||||||
return str(err), 500
|
|
||||||
except Exception as err:
|
|
||||||
dbh.rollback()
|
|
||||||
print("Some error in call {}: {}".format(procName, err))
|
|
||||||
return str(err), 500
|
|
||||||
finally:
|
|
||||||
print("return connection in call {}".format(procName))
|
|
||||||
if cur:
|
|
||||||
cur.close()
|
|
||||||
if dbh:
|
|
||||||
dbh.close()
|
|
||||||
|
@ -4,4 +4,3 @@ wsgi-file = server.py
|
|||||||
processes = 4
|
processes = 4
|
||||||
stats = :9191
|
stats = :9191
|
||||||
|
|
||||||
|
|
||||||
|
170
swagger.yaml
170
swagger.yaml
@ -1,7 +1,7 @@
|
|||||||
openapi: 3.0.0
|
openapi: 3.0.0
|
||||||
info:
|
info:
|
||||||
title: Hausverwaltung
|
title: Hausverwaltung-JWT
|
||||||
version: "0.1"
|
version: "0.2"
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
/hv/objekte:
|
/hv/objekte:
|
||||||
@ -12,12 +12,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Objekt'
|
$ref: '#/components/Objekt'
|
||||||
404:
|
404:
|
||||||
description: No Objekte available
|
description: No Objekte available
|
||||||
500:
|
500:
|
||||||
@ -30,16 +28,13 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Objekt'
|
$ref: '#/components/Objekt'
|
||||||
404:
|
404:
|
||||||
description: Objekt not found
|
description: Objekt not found
|
||||||
500:
|
500:
|
||||||
@ -52,12 +47,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Wohnung'
|
$ref: '#/components/Wohnung'
|
||||||
404:
|
404:
|
||||||
description: No Wohnung available
|
description: No Wohnung available
|
||||||
500:
|
500:
|
||||||
@ -70,18 +63,15 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Wohnung'
|
$ref: '#/components/Wohnung'
|
||||||
404:
|
404:
|
||||||
description: No Wohnung available
|
description: No Wohnung available
|
||||||
500:
|
500:
|
||||||
@ -94,16 +84,13 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Wohnung'
|
$ref: '#/components/Wohnung'
|
||||||
404:
|
404:
|
||||||
description: Wohnung not found
|
description: Wohnung not found
|
||||||
500:
|
500:
|
||||||
@ -116,30 +103,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Mieter'
|
$ref: '#/components/Mieter'
|
||||||
404:
|
|
||||||
description: No Mieter available
|
|
||||||
500:
|
|
||||||
description: Some server error
|
|
||||||
/hv/mieters/active:
|
|
||||||
get:
|
|
||||||
tags: [ "Mieter" ]
|
|
||||||
operationId: Mieter.get_mieters_active
|
|
||||||
summary: Returns all currently active Mieters
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: Successful response.
|
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Mieter'
|
|
||||||
404:
|
404:
|
||||||
description: No Mieter available
|
description: No Mieter available
|
||||||
500:
|
500:
|
||||||
@ -152,16 +119,13 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Mieter'
|
$ref: '#/components/Mieter'
|
||||||
404:
|
404:
|
||||||
description: Mieter not found
|
description: Mieter not found
|
||||||
500:
|
500:
|
||||||
@ -174,16 +138,13 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Forderung'
|
$ref: '#/components/Forderung'
|
||||||
404:
|
404:
|
||||||
description: Forderung not found
|
description: Forderung not found
|
||||||
500:
|
500:
|
||||||
@ -196,18 +157,15 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: mieter_id
|
- name: mieter_id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Forderung'
|
$ref: '#/components/Forderung'
|
||||||
404:
|
404:
|
||||||
description: No Forderung available
|
description: No Forderung available
|
||||||
500:
|
500:
|
||||||
@ -220,16 +178,13 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: id
|
- name: id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Zahlung'
|
$ref: '#/components/Zahlung'
|
||||||
404:
|
404:
|
||||||
description: Zahlung not found
|
description: Zahlung not found
|
||||||
500:
|
500:
|
||||||
@ -242,18 +197,15 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: mieter_id
|
- name: mieter_id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response.
|
description: Successful response.
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Zahlung'
|
$ref: '#/components/Zahlung'
|
||||||
404:
|
404:
|
||||||
description: No Zahlung available
|
description: No Zahlung available
|
||||||
500:
|
500:
|
||||||
@ -266,23 +218,19 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: mieter_id
|
- name: mieter_id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
- name: year
|
- name: year
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response
|
description: Successful response
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/ZahlungForderung'
|
$ref: '#/components/ZahlungForderung'
|
||||||
404:
|
404:
|
||||||
description: No ZahlungForderung available
|
description: No ZahlungForderung available
|
||||||
500:
|
500:
|
||||||
@ -295,21 +243,17 @@ paths:
|
|||||||
parameters:
|
parameters:
|
||||||
- name: mieter_id
|
- name: mieter_id
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
- name: year
|
- name: year
|
||||||
in: path
|
in: path
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
type: integer
|
||||||
|
required: true
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Successful response
|
description: Successful response
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Saldo'
|
$ref: '#/components/Saldo'
|
||||||
404:
|
404:
|
||||||
description: Neither Forderungen nor Zahlungen available
|
description: Neither Forderungen nor Zahlungen available
|
||||||
500:
|
500:
|
||||||
@ -319,32 +263,52 @@ paths:
|
|||||||
tags: [ "Zahlung" ]
|
tags: [ "Zahlung" ]
|
||||||
operationId: ZahlungenForderungen.put_zahlung
|
operationId: ZahlungenForderungen.put_zahlung
|
||||||
summary: Inserts a new Zahlung
|
summary: Inserts a new Zahlung
|
||||||
requestBody:
|
parameters:
|
||||||
description: Zahlung
|
- name: zahlung
|
||||||
content:
|
in: body
|
||||||
application/json:
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Zahlung'
|
$ref: '#/components/Zahlung'
|
||||||
responses:
|
responses:
|
||||||
202:
|
202:
|
||||||
description: Zahlung successfully inserted
|
description: Zahlung successfully inserted
|
||||||
500:
|
500:
|
||||||
description: Some server or database error
|
description: Some server or database error
|
||||||
/hv/forderung/insertAllForMonth:
|
/auth/{user_id}:
|
||||||
post:
|
get:
|
||||||
tags: [ "Forderung" ]
|
tags: [ "jwt" ]
|
||||||
operationId: ZahlungenForderungen.insertAllForMonth
|
summary: Return JWT token
|
||||||
summary: Insert the Forderungen for the insertAllForMonth
|
operationId: auth.generate_token
|
||||||
|
parameters:
|
||||||
|
- name: user_id
|
||||||
|
description: User unique identifier
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
example: 12
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
responses:
|
responses:
|
||||||
202:
|
'200':
|
||||||
description: Forderungen successfully inserted
|
description: JWT token
|
||||||
500:
|
content:
|
||||||
description: Some server or database error
|
'text/plain':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
/secret:
|
||||||
|
get:
|
||||||
|
tags: [ "jwt" ]
|
||||||
|
summary: Return secret string
|
||||||
|
operationId: auth.get_secret
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: secret response
|
||||||
|
content:
|
||||||
|
'text/plain':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
|
||||||
Objekt:
|
Objekt:
|
||||||
description: Objekt type
|
description: Objekt type
|
||||||
type: object
|
type: object
|
||||||
@ -463,3 +427,9 @@ components:
|
|||||||
type: number
|
type: number
|
||||||
saldo:
|
saldo:
|
||||||
type: number
|
type: number
|
||||||
|
securitySchemes:
|
||||||
|
jwt:
|
||||||
|
type: http
|
||||||
|
scheme: bearer
|
||||||
|
bearerFormat: JWT
|
||||||
|
x-bearerInfoFunc: auth.decode_token
|
Reference in New Issue
Block a user