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

Show the federated IdP in the CLI instead of the Sigstore DEX instance #184

Merged
merged 1 commit into from
May 20, 2024

Conversation

mayaCostantini
Copy link
Contributor

Resolves #157

Summary

Show the federated IdP instead of the Sigstore DEX instance, extracted from sigstore.oidc.IdentityToken.
As mentioned in the comment, this is more of a workaround for versions of sigstore-python earlier than 3.0.0, as the federated_issuer property could be called directly in the latest version.

Release Note

Replaced DEX instance with federated IdP in signing CLI field identity-provider.

Documentation

No documentation required.

mihaimaruseac
mihaimaruseac previously approved these changes May 17, 2024
Copy link
Collaborator

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mihaimaruseac
Copy link
Collaborator

Oh, can you fix the lint issues, please (lines too long)

# Calling the private attribute IdentityToken._federated issuer is a workaround
# For earlier versions of sigstore-python (<3.0.0) that do not support the
# federated_issuer property.
print(f"identity-provider: {oidc_token._federated_issuer}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is federated issuer always set? If a non-Dex token is used, what is this value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@woodruffw please advise

Copy link
Collaborator

@laurentsimon laurentsimon May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mayaCostantini this is the original issue + solution that @woodruffw told us should work sigstore/sigstore-python#970 (comment). So the right solution is probably .expected_certificate_subject instead of . _federated_issuer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With sigstore-python 3.0.0, federated_issuer should fall back to the "top-level" issuer if the Dex-specific federation claim isn't present. You can see that here:

https://github.com/sigstore/sigstore-python/blob/29c98ea7f58c3047b9b5e062af912f4523ff1514/sigstore/oidc.py#L208-L227

(Before 3.0.0, federated_issuer was called expected_certificate_subject, which was a misleading name. But they're the same API.)

Copy link
Collaborator

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@haydentherapper
Copy link
Collaborator

Can you fix the lint failure? LGTM otherwise, thanks!

@mayaCostantini
Copy link
Contributor Author

Thanks for the reviews, the linting issues should be fixed now.

@mihaimaruseac mihaimaruseac merged commit 941764c into sigstore:main May 20, 2024
18 checks passed
@mihaimaruseac
Copy link
Collaborator

Thank you!

@mayaCostantini mayaCostantini deleted the show-federated-idp branch May 20, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix IdP shown in CLI
5 participants