Skip to content

Commit d53d2a3

Browse files
committed
Initial implementation of GitLab OIDC trusted publisher
1 parent 8f395d8 commit d53d2a3

File tree

21 files changed

+2094
-139
lines changed

21 files changed

+2094
-139
lines changed

tests/common/db/oidc.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
from warehouse.oidc.models import (
1616
ActiveStatePublisher,
1717
GitHubPublisher,
18+
GitLabPublisher,
1819
GooglePublisher,
1920
PendingActiveStatePublisher,
2021
PendingGitHubPublisher,
22+
PendingGitLabPublisher,
2123
PendingGooglePublisher,
2224
)
2325

@@ -51,6 +53,30 @@ class Meta:
5153
added_by = factory.SubFactory(UserFactory)
5254

5355

56+
class GitLabPublisherFactory(WarehouseFactory):
57+
class Meta:
58+
model = GitLabPublisher
59+
60+
id = factory.Faker("uuid4", cast_to=None)
61+
project = factory.Faker("pystr", max_chars=12)
62+
namespace = factory.Faker("pystr", max_chars=12)
63+
workflow_filepath = "subfolder/example.yml"
64+
environment = "production"
65+
66+
67+
class PendingGitLabPublisherFactory(WarehouseFactory):
68+
class Meta:
69+
model = PendingGitLabPublisher
70+
71+
id = factory.Faker("uuid4", cast_to=None)
72+
project_name = "fake-nonexistent-project"
73+
project = factory.Faker("pystr", max_chars=12)
74+
namespace = factory.Faker("pystr", max_chars=12)
75+
workflow_filepath = "subfolder/example.yml"
76+
environment = "production"
77+
added_by = factory.SubFactory(UserFactory)
78+
79+
5480
class GooglePublisherFactory(WarehouseFactory):
5581
class Meta:
5682
model = GooglePublisher

0 commit comments

Comments
 (0)