Skip to content

Commit

Permalink
WIP: Raise all the status
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaso committed Mar 29, 2024
1 parent 99492bd commit f3f48c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vault_oidc_ssh_cert_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def _issue_github_jwt(jwt_aud: str) -> str:
headers = {"Authorization": f"Bearer {req_token}"}

response = requests.get(full_url, headers=headers, timeout=10)
jwt_token: str = response.json()["value"]
response.raise_for_status()

jwt_token: str = response.json()["value"]
return jwt_token


Expand All @@ -33,8 +34,9 @@ def _issue_vault_token(
payload = {"jwt": jwt_token, "role": oidc_role}

response = requests.post(login_url, data=payload, timeout=10)
vault_token: str = response.json()["auth"]["client_token"]
response.raise_for_status()

vault_token: str = response.json()["auth"]["client_token"]
return vault_token


Expand All @@ -46,8 +48,9 @@ def _issue_ssh_cert(
payload = {"public_key": pubkey}

response = requests.post(issue_url, headers=headers, data=payload, timeout=10)
ssh_cert: str = response.json()["data"]["signed_key"]
response.raise_for_status()

ssh_cert: str = response.json()["data"]["signed_key"]
return ssh_cert


Expand Down

0 comments on commit f3f48c9

Please sign in to comment.