Skip to content

Commit f83eaf2

Browse files
dith3coop
andauthored
OIDC provider active state (#15201)
* Add OIDC ActiveStatePublisher modeling * Update warehouse/oidc/models/github.py Co-authored-by: Dustin Ingram <[email protected]> * Update warehouse/migrations/versions/9a0ed2044b53_add_activestate_oidc_publisher.py Co-authored-by: Dustin Ingram <[email protected]> * Update warehouse/migrations/versions/9a0ed2044b53_add_activestate_oidc_publisher.py Co-authored-by: Dustin Ingram <[email protected]> * Update warehouse/migrations/versions/9a0ed2044b53_add_activestate_oidc_publisher.py Co-authored-by: Dustin Ingram <[email protected]> * Update warehouse/migrations/versions/9a0ed2044b53_add_activestate_oidc_publisher.py Co-authored-by: Dustin Ingram <[email protected]> * Update warehouse/migrations/versions/9a0ed2044b53_add_activestate_oidc_publisher.py Co-authored-by: Dustin Ingram <[email protected]> * Review cleanup * Remove branching in migration graph with ActiveState Model introduction * Revert mocking change to GitHub tests. Changes focused on that can be done at another time --------- Co-authored-by: Carey Hoffman <[email protected]> Co-authored-by: Carey Hoffman <[email protected]>
1 parent c391c43 commit f83eaf2

File tree

9 files changed

+802
-4
lines changed

9 files changed

+802
-4
lines changed

tests/common/db/oidc.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
import factory
1414

1515
from warehouse.oidc.models import (
16+
ActiveStatePublisher,
1617
GitHubPublisher,
1718
GooglePublisher,
19+
PendingActiveStatePublisher,
1820
PendingGitHubPublisher,
1921
PendingGooglePublisher,
2022
)
@@ -67,3 +69,29 @@ class Meta:
6769
email = factory.Faker("safe_email")
6870
sub = factory.Faker("pystr", max_chars=12)
6971
added_by = factory.SubFactory(UserFactory)
72+
73+
74+
class ActiveStatePublisherFactory(WarehouseFactory):
75+
class Meta:
76+
model = ActiveStatePublisher
77+
78+
id = factory.Faker("uuid4", cast_to=None)
79+
organization = factory.Faker("pystr", max_chars=12)
80+
activestate_project_name = factory.Faker("pystr", max_chars=12)
81+
actor = factory.Faker("pystr", max_chars=12)
82+
actor_id = factory.Faker("uuid4")
83+
ingredient = factory.Faker("pystr", max_chars=12)
84+
85+
86+
class PendingActiveStatePublisherFactory(WarehouseFactory):
87+
class Meta:
88+
model = PendingActiveStatePublisher
89+
90+
id = factory.Faker("uuid4", cast_to=None)
91+
project_name = factory.Faker("pystr", max_chars=12)
92+
organization = factory.Faker("pystr", max_chars=12)
93+
activestate_project_name = factory.Faker("pystr", max_chars=12)
94+
actor = factory.Faker("pystr", max_chars=12)
95+
actor_id = factory.Faker("uuid4")
96+
added_by = factory.SubFactory(UserFactory)
97+
ingredient = factory.Faker("pystr", max_chars=12)

0 commit comments

Comments
 (0)