summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-10-14 15:29:14 -0500
committerGitHub <noreply@github.com>2022-10-14 15:29:14 -0500
commit326c43632b94473083d8e78e71dca3c0ab3473f7 (patch)
tree1c0e4f9434c0bc0f98572e0a55bed654c7b3e761 /src/services
parent78f6b2fee6f133205c7e7cc381634a145f5a3b4c (diff)
parent1c429074def533b832ede62fdb138b1201163439 (diff)
downloadvyos-1x-326c43632b94473083d8e78e71dca3c0ab3473f7.tar.gz
vyos-1x-326c43632b94473083d8e78e71dca3c0ab3473f7.zip
Merge pull request #1597 from jestabro/http-api-config-dict
http-api: T4749: transition to config_dict for conf_mode http-api.py
Diffstat (limited to 'src/services')
-rwxr-xr-xsrc/services/vyos-http-api-server12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server
index 190f3409d..4ace981ca 100755
--- a/src/services/vyos-http-api-server
+++ b/src/services/vyos-http-api-server
@@ -686,10 +686,16 @@ if __name__ == '__main__':
app.state.vyos_keys = server_config['api_keys']
app.state.vyos_debug = server_config['debug']
- app.state.vyos_gql = server_config['gql']
- app.state.vyos_introspection = server_config['introspection']
app.state.vyos_strict = server_config['strict']
- app.state.vyos_origins = server_config.get('cors', {}).get('origins', [])
+ app.state.vyos_origins = server_config.get('cors', {}).get('allow_origin', [])
+ if 'gql' in server_config:
+ app.state.vyos_gql = True
+ if isinstance(server_config['gql'], dict) and 'introspection' in server_config['gql']:
+ app.state.vyos_introspection = True
+ else:
+ app.state.vyos_introspection = False
+ else:
+ app.state.vyos_gql = False
if app.state.vyos_gql:
graphql_init(app)