From 52b0c630070437beceb905c4e0081c4ac2c5face Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Sat, 30 Mar 2024 09:08:39 +0100 Subject: [PATCH] WIP: Strip trailing url slash --- vault_oidc_ssh_cert_action.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vault_oidc_ssh_cert_action.py b/vault_oidc_ssh_cert_action.py index 7756894..423665b 100644 --- a/vault_oidc_ssh_cert_action.py +++ b/vault_oidc_ssh_cert_action.py @@ -64,7 +64,7 @@ def github_vault_auth() -> None: input_audience = os.environ["JWT_AUDIENCE"].strip() oidc_backend = os.environ["OIDC_BACKEND"].strip() oidc_role = os.environ["OIDC_ROLE"].strip() - vault_server = os.environ["VAULT_SERVER"].strip() + vault_server = os.environ["VAULT_SERVER"].strip("/ ") jwt_aud: str = _determine_audience(input_audience, vault_server) jwt_token: str = _issue_github_jwt(jwt_aud) @@ -80,7 +80,7 @@ def github_vault_auth() -> None: def generate_and_sign() -> None: ssh_backend = os.environ["SSH_BACKEND"].strip() ssh_role = os.environ["SSH_ROLE"].strip() - vault_server = os.environ["VAULT_SERVER"].strip() + vault_server = os.environ["VAULT_SERVER"].strip("/ ") vault_token = os.environ["VAULT_TOKEN"].strip() key_fname = "id_github" @@ -118,7 +118,7 @@ def generate_and_sign() -> None: def revoke_token() -> None: - vault_server = os.environ["VAULT_SERVER"].strip() + vault_server = os.environ["VAULT_SERVER"].strip("/ ") vault_token = os.environ["VAULT_TOKEN"].strip() revoke_url = f"{vault_server}/v1/auth/token/revoke-self"