Read oidc users namespace name from env
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
@@ -10,6 +10,7 @@ from kubernetes import client, config
|
||||
page_api = Blueprint("api", __name__)
|
||||
db = MongoClient(const.MONGO_URI).get_default_database()
|
||||
api_key = os.getenv("INVENTORY_API_KEY")
|
||||
OIDC_USERS_NAMESPACE = os.getenv("OIDC_USERS_NAMESPACE")
|
||||
|
||||
def check_api_key(f):
|
||||
@wraps(f)
|
||||
@@ -26,7 +27,7 @@ def check_api_key(f):
|
||||
def get_users():
|
||||
config.load_incluster_config()
|
||||
api_instance = client.CustomObjectsApi()
|
||||
ret = api_instance.list_namespaced_custom_object("codemowers.io", "v1alpha1", "default", "oidcgatewayusers")
|
||||
ret = api_instance.list_namespaced_custom_object("codemowers.io", "v1alpha1", OIDC_USERS_NAMESPACE, "oidcgatewayusers")
|
||||
resp = []
|
||||
for item in ret["items"]:
|
||||
resp.append(item)
|
||||
|
Reference in New Issue
Block a user