Skip to content

Commit

Permalink
Fix error in secrets_fetcher after session change (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl authored Dec 19, 2024
1 parent 57883eb commit 9592c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions baseplate/sidecars/secrets_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _vault_kubernetes_auth(self) -> tuple[str, datetime.datetime]:
login_data = {"jwt": token, "role": self.role}

logger.debug("Obtaining Vault token via kubernetes auth.")
response = self.session.post(
response = self._make_session().post(
urllib.parse.urljoin(self.base_url, f"v1/auth/{self.mount_point}/login"),
json=login_data,
timeout=5, # seconds
Expand Down Expand Up @@ -241,7 +241,7 @@ def _vault_aws_auth(self) -> tuple[str, datetime.datetime]:
login_data = {"role": self.role, "pkcs7": identity_document, "nonce": nonce}

logger.debug("Obtaining Vault token via aws auth.")
response = self.session.post(
response = self._make_session().post(
urllib.parse.urljoin(self.base_url, f"v1/auth/{self.mount_point}/login"),
json=login_data,
timeout=5, # seconds
Expand Down Expand Up @@ -292,7 +292,7 @@ def __init__(
self.token = token
self.token_expiration = token_expiration

def close(self):
def close(self) -> None:
self.session.close()

@property
Expand Down

0 comments on commit 9592c07

Please sign in to comment.