mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-12-28 08:34:04 +00:00
removed deprecated endpoints
- '/client-token' moved to '/-/client-token' - '/status' moved to '/-/health' and '/-/config' see README.md for more information
This commit is contained in:
parent
2e950ca6f4
commit
4fb6243330
@ -19,10 +19,6 @@ Only the clients need a connection to this service on configured port.
|
|||||||
|
|
||||||
Redirect to `/-/readme`.
|
Redirect to `/-/readme`.
|
||||||
|
|
||||||
### `GET /status` (deprecated: use `/-/health`)
|
|
||||||
|
|
||||||
Status endpoint, used for *healthcheck*. Shows also current version and commit hash.
|
|
||||||
|
|
||||||
### `GET /-/health`
|
### `GET /-/health`
|
||||||
|
|
||||||
Status endpoint, used for *healthcheck*.
|
Status endpoint, used for *healthcheck*.
|
||||||
@ -67,7 +63,7 @@ List current leases.
|
|||||||
|
|
||||||
Deletes an lease.
|
Deletes an lease.
|
||||||
|
|
||||||
### `GET /client-token` (deprecated: use `/-/client-token`)
|
### `GET /-/client-token`
|
||||||
|
|
||||||
Generate client token, (see [installation](#installation)).
|
Generate client token, (see [installation](#installation)).
|
||||||
|
|
||||||
|
10
app/main.py
10
app/main.py
@ -69,11 +69,6 @@ async def index():
|
|||||||
return RedirectResponse('/-/readme')
|
return RedirectResponse('/-/readme')
|
||||||
|
|
||||||
|
|
||||||
@app.get('/status', summary='* Status', description='returns current service status, version (incl. git-commit) and some variables.', deprecated=True)
|
|
||||||
async def status():
|
|
||||||
return JSONResponse({'status': 'up', 'version': VERSION, 'commit': COMMIT, 'debug': DEBUG})
|
|
||||||
|
|
||||||
|
|
||||||
@app.get('/-/', summary='* Index')
|
@app.get('/-/', summary='* Index')
|
||||||
async def _index():
|
async def _index():
|
||||||
return RedirectResponse('/-/readme')
|
return RedirectResponse('/-/readme')
|
||||||
@ -228,11 +223,6 @@ async def _client_token():
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
@app.get('/client-token', summary='* Client-Token', description='creates a new messenger token for this service instance', deprecated=True)
|
|
||||||
async def client_token():
|
|
||||||
return RedirectResponse('/-/client-token')
|
|
||||||
|
|
||||||
|
|
||||||
# venv/lib/python3.9/site-packages/nls_services_auth/test/test_origins_controller.py
|
# venv/lib/python3.9/site-packages/nls_services_auth/test/test_origins_controller.py
|
||||||
# {"candidate_origin_ref":"00112233-4455-6677-8899-aabbccddeeff","environment":{"fingerprint":{"mac_address_list":["ff:ff:ff:ff:ff:ff"]},"hostname":"my-hostname","ip_address_list":["192.168.178.123","fe80::","fe80::1%enp6s18"],"guest_driver_version":"510.85.02","os_platform":"Debian GNU/Linux 11 (bullseye) 11","os_version":"11 (bullseye)"},"registration_pending":false,"update_pending":false}
|
# {"candidate_origin_ref":"00112233-4455-6677-8899-aabbccddeeff","environment":{"fingerprint":{"mac_address_list":["ff:ff:ff:ff:ff:ff"]},"hostname":"my-hostname","ip_address_list":["192.168.178.123","fe80::","fe80::1%enp6s18"],"guest_driver_version":"510.85.02","os_platform":"Debian GNU/Linux 11 (bullseye) 11","os_version":"11 (bullseye)"},"registration_pending":false,"update_pending":false}
|
||||||
@app.post('/auth/v1/origin', description='find or create an origin')
|
@app.post('/auth/v1/origin', description='find or create an origin')
|
||||||
|
10
test/main.py
10
test/main.py
@ -44,11 +44,6 @@ def test_index():
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
def test_status():
|
|
||||||
response = client.get('/status')
|
|
||||||
assert response.status_code == 200
|
|
||||||
assert response.json()['status'] == 'up'
|
|
||||||
|
|
||||||
|
|
||||||
def test_health():
|
def test_health():
|
||||||
response = client.get('/-/health')
|
response = client.get('/-/health')
|
||||||
@ -76,11 +71,6 @@ def test_client_token():
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
def test_client_token_deprecated():
|
|
||||||
response = client.get('/client-token')
|
|
||||||
assert response.status_code == 200
|
|
||||||
|
|
||||||
|
|
||||||
def test_origins():
|
def test_origins():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user