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

OIDC: Configurable audience #13140

Merged
merged 3 commits into from
Mar 6, 2023
Merged

Conversation

woodruffw
Copy link
Member

See #12465.

This allows instances like TestPyPI to configure their own OIDC audience.

Adds `OIDC_AUDIENCE` + `warehouse.oidc.audience` to allow
a Warehouse deployment to vary its expected OIDC audience.

Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw requested a review from a team as a code owner March 6, 2023 19:02
Signed-off-by: William Woodruff <william@trailofbits.com>
@@ -32,7 +32,7 @@ class InsecureOIDCPublisherWarning(UserWarning):

@implementer(IOIDCPublisherService)
class NullOIDCPublisherService:
def __init__(self, session, publisher, issuer_url, cache_url, metrics):
def __init__(self, session, publisher, issuer_url, audience, cache_url, metrics):
Copy link
Member Author

Choose a reason for hiding this comment

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

NB: I didn't bother making NullOIDCPublisherService respect the varied audience, since it's development-only and explicitly doesn't perform a full verification.

@woodruffw woodruffw requested a review from di March 6, 2023 19:19
@di
Copy link
Member

di commented Mar 6, 2023

I've set OIDC_AUDIENCE to pypi and testpypi respectively.

@di di merged commit 61d5c58 into pypi:main Mar 6, 2023
@di di deleted the tob-oidc-vary-audience branch March 6, 2023 21:24
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.

2 participants