diff --git a/README.md b/README.md index 6ea0572..52caac7 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,11 @@ Status endpoint, used for *healthcheck*. Shows also current version and commit h ### `GET /-/health` -Status endpoint, used for *healthcheck*. Shows also current version and commit hash. +Status endpoint, used for *healthcheck*. + +### `GET /-/config` + +Shows current runtime environment variables and their values. ### `GET /-/readme` diff --git a/app/main.py b/app/main.py index 8d0f5a5..27dbfbf 100644 --- a/app/main.py +++ b/app/main.py @@ -81,7 +81,24 @@ async def _index(): @app.get('/-/health', summary='* Health') async def _health(request: Request): - return JSONResponse({'status': 'up', 'version': VERSION, 'commit': COMMIT, 'debug': DEBUG}) + return JSONResponse({'status': 'up'}) + + +@app.get('/-/config', summary='* Config', description='returns environment variables.') +async def _config(): + return JSONResponse({ + 'VERSION': VERSION, + 'COMMIT': COMMIT, + 'DEBUG': DEBUG, + 'DLS_URL': DLS_URL, + 'DLS_PORT': DLS_PORT, + 'SITE_KEY_XID': SITE_KEY_XID, + 'INSTANCE_REF': INSTANCE_REF, + 'TOKEN_EXPIRE_DELTA': TOKEN_EXPIRE_DELTA, + 'LEASE_EXPIRE_DELTA': LEASE_EXPIRE_DELTA, + 'LEASE_RENEWAL_PERIOD': LEASE_RENEWAL_PERIOD, + 'CORS_ORIGINS': CORS_ORIGINS, + }) @app.get('/-/readme', summary='* Readme') diff --git a/test/main.py b/test/main.py index 9ef4457..8514e78 100644 --- a/test/main.py +++ b/test/main.py @@ -56,6 +56,11 @@ def test_health(): assert response.json()['status'] == 'up' +def test_config(): + response = client.get('/-/') + assert response.status_code == 200 + + def test_readme(): response = client.get('/-/readme') assert response.status_code == 200