Skip to content

fix(publish): lowercase OCI repository path for uppercase scopes#120

Merged
scarmuega merged 1 commit into
mainfrom
fix/publish-uppercase-scope
May 29, 2026
Merged

fix(publish): lowercase OCI repository path for uppercase scopes#120
scarmuega merged 1 commit into
mainfrom
fix/publish-uppercase-scope

Conversation

@scarmuega

Copy link
Copy Markdown
Contributor

Problem

trix publish rejects protocols whose [protocol].scope carries capitals, e.g.:

[protocol]
name = "sundae-v3"
scope = "SundaeSwap-finance"
version = "0.1.0"

The metadata passes config loading and validate_ident (which accepts [a-zA-Z]), but the publish fails at push time. scope deliberately mirrors the GitHub org ownerpublish.rs verifies it case-sensitively against the [protocol].repository URL owner, and GitHub orgs legitimately have capitals. So we can't simply reject capitals.

The real issue: reference_for (src/interfaces/oci.rs) built the OCI reference with the original-case scope/name, and the OCI image spec requires repository paths to be lowercaseoci_client::Reference::try_from rejected it.

Fix

Lowercase only the two repository path segments in reference_for, the single chokepoint shared by both trix publish (push) and trix use (pull). This keeps registry addressing OCI-compliant and consistent across both paths, while the original-case scope is preserved everywhere else (GitHub verification, image metadata, the org.opencontainers.image.vendor annotation). Tags are left untouched since OCI permits uppercase there.

Adds regression tests covering the lowercasing (SundaeSwap-finance/Sundae-V3sundaeswap-finance/sundae-v3) and the latest default.

Follow-up to confirm (registry side, out of this repo)

If the registry's push-authorization compares the GitHub OIDC owner case-sensitively against the lowercased repository path segment, a publisher from org SundaeSwap-finance could still fail authorization. Worth verifying the registry resolves that case-insensitively.

🤖 Generated with Claude Code

`trix publish` rejected protocols whose `[protocol].scope` carried
capitals (e.g. "SundaeSwap-finance"). The scope passes `validate_ident`
(which accepts `[a-zA-Z]`) and deliberately mirrors the GitHub org owner,
which legitimately has capitals. But `reference_for` then built an OCI
reference with the original case, and the OCI image spec requires
repository paths to be lowercase, so `oci_client::Reference::try_from`
rejected it at push time.

Lowercase only the two repository path segments in `reference_for`, the
single chokepoint shared by publish and pull. Registry addressing stays
OCI-compliant and consistent across both paths, while the original-case
scope is preserved everywhere else (GitHub verification, image metadata,
the vendor annotation). Tags are left untouched since OCI permits
uppercase there.

Adds regression tests covering the lowercasing and the `latest` default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega merged commit 43e21e9 into main May 29, 2026
6 checks passed
@scarmuega scarmuega deleted the fix/publish-uppercase-scope branch May 29, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant