INNER CODE UNIT · Python
is_endpoint_swagger_protected
fescobar/allure-docker-service · allure-docker-api/app.py:379
def is_endpoint_swagger_protected(method, path):
if MAKE_VIEWER_ENDPOINTS_PUBLIC is False:
return True
for info in PROTECTED_ENDPOINTS:
if info['method'] == method and path == info['path']:
return True
return False
def generate_security_swagger_spec():
try:
security_specs = get_security_specs()
with open("{}/swagger/swagger.json".format(STATIC_CONTENT)) as json_file:
data = json.load(json_file)
data['tags'].insert(1, security_specs['security_tags.json'])
data['paths']['/login'] = security_specs['login_spec.json']
data['paths']['/refresh'] = security_specs['refresh_spec.json']
data['paths']['/logout'] = security_specs['logout_spec.json']