Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ spec:
value: {{ index .Values "clientId" | quote }}
- name: IAM_CLIENT_SECRET
value: {{ index .Values "clientSecret" | quote }}
- name: IAM_BASE_URL
value: {{ index .Values "iamBaseUrl" | quote }}
- name: EIC_HOST_URL
value: {{ index .Values "eicHostUrl" | quote }}
- name: LOG_ENDPOINT
value: {{ index .Values "logEndpoint" | quote }}
- name: CA_CERT_FILE_PATH
Expand Down
4 changes: 2 additions & 2 deletions eric-oss-hello-world-python-app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_config():
"""get env and return config with all env vals required"""
iam_client_id = get_os_env_string("IAM_CLIENT_ID", "")
iam_client_secret = get_os_env_string("IAM_CLIENT_SECRET", "")
iam_base_url = get_os_env_string("IAM_BASE_URL", "")
eic_host_url = get_os_env_string("EIC_HOST_URL", "")
ca_cert_file_name = get_os_env_string("CA_CERT_FILE_NAME", "")
ca_cert_file_path = get_os_env_string("CA_CERT_FILE_PATH", "")
log_ctrl_file = get_os_env_string("LOG_CTRL_FILE", "")
Expand All @@ -21,7 +21,7 @@ def get_config():
config = {
"iam_client_id": iam_client_id,
"iam_client_secret": iam_client_secret,
"iam_base_url": iam_base_url,
"eic_host_url": eic_host_url,
"ca_cert_file_name": ca_cert_file_name,
"ca_cert_file_path": ca_cert_file_path,
"log_ctrl_file": log_ctrl_file,
Expand Down
2 changes: 1 addition & 1 deletion eric-oss-hello-world-python-app/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def login():
"""
config = get_config()
login_path = "/auth/realms/master/protocol/openid-connect/token"
login_url = urljoin(config.get("iam_base_url"), login_path)
login_url = urljoin(config.get("eic_host_url"), login_path)
headers = {"Content-Type": "application/x-www-form-urlencoded"}
resp = tls_login(login_url, headers)
resp = json.loads(resp.decode("utf-8"))
Expand Down
4 changes: 2 additions & 2 deletions eric-oss-hello-world-python-app/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def match_request_data(request):
@pytest.fixture(name="mock_login_api")
def fixture_mock_login_api(config):
login_endpoint = urljoin(
config.get("iam_base_url"), "/auth/realms/master/protocol/openid-connect/token"
config.get("eic_host_url"), "/auth/realms/master/protocol/openid-connect/token"
)
with requests_mock.Mocker() as request_mocker:
request_mocker.post(
Expand Down Expand Up @@ -111,7 +111,7 @@ def no_log_certs():
def populate_environment_variables():
os.environ["IAM_CLIENT_ID"] = "IAM_CLIENT_ID"
os.environ["IAM_CLIENT_SECRET"] = "IAM_CLIENT_SECRET"
os.environ["IAM_BASE_URL"] = "https://www.iam-base-url.com"
os.environ["EIC_HOST_URL"] = "https://www.eic-host-url.com"
os.environ["CA_CERT_FILE_NAME"] = "CA_CERT_FILE_NAME"
os.environ["CA_CERT_FILE_PATH"] = "CA_CERT_MOUNT_PATH"
os.environ["LOG_ENDPOINT"] = "LOG_ENDPOINT"
Expand Down
2 changes: 1 addition & 1 deletion eric-oss-hello-world-python-app/tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_login_receives_token_x509(mock_login_api, config):
def test_login_bad_credentials(requests_mock, config):
"""Ensure we get an error if credentials are bad"""
login_url = urljoin(
config.get("iam_base_url"), "/auth/realms/master/protocol/openid-connect/token"
config.get("eic_host_url"), "/auth/realms/master/protocol/openid-connect/token"
)
requests_mock.post(
login_url, status_code=400, json={"error": "invalid_request"}
Expand Down