Skip to content

Commit f14dde8

Browse files
committed
feat: enable pending gitlab publisher reinfication
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
1 parent d790995 commit f14dde8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/unit/oidc/models/test_gitlab.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,3 +937,13 @@ def test_reify_already_exists(self, db_request):
937937
# it is returned and the pending publisher is marked for deletion.
938938
assert existing_publisher == publisher
939939
assert pending_publisher in db_request.db.deleted
940+
941+
def test_reify_with_custom_issuer_url(self, db_request):
942+
custom_issuer_url = "https://gitlab.custom-domain.com"
943+
pending_publisher = PendingGitLabPublisherFactory.create(
944+
issuer_url=custom_issuer_url
945+
)
946+
publisher = pending_publisher.reify(db_request.db)
947+
948+
assert publisher.issuer_url == custom_issuer_url
949+
assert isinstance(publisher, gitlab.GitLabPublisher)

warehouse/oidc/models/gitlab.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ def reify(self, session: Session) -> GitLabPublisher:
435435
GitLabPublisher.project == self.project,
436436
GitLabPublisher.workflow_filepath == self.workflow_filepath,
437437
GitLabPublisher.environment == self.environment,
438-
# TODO (glsm): Implement custom issuers
439-
# GitLabPublisher.issuer_url == self.issuer_url,
438+
GitLabPublisher.issuer_url == self.issuer_url,
440439
)
441440
.one_or_none()
442441
)
@@ -446,8 +445,7 @@ def reify(self, session: Session) -> GitLabPublisher:
446445
project=self.project,
447446
workflow_filepath=self.workflow_filepath,
448447
environment=self.environment,
449-
# TODO (glsm): Implement custom issuers
450-
# issuer_url=self.issuer_url,
448+
issuer_url=self.issuer_url,
451449
)
452450

453451
session.delete(self)

0 commit comments

Comments
 (0)