diff --git a/openeogeotrellis/async_task.py b/openeogeotrellis/async_task.py index 41ad6b5b2..596e79b9f 100644 --- a/openeogeotrellis/async_task.py +++ b/openeogeotrellis/async_task.py @@ -182,7 +182,7 @@ def main(): try: def get_batch_jobs(batch_job_id: str, user_id: str) -> GpsBatchJobs: - vault = Vault("https://vault.vgt.vito.be") + vault = Vault(ConfigParams().vault_addr) catalog = get_layer_catalog(vault=vault, opensearch_enrich=True) jvm = java_gateway.jvm diff --git a/openeogeotrellis/backend.py b/openeogeotrellis/backend.py index f09e7e1f9..bac6654f3 100644 --- a/openeogeotrellis/backend.py +++ b/openeogeotrellis/backend.py @@ -311,8 +311,7 @@ def __init__( else ZooKeeperUserDefinedProcessRepository(hosts=ConfigParams().zookeepernodes) ) - # TODO #285 get vault url from config instead of hardcoding - vault = Vault("https://vault.vgt.vito.be") + vault = Vault(ConfigParams().vault_addr) catalog = get_layer_catalog(vault, opensearch_enrich=opensearch_enrich) diff --git a/openeogeotrellis/configparams.py b/openeogeotrellis/configparams.py index 294afeba4..895689b3b 100644 --- a/openeogeotrellis/configparams.py +++ b/openeogeotrellis/configparams.py @@ -47,6 +47,8 @@ def __init__(self, env=os.environ): self.etl_api = "https://etl-dev.terrascope.be" self.etl_api_oidc_issuer = "https://sso-int.terrascope.be/auth/realms/terrascope" + self.vault_addr = os.environ.get("VAULT_ADDR", "https://vault.vgt.vito.be") + def __str__(self) -> str: return pformat(vars(self)) diff --git a/openeogeotrellis/job_tracker.py b/openeogeotrellis/job_tracker.py index 962838e2e..55bc13678 100644 --- a/openeogeotrellis/job_tracker.py +++ b/openeogeotrellis/job_tracker.py @@ -370,7 +370,7 @@ def _to_serializable_datetime(epoch_millis: str) -> Union[str, None]: def get_etl_api_access_token(principal: str, keytab: str): - vault = Vault("https://vault.vgt.vito.be") + vault = Vault(ConfigParams().vault_addr) vault_token = vault.login_kerberos(principal, keytab) etl_api_credentials = vault.get_etl_api_credentials(vault_token)