Source code for luna_api.app.auth.white_resources_list

"""
Module
Attributes:
    LunaAccountIdWhiteLists: storage with white lists for authorization with Luna-Account-Id header
    WhiteLists: storage with white lists for authorization with basic/bearer authorization header
"""
from vlutils.regexps import UUID_REGEXP_STR

from app.version import VERSION

_ver = VERSION["Version"]["api"]


[docs] class LunaAccountIdWhiteLists: """ White lists for authorization with Luna-Account-Id header Warnings: Authorization with Luna-Account-Id header is deprecated """ # methods, which usage allowed without authorization methods: tuple[str, ...] = ("GET", "HEAD", "OPTIONS") # routes, which usage allowed without authorization routes: list[str, ...] = [ f"/{_ver}/matcher/faces", f"/{_ver}/matcher/bodies", f"/{_ver}/events/statistic", f"/{_ver}/sdk", f"/{_ver}/liveness", f"/{_ver}/iso", f"/{_ver}/credentials_verifier", f"/{_ver}/lambdas/validator", ]
[docs] class WhiteLists: """White lists for authorization with basic/bearer authorization header""" # routes, which usage allowed without authorization routes: list[str, ...] = [ "/version", f"/{_ver}/healthcheck", "/healthcheck", f"/{_ver}/config", f"/{_ver}/credentials_verifier", f"/{_ver}/lambdas/validator", ] # methods, which usage allowed without authorization methods: tuple[str, ...] = ("OPTIONS",) # routes using for account creation accountCreationRoute: str = f"/{_ver}/accounts" # pattern for routes for getting documention docsPathPattern: str = f"/{_ver}/docs" # pattern for routes for getting documention lambdaDocsPathPattern: str = rf"/{_ver}/lambdas/{UUID_REGEXP_STR}/docs/spec" # prefix for matcher routes matcherRoutesPrefix: str = f"/{_ver}/matcher"