summaryrefslogtreecommitdiff
path: root/src/services/vyos-http-api-server
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2023-12-20 19:51:34 +0000
committerDaniil Baturin <daniil@baturin.org>2023-12-20 19:51:34 +0000
commit495bf4732439ebd55edfbf6050af8b2064993d86 (patch)
tree940a51bcf0086150ea855aacb3fbcaabdb954468 /src/services/vyos-http-api-server
parent7bad0e115ecc25224a0c3a2720a2697442624229 (diff)
downloadvyos-1x-495bf4732439ebd55edfbf6050af8b2064993d86.tar.gz
vyos-1x-495bf4732439ebd55edfbf6050af8b2064993d86.zip
https api: T5844: allow the server to start without API keys
and use only PAM auth and JWT
Diffstat (limited to 'src/services/vyos-http-api-server')
-rwxr-xr-xsrc/services/vyos-http-api-server6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server
index bfd50cc80..b64e58132 100755
--- a/src/services/vyos-http-api-server
+++ b/src/services/vyos-http-api-server
@@ -872,13 +872,15 @@ def initialization(session: ConfigSession, app: FastAPI = app):
global server
try:
server_config = load_server_config()
- keys = flatten_keys(server_config)
except Exception as e:
logger.critical(f'Failed to load the HTTP API server config: {e}')
sys.exit(1)
app.state.vyos_session = session
- app.state.vyos_keys = keys
+ app.state.vyos_keys = []
+
+ if 'keys' in server_config:
+ app.state.vyos_keys = flatten_keys(server_config)
app.state.vyos_debug = bool('debug' in server_config)
app.state.vyos_strict = bool('strict' in server_config)