Skip to content

Commit

Permalink
Fix sub filter for Google OIDC Publisher lookup (#15202)
Browse files Browse the repository at this point in the history
  • Loading branch information
di authored Jan 12, 2024
1 parent e62049b commit 1c962a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/unit/oidc/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_find_publisher_by_issuer_google(db_request, sub, expected_id):
GooglePublisherFactory(
id="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
email="[email protected]",
sub=None, # No subject
sub="", # No subject
)
GooglePublisherFactory(
id="bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
Expand Down
2 changes: 1 addition & 1 deletion warehouse/oidc/models/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __lookup_all__(klass, signed_claims: SignedClaims) -> Query | None:

@staticmethod
def __lookup_no_sub__(klass, signed_claims: SignedClaims) -> Query | None:
return Query(klass).filter_by(email=signed_claims["email"], sub=None)
return Query(klass).filter_by(email=signed_claims["email"], sub="")

__lookup_strategies__ = [
__lookup_all__,
Expand Down

0 comments on commit 1c962a4

Please sign in to comment.