import os APP_NAME = "slz-api-service" ENVIRONMENT = os.getenv('ENVIRONMENT', 'dev') ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) STATIC_PATH = os.path.join(ROOT_PATH, 'static') SWAGGER_SPEC_PATH = os.path.join(ROOT_PATH, 'v1', 'swagger.yaml') #: Port to expose for webserver SERVICE_PORT = os.getenv('SERVICE_PORT', 8000) #: AWS configuration AWS_DEFAULT_REGION = os.getenv('AWS_DEFAULT_REGION', 'us-east-1') #: Auth0 and OAuth2 config AUTH0_DOMAIN = os.getenv('AUTH0_DOMAIN', 'dev-delphi.auth0.com') AUTH0_API_AUDIENCE = os.getenv('AUTH0_API_AUDIENCE', 'dev-delphi-slz-api') AUTH0_ALGORITHMS = ['RS256'] #: This shouldn't be changed without updating the implementors. It's here to find usages in code DEFAULT_OAUTH2_FLOW = 'client_credentials' OAUTH2_CALLBACK_URL = '/oauth/callback' OAUTH2_TOKEN_URL = '/oauth/token' #: Used for the bucket name in the S3 URI for files ARCHIVE_BUCKET = os.getenv('ARCHIVE_BUCKET', f'dev-sme-data-archive') #: Use S3 as the data source by default USE_S3 = os.getenv('USE_S3', 'true').lower() == 'true' #: Default size for API results pagination DEFAULT_PAGE_SIZE = 1000 #: Default TTL for caches DEFAULT_CACHE_TTL = 4 * 60 * 60 # 4 hours DEFAULT_CACHE_MAX_SIZE = 128 # max number of objects to hold #: AWS secret name for the secret containing the list of Auth0 clients by client ID CLIENTS_LIST_SECRET_NAME = os.getenv('CLIENTS_LIST_SECRET_NAME', f'delphi/{ENVIRONMENT}/slz/api/clients_list') #: Cache duration to store the clients list from AWS secrets manager CLIENTS_LIST_CACHE_TTL = int(os.getenv('CLIENTS_LIST_CACHE_TTL', DEFAULT_CACHE_TTL))