From 78c51b72061e67e19805ef4ff7242b27f512cfdb Mon Sep 17 00:00:00 2001 From: TuxCoder Date: Sun, 21 Jun 2020 11:42:23 +0200 Subject: [PATCH] add base auth to hydra admin api --- application.cfg | 2 ++ lenticular_cloud/app.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application.cfg b/application.cfg index 1548f14..95df450 100644 --- a/application.cfg +++ b/application.cfg @@ -20,6 +20,8 @@ DOMAIN = 'example.com' HYDRA_REQUEST_TIMEOUT_SECONDS = 3 HYDRA_ADMIN_URL = 'http://127.0.0.1:4445' +HYDRA_ADMIN_USER = 'lenticluar_cloud' +HYDRA_ADMIN_PASSWORD = 'notSecure' HYDRA_PUBLIC_URL = 'http://127.0.0.1:4444' SUBJECT_PREFIX = 'something random' diff --git a/lenticular_cloud/app.py b/lenticular_cloud/app.py index 327bf33..54eeb0b 100644 --- a/lenticular_cloud/app.py +++ b/lenticular_cloud/app.py @@ -50,7 +50,10 @@ def init_app(name=None): app.login_manager = LoginManager(app) #init hydra admin api - hydra_config = hydra.Configuration(app.config['HYDRA_ADMIN_URL']) + hydra_config = hydra.Configuration( + app.config['HYDRA_ADMIN_URL'], + username=app.config['HYDRA_ADMIN_USER'], + password=app.config['HYDRA_ADMIN_PASSWORD']) hydra_client = hydra.ApiClient(hydra_config) app.hydra_api = hydra.AdminApi(hydra_client)