From 9518804a027de1e76b563e180575e5e5128248c6 Mon Sep 17 00:00:00 2001 From: "Aaron (AJ) Steers" Date: Wed, 21 Feb 2024 17:09:20 +0000 Subject: [PATCH] update secret naming convention --- examples/run_integ_test_source.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/run_integ_test_source.py b/examples/run_integ_test_source.py index c9f17616..5c90b6eb 100644 --- a/examples/run_integ_test_source.py +++ b/examples/run_integ_test_source.py @@ -13,7 +13,7 @@ import airbyte as ab -def get_integ_test_config(connector_name: str): +def get_integ_test_config(secret_name: str): if "GCP_GSM_CREDENTIALS" not in os.environ: raise Exception( f"GCP_GSM_CREDENTIALS env variable not set, can't fetch secrets for '{connector_name}'. " @@ -26,12 +26,12 @@ def get_integ_test_config(connector_name: str): ) return json.loads( secret_client.access_secret_version( - name=f"projects/dataline-integration-testing/secrets/{connector_name.upper()}/versions/latest" + name=f"projects/dataline-integration-testing/secrets/{secret_name}/versions/latest" ).payload.data.decode("UTF-8") ) -def main(connector_name: str): +def main(connector_name: str, secret_name: str | None): config = get_integ_test_config(connector_name) source = ab.get_source( connector_name, @@ -56,4 +56,6 @@ def main(connector_name: str): if __name__ == "__main__": # Get first arg from CLI connector_name = sys.argv[1] - main(connector_name) + # TODO: We can optionally take a second arg to override the default secret name. + secret_name = f"SECRET_{connector_name.upper()}__CREDS" + main(connector_name, secret_name)