summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2023-12-20 19:50:44 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-12-20 20:02:52 +0000
commit59c2d8333db9be0ea2e9bc448ac189568bf7475a (patch)
treecf38e688b48ac7b6deb7d273eb8521152d12e06f /src/conf_mode
parent316a930b8c54155a45e92796ad2ab69283aa1eb0 (diff)
downloadvyos-1x-59c2d8333db9be0ea2e9bc448ac189568bf7475a.tar.gz
vyos-1x-59c2d8333db9be0ea2e9bc448ac189568bf7475a.zip
https api: T5844: issue a warning about the classic API unavailability
when no API keys are set (cherry picked from commit 7bad0e115ecc25224a0c3a2720a2697442624229)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/https.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/https.py b/src/conf_mode/https.py
index 40b7de557..3dc5dfc01 100755
--- a/src/conf_mode/https.py
+++ b/src/conf_mode/https.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2022 VyOS maintainers and contributors
+# Copyright (C) 2019-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -24,6 +24,7 @@ from time import sleep
import vyos.defaults
import vyos.certbot_util
+from vyos.base import Warning
from vyos.config import Config
from vyos.configdiff import get_config_diff
from vyos.configverify import verify_vrf
@@ -193,6 +194,9 @@ def verify(https):
if (not valid_keys_exist) and (not jwt_auth):
raise ConfigError('At least one HTTPS API key is required unless GraphQL token authentication is enabled')
+ if (not valid_keys_exist) and jwt_auth:
+ Warning(f'API keys are not configured: the classic (non-GraphQL) API will be unavailable.')
+
return None
def generate(https):