Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be a bit more informative about JWT audience #29

Merged
merged 2 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: andreaso/[email protected]
with:
vault_server: https://vault.example.com:8200
jwt_audience: vault.example.com
oidc_backend_path: github-oidc
oidc_role: example-user
ssh_backend_path: ssh-client-ca
Expand Down
8 changes: 7 additions & 1 deletion vault_oidc_ssh_cert_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ def _determine_audience(input_audience: str, vault_server: str) -> str:
return input_audience

vault_fqdn = urllib.parse.urlparse(vault_server).netloc.split(":")[0]
return vault_fqdn
if vault_fqdn:
return vault_fqdn

title = "Default JWT audience error"
message = "Failed to extract a default JWT audience from the vault_server input."
_set_error_message(title, message)
raise VoscaError(title)


def _issue_github_jwt(jwt_aud: str) -> str:
Expand Down