#29-add-admin-role #2

Merged
philipp merged 10 commits from #29-add-admin-role into fork 2022-11-08 16:36:18 +01:00
3 changed files with 10 additions and 5 deletions
Showing only changes of commit 9ca056376c - Show all commits

View file

@ -7,3 +7,4 @@ REDIRECT_URL="https://example.org/login-callback"
SECRET_KEY=
LOAD_INCLUSTER_CONFIG=false
DATABASE_URL=sqlite:///database.db
AUTHENTIK_BASEURL="https://sso.example.org/api/v3"

View file

@ -1,11 +1,13 @@
import os
def env_file(key: str):
file_env = os.environ.get(f"{key}_FILE")
if file_env and os.path.exists(file_env):
return open(file_env).read().rstrip('\n')
return os.environ.get(key)
SECRET_KEY = env_file("SECRET_KEY")
HYDRA_CLIENT_ID = os.environ.get("HYDRA_CLIENT_ID")
@ -28,4 +30,7 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False
# Set this to "true" to load the config from a Kubernetes serviceaccount
# running in a Kubernetes pod. Set it to "false" to load the config from the
# `KUBECONFIG` environment variable.
LOAD_INCLUSTER_CONFIG = os.environ.get("LOAD_INCLUSTER_CONFIG").lower() == "true"
LOAD_INCLUSTER_CONFIG = os.environ.get(
"LOAD_INCLUSTER_CONFIG").lower() == "true"
AUTHENTIK_BASEURL = os.environ.get("AUTHENTIK_BASEURL")

View file

@ -1,11 +1,10 @@
from typing import List
from flask_jwt_extended import get_jwt
import requests
from config import AUTHENTIK_BASEURL
from .error_handler import AuthentikError
AUTHENTIK_BASEURL = "https://dev.local-it.cloud/api/v3"
class AuthentikApi: # TODO: check if can be replaced with apispec generated api?
@staticmethod
def __handleError(res):