From 1c429074def533b832ede62fdb138b1201163439 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 14 Oct 2022 09:11:07 -0500 Subject: http-api: T4749: transition to config_dict --- src/services/vyos-http-api-server | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/services') 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) -- cgit v1.2.3