Repository navigation
Trusted Publishing support for Semaphore CI #14718
cchristous
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Request
It would be great to add Semaphore CI as a Trusted Publishing
provider, alongside the existing GitHub Actions and GitLab CI/CD support.
Semaphore issues OIDC tokens to jobs natively (the
SEMAPHORE_OIDC_TOKENenv var), with astandard discovery document and JWKS endpoint, so the pieces needed for crates.io to verify a
token are already in place:
https://<org>.semaphoreci.com/.well-known/openid-configurationhttps://<org>.semaphoreci.com/.well-known/jwtsThe one thing that's different from the existing providers (issuer model)
I want to flag this up front, because it's the crux and it's where Semaphore differs from
GitHub Actions and GitLab.com:
Semaphore's OIDC issuer is per-organization, not a single shared issuer. The
issclaimis
https://<org>.semaphoreci.com(the org's URL), andauddefaults to that same org URL.That's unlike GitHub Actions (one shared issuer
token.actions.githubusercontent.comforeveryone) or GitLab.com (
gitlab.com), where a single issuer serves all users and the claimsdifferentiate them.
So a Semaphore provider needs the issuer to be derived from the trusted-publisher config
rather than a compile-time constant — e.g. the config stores the organization, and the
expected issuer is
https://{organization}.semaphoreci.com.Important scoping: this is not the same as the generic "configurable arbitrary OIDC
issuer" request (#13155, closed not-planned). To keep the threat model tight, this should be
restricted to the vetted Semaphore SaaS apex domain
*.semaphoreci.comonly — the issuerhostname is validated against that apex, exactly the way GitLab.com is a single vetted domain.
Self-hosted Semaphore instances (arbitrary domains) would be out of scope, consistent with
crates.io currently supporting GitLab.com but not self-hosted GitLab.
Proposed config shape
Mirroring the existing GitLab provider, plus a derived issuer:
Token claims available for matching (per Semaphore's OIDC reference): the
subis acombination of org, project, repository, and git reference; there's also a compact
sub127claim (kept under 127 chars) for consumers with size limits.
Audience
Semaphore's default
audis the org URL, but Semaphore has in-flight work to let a job mint atoken with a custom audience (semaphoreio/semaphore#1008),
so the token can carry whatever
audcrates.io requires for the exchange. Happy to align onthe expected audience value.
Why it matters
long-lived crates.io API tokens.
apex) may also be a useful reference for any future forge/provider that assigns a
per-tenant issuer rather than a single shared one.
Happy to help with details on Semaphore's token format, or to test against a real Semaphore
org if that's useful.
All reactions