Trusted publishing: support for Google Cloud service accounts · Issue #13551 · pypi/warehouse (original) (raw)
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:
{ "aud": "{SOME-AUDIENCE}", "azp": "{SOME-AZP}", "email": "{PROJECT-NUMBER}-compute@developer.gserviceaccount.com", "email_verified": true, "exp": 1682967007, "google": { "compute_engine": { "instance_creation_timestamp": 1674546966, "instance_id": "{INSTANCE-ID}", "instance_name": "dev", "project_id": "{PROJECT-ID}", "project_number": {PROJECT-NUMBER}, "zone": "us-central1-a" } }, "iat": 1682963407, "iss": "https://accounts.google.com", "sub": "{SOME-AZP}" }
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?
- Refactor
warehouse.oidc.models
to make adding new publisher models simpler (warehouse, tests: devolve oidc.models #13553) - Add OIDC provider models and services for Google Cloud
- Support multiple publishers in the UI: Add a horizontal tab picker #13571
- Expose Google Cloud providers through forms and views: Add support for Google trusted publishing #15144
- Update emails, etc. to be generic over OIDC provider kinds (xref Expand OIDC email template's publisher specifiers #13667): Generalize trusted publishing emails #13872
- Update user docs: Document additional Trusted Publishers #15192