INNER CODE UNIT · Python

generate_security_swagger_spec

fescobar/allure-docker-service · allure-docker-api/app.py:388

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']
            data['paths']['/logout-refresh-token'] = security_specs['logout_refresh_spec.json']
            data['components']['schemas']['login'] = security_specs['login_scheme.json']

            ensure_tags = ['Action', 'Project']
            security_type = security_specs['security_type.json']
            security_401_response = security_specs['security_unauthorized_response.json']
            security_403_response = security_specs['security_forbidden_response.json']
            security_crsf = security_specs['security_csrf.json']
            for path in data['paths']: #pylint: disable=too-many-nested-blocks

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…