-
Notifications
You must be signed in to change notification settings - Fork 963
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
Trusted publishing: support for Google Cloud service accounts #13551
Comments
Hmm, the |
This is some reference to the user the token was issued to
These are specific to Compute Engine identities and might not be universally available. I think we'll just want to verify More details here: https://cloud.google.com/docs/authentication/token-types#id |
Sounds good! It looks like |
Opened #13553 to kick this off: it refactors |
Thinking about |
@woodruffw I can work on finishing #13571 and adding the forms/views if you want to work on the emails? |
Works for me! I'll work on the emails tonight. |
This makes the `trusted-publisher-added` and `trusted-publisher-removed` email structures a little more generic, allowing them to be re-used over both GitHub and Google publishers. Future publishers will require additional accommodations. See pypi#13551. Signed-off-by: William Woodruff <[email protected]>
Opened #13872 for the email side of this. |
* oidc/models/google: add missing members Signed-off-by: William Woodruff <[email protected]> * tests, warehouse: general publishing emails This makes the `trusted-publisher-added` and `trusted-publisher-removed` email structures a little more generic, allowing them to be re-used over both GitHub and Google publishers. Future publishers will require additional accommodations. See #13551. Signed-off-by: William Woodruff <[email protected]> * warehouse: make publisher_url optional Signed-off-by: William Woodruff <[email protected]> * warehouse: `make translations` Signed-off-by: William Woodruff <[email protected]> * tests: fix google publisher_url test Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
Yeah, I was thinking it might make sense to have it be a "tabbed" component like the publisher creation forms: rather than having a "publisher" column, the tabs would select the appropriate table to display by publisher name. OTOH, if that's too complicated, would could instead simplify the table to just |
The implementation will be complete in #15144 but will be disabled via AdminFlag until we have docs and we're ready to make this available. |
Here's something fun: the Google IdP doesn't provide a But we currently require this claim to be present: warehouse/warehouse/oidc/services.py Line 254 in ad08a81
|
I suspect we could just require one of |
Ah yeah, that's a great point -- I hadn't realized they have the exact same body. In that case, we can probably simply ignore |
I think we should still check nbf if it's present? That may be what you mean and I'm just not parsing your message correctly. |
Nope, that's my bad -- I had a chat open with @di, and I got things crossed. I was proposing checking just |
I'm going to move forward with provider-specific checks for |
👍 I dunno the OIDC spec, but at least with jwts there's in theory nothing stopping you from issuing a token today, that's not intended to be valid until tomorrow. I don't know why you'd do such a thing, but I think it's possible? I also think we can just drop |
Aha, perfect! |
Fix is here: #15197 |
To keep things tracked: this is almost entirely done, and is just waiting on #15192 (which is itself pending documentation additions from the other in-flight provider implementations). |
Done! |
Support for these would allow PyPI users with Google Cloud-based publishing workflows to benefit from trusted publishing.
An example claim set from a Google Cloud service account, lightly anonymized:
I've tried to keep the substitution names consistent above, to show where field values are duplicated.
Based on that claim set, it looks like the relevant uniquely identifying fields are:
aud
(which should bepypi
, similar to GitHub-issued JWTs)azp
: no idea what this isgoogle.project_id
: presumably configured by a usergoogle.project_number
: presumably a unique ID that prevents resurrection ofgoogle.project_id
email
: presumably derivable consistently fromgoogle.project_number
So, my first educated guess is that we'll want to allow users to configure (3) and (4). Does that sound right to you @di?
warehouse.oidc.models
to make adding new publisher models simpler (warehouse, tests: devolveoidc.models
#13553)The text was updated successfully, but these errors were encountered: