Skip to content

Commit

Permalink
Add unchecked GitLab claims (pypi#15466)
Browse files Browse the repository at this point in the history
  • Loading branch information
di authored Feb 23, 2024
1 parent 137f1fb commit 8155a65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/unit/oidc/models/test_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_gitlab_publisher_all_known_claims(self):
"exp",
"aud",
# unchecked claims
"project_id",
"namespace_id",
"namespace_path",
"user_id",
Expand All @@ -78,6 +79,7 @@ def test_gitlab_publisher_all_known_claims(self):
"ci_config_sha",
"project_visibility",
"jti",
"user_access_level",
}

def test_gitlab_publisher_computed_properties(self):
Expand Down
4 changes: 4 additions & 0 deletions warehouse/oidc/models/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ class GitLabPublisherMixin:
}

__unchecked_claims__ = {
# We are not currently verifying project_id or namespace_id to protect against
# resurrection attacks: https://github.com/pypi/warehouse/issues/13575
"project_id",
"namespace_id",
"namespace_path",
"user_id",
Expand All @@ -139,6 +142,7 @@ class GitLabPublisherMixin:
"ci_config_sha",
"project_visibility",
"jti",
"user_access_level",
}

@staticmethod
Expand Down

0 comments on commit 8155a65

Please sign in to comment.