Add API to configure pending trusted publishers - #6637
Open
segiddins wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6637 +/- ##
==========================================
- Coverage 97.14% 94.66% -2.48%
==========================================
Files 516 518 +2
Lines 11022 11122 +100
==========================================
- Hits 10707 10529 -178
- Misses 315 593 +278 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
colby-swandale
self-requested a review
June 23, 2026 06:40
colby-swandale
approved these changes
Jun 25, 2026
colby-swandale
left a comment
Member
There was a problem hiding this comment.
Looks good! One minor thing and this is good to merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a JSON API to create and list pending trusted publishers (
OIDC::PendingTrustedPublisher), so trusted publishing can be configured for a gem that has not been pushed yet.Until now
OIDC::PendingTrustedPublisherwas only reachable through the website. Theconfigure_trusted_publisherCLI configures publishers viaapi/v1/gems/:name/trusted_publishers, which 404s when the gem does not exist — exactly the case where a maintainer wants keyless publishing set up before the first release.What this adds
GET/POST api/v1/oidc/pending_trusted_publishersviaApi::V1::OIDC::PendingTrustedPublishersController(index+create), modeled on the existingApi::V1::OIDC::RubygemTrustedPublishersController.Api::OIDC::PendingTrustedPublisherPolicywith a user-scopedScope.{ rubygem_name, trusted_publisher_type, trusted_publisher: { ... } }.trusted_publisher(viapayload/as_json, mirroringOIDC::RubygemTrustedPublisher) so API consumers get the same shape as the rubygem endpoint.Authorization
configure_trusted_publishersscope;createalso enforces MFA/OTP.ApiKey#scope?does not reject a gem-scoped key when called with a nil gem, so this guard is load-bearing.)available_rubygem_namevalidation still rejects reserved names and names of existing pushable gems.indexreturns only the calling user's unexpired pending publishers.Tests
Integration tests cover create success and the nested-serialization contract, unsupported type / invalid attributes / unavailable name (422), missing scope / gem-scoped key / non-user key (403), missing OTP under MFA (401), and index isolation between users.
Companion change
The
rubygems/configure_trusted_publisherCLI is updated to fall back to this endpoint when the gem does not exist (separate PR in that repo).