Trusted publishing changes - #2114
Conversation
The controller lived in the root org.eclipse.openvsx package while the rest of the feature (service, config, providers) is in org.eclipse.openvsx.trustedpublishing. Endpoint paths are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers all five endpoints in a @WebMvcTest slice with the service, the Eclipse service and the user service mocked: request validation, status codes, response shape and the mapping of NotFoundException and ErrorResultException. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every GitLab instance behaves identically and differs only in id, name, URL and OIDC issuer, so EclipseGitLabTrustedPublishingProvider carried nothing but four constants. Instances are now configuration: ovsx.trusted-publishing.gitlab.<id>.name/url/issuer with the public and the Eclipse instance configured by default, so existing deployments are unaffected. Whether an instance can be used is still decided by ovsx.trusted-publishing.active-providers. GitLabTrustedPublishingProviderSupport and its two subclasses collapse into a single concrete GitLabTrustedPublishingProvider. The ci_config_ref_uri claim is now derived from the host *and* the path of the instance URL, so an instance served under a relative URL root registers a matchable claim. Startup rejects an instance without a name or URL, with a malformed URL, or taking the GitHub provider id, and warns about active provider ids that no provider is configured for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An instance the upstream registry does not itself use has no place in the
built-in defaults; only the public GitLab instance is configured out of
the box now. Deployments that want the Eclipse Foundation instance add it
the same way as any other one:
ovsx:
trusted-publishing:
active-providers: github,eclipse-gitlab
gitlab:
eclipse-gitlab:
name: Eclipse GitLab
url: https://gitlab.eclipse.org
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Configurable GitLab instances (
|
createTrustedPublisher called eclipseService.checkPublisherAgreement()
outside its try/catch. Nothing else handles ErrorResultException - no
@ControllerAdvice covers it - so a user without a signed publisher
agreement got a 500 with an empty body instead of the 403 and the
{"error": "..."} message the exception carries.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Publisher agreement error is a 403 again (
|
…edPublishing The field says whether a version was published through trusted publishing, not which trusted publisher it belongs to, and the old name reads like the latter. Nothing consumes it yet - not the webui, not the CLI - and it has not been in a release, so the rename breaks no client. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A rocket icon next to "Published by" says the version came from a trusted publishing workflow rather than a personal access token, driven by the new publishedWithTrustedPublishing field. It links to the deployment's trusted publishing documentation when one is configured, and nothing is rendered for the ordinary case. The rocket is the same one that stands for trusted publishing in the user settings; a shield would collide with the verified-publisher shield sitting in the same row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Work in progress on the trusted publishing feature. Opened as a draft so the changes are visible as they land.
So far
TrustedPublishingAPIintoorg.eclipse.openvsx.trustedpublishing— the controller sat in the root package while the rest of the feature (service, config, providers, entities' repository) is in thetrustedpublishingpackage. Pure move, endpoint paths unchanged.TrustedPublishingAPITest— there was no controller-level test coverage. 26 tests in a@WebMvcTestslice (service, Eclipse service and user service mocked) covering all five endpoints:POST /user/namespace/{ns}/trusted-publishing/create— anonymous access, each missing mandatory field, path/body namespace mismatch, successful registration, unknown namespace, non-owner, rejected registrationGET /user/namespace/{ns}/trusted-publishing— anonymous access, publishers + registrable extensions, empty result, unknown namespace, feature disabled, non-ownerPOST /user/namespace/{ns}/trusted-publishing/delete/{id}— anonymous access, success, unknown publisher, non-ownerPOST /api/-/trusted-publishing/token— each missing field, successful exchange (asserting no login is consulted), no matching publisher, unusable tokenGET /api/-/trusted-publishing/status— anonymous access, feature disabled, missing publisher agreement, provider listing, error mappingNoted while writing the tests — since fixed
In
createTrustedPublisher,eclipseService.checkPublisherAgreement(user)was called outside the try/catch, and no@ControllerAdvicehandlesErrorResultException. A user without a signed publisher agreement therefore got a 500 with an empty body instead of the 403 and the{"error": "..."}message the exception carries. Fixed in39416689d.See the comments below for the changes that followed.
🤖 Generated with Claude Code