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

chainguard issuer: use the same proof of possession cosign expects #1725

Closed
wants to merge 1 commit into from

Conversation

priyawadhwa
Copy link
Contributor

this should allow the chainguard issuer to work when the email verified claim is set

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 49.61%. Comparing base (cf238ac) to head (552c5c1).
Report is 136 commits behind head on main.

Files Patch % Lines
pkg/identity/chainguard/principal.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1725      +/-   ##
==========================================
- Coverage   57.93%   49.61%   -8.32%     
==========================================
  Files          50       71      +21     
  Lines        3119     4184    +1065     
==========================================
+ Hits         1807     2076     +269     
- Misses       1154     1879     +725     
- Partials      158      229      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

return &workflowPrincipal{
issuer: token.Issuer,
subject: token.Subject,
subject: subject,
Copy link
Member

Choose a reason for hiding this comment

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

We want our subject to be our subject. It's the challenge that's wrong.

Copy link
Member

Choose a reason for hiding this comment

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

I don't know what else keys off of the principal.Name but I could see us changing that.

I think that Fulcio and cosign using different functions to extract the information being signed for PoP is incredibly fragile because in cases like this the different pieces of logic will disagree even though nothing is actually incorrect (they are just extracting things inconsistently).

Copy link
Member

Choose a reason for hiding this comment

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

It looks like this is challenging to call directly the way the principal interface is set up, and the only call site of Name() is for the PoP so I can stage a change to do this with some test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would create another field, popSubject, set equal to oauthflow.SubjectFromToken, and update Name() to return token.popSubject.

Copy link
Member

Choose a reason for hiding this comment

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

I sent: #1726, which I think threads the needle.

I don't love this because Name() could start getting used elsewhere assuming it's subject and it would only break us, but anything more requires more significant surgery.

Copy link
Member

Choose a reason for hiding this comment

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

@haydentherapper I just saw your comment, that's what my PR does essentially.

Copy link
Contributor

Choose a reason for hiding this comment

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

PR LGTM

@haydentherapper
Copy link
Contributor

Closing in favor of the other

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.

3 participants