Skip to content

feat(addons): pin the signer of add-on libraries with an identity pattern and a source repository - #13378

Merged
mudler merged 10 commits into
masterfrom
feat/addon-signer-pin
Nov 21, 2026
Merged

mudler merged 10 commits into
masterfrom
feat/addon-signer-pin

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

What

Add-on library sources and add-on package installs can now pin the signer the same way backend libraries do: an anchored identity regex and a source-repository pin.

Why

A reusable signing workflow signs for every repository that calls it. Its identity alone therefore admits a signature made for any caller. The source-repository claim in the signing certificate names the caller. cosignverify and the gallery and backend paths already support both. The add-on catalog had no pin, and it refused a regex outright, so an add-on library signed by a shared workflow could only pin the workflow identity.

Changes

  • catalog.VerificationPolicy gets sourceRepository (https URL, valid only with requireSignature). The https rule lives in one exported helper, cosignverify.CheckSourceRepository.
  • Rule for add-ons: an identity regex on an oci:// add-on library or an add-on install is accepted only together with the pin. An exact identity works with or without it. Backend sources behave as before.
  • The library fetch and the install pass the regex and the pin to the verifier. The backend library install forwards the pin too.
  • Signer label: the exact identity if there is one; the pinned repository when the signer is a pattern; never a raw pattern.
  • REST add-source takes identity_regex and source_repository; the CLI takes --identity-regex and --source-repository. The frontend forward to the add-on owner carries both, so a frontend does not drop them.
  • Admin UI field, docs and swagger.
  • Official libraries are unchanged (same bytes, same cache names).

Notes

  • Only a source that uses the pin is unreadable by an older binary, because the store rejects unknown fields.
  • A bare regex is not refused when an https add-on-kind source is saved. Such a source can list backends, which verify with a regex alone. The add-on paths (library fetch and install) refuse it.
  • The pin is compared exactly: no case or trailing-slash normalisation.
  • There is no assistant (MCP) tool for add-on library sources by design, so no tool change.
  • Swagger regeneration also picked up an unrelated description change for modelsearch.RepoFile.kind that master had not regenerated.
  • The other locales get the new UI strings as English copies, as the repo's copy script does. The changed English regex hint is not translated yet.

Tests

  • Policy table (regex with and without pin, pin without signature, non-https pin).
  • Real sigstore verification at install: the pinned repository is accepted, another repository or none is refused.
  • Real verification of a signed library artifact against a pinned repository (accepted and refused).
  • The pattern-without-pin install refusal can only come from the new check.
  • REST, CLI, persistence and frontend-forward round trips.
  • Focused Go packages (addons, library, cli, endpoints, application, pkg/oci) pass with -tags nosqlite,purego_utp; UI unit tests, lint and i18n checks pass. The full core/http suite exceeded the local test timeout, so its route coverage specs were run on their own.

Assisted-by: Claude:claude-opus-5-5

A shared signing workflow signs for every repository that calls it, so
an identity pattern alone admits a signature made for any of those
repositories. That is why an oci:// add-on library refused a pattern.

Add sourceRepository to the verification policy of a library source. It
is compared exactly with the source-repository extension of the signing
certificate, and it is valid only with a required signature. An oci://
add-on library now accepts a pattern when it also pins the source
repository. An exact identity stays valid with or without the pin.
Other sources keep a pattern alone: an https add-on library can also
list backends, which verify against a pattern.

The OCI library fetch passes the pattern and the source repository to
the verifier. The entries of a source with a pattern and a pin show the
source repository as their signer, because the check compared that
value exactly. A pattern with no pin still shows no signer.

Check gives the reason a policy is refused, so the callers that add a
source can show it.

Assisted-by: Claude:claude-opus-5-5
An add-on install refused every policy with an identity pattern. It now
accepts a pattern when the library also pins the source repository, and
passes the pattern and the repository to the verifier. A pattern with
no pin is still refused before anything is downloaded.

The receipt records the source repository as the signer when the
identity is a pattern, as the library entries do. The backend library
install forwards the source repository to the gallery verification.

The signing fixture can now issue a certificate with the
source-repository extension, so the test checks a real signature for
the pinned repository and refuses one made for another repository.

Assisted-by: Claude:claude-opus-5-5
…adding a source

POST /api/library/sources takes identity_regex and source_repository,
and `local-ai library add` takes --identity-regex and
--source-repository. They apply to an oci:// add-on library, as issuer
and identity do. A pattern takes the place of the exact identity only
together with a source repository; a pattern alone is refused with a
message that says why. A source repository can also go with an exact
identity.

The fields go through the call that a frontend forwards to the add-on
owner, so both roles store the same policy.

Assisted-by: Claude:claude-opus-5-5
The editor of an add-on library has a Source repository field next to
the signer identity and the identity pattern. It takes an https
address and is sent only when a signature is required. The details of
a library entry show the source repository when the library pins one.

The hint of the identity pattern now says that an add-on verifies
against a pattern only when the source repository is also set.

The other locales get the new keys with the English text, as
scripts/translate-locales.mjs --copy does. The changed English hint is
not translated yet.

Assisted-by: Claude:claude-opus-5-5
Describe identity_regex and source_repository of POST
/api/library/sources, the --identity-regex and --source-repository
flags of `local-ai library add`, why an add-on library pins the source
repository when it names its signer by a pattern, and which signer the
install notice names.

Regenerate the swagger files. They also pick up the description of the
modelsearch RepoFile kind, which master changed without regenerating.

Assisted-by: Claude:claude-opus-5-5
The test of an add-on install with an identity pattern and no source
repository also changed the artifact of the entry, so the check that the
entry equals the library's refused it even without the pattern rule.

The library now serves the pattern-only policy itself and the request
equals the entry. The package is a signed image whose signature matches
the pattern, so the install would succeed without the rule. The test
counts the registry requests, not progress events, to show that nothing
is fetched.

Assisted-by: Claude:claude-opus-5-5
The tests of the OCI library fetch replace the verifier with a stub, so
no test checked that the fetch passes the source repository to the real
verifier.

Sources gets host-provisioned trust for the library signature check,
as the package installer has. Only tests set it; nil keeps the public
Sigstore root. A new test signs a library artifact with a certificate
that carries the source-repository extension. A pattern and a pin
accept the pinned repository and refuse another repository and a
certificate without one.

Assisted-by: Claude:claude-opus-5-5
The test of --identity-regex and --source-repository used t.Fatal and
t.Errorf, which the linter refuses: tests in this repository use Ginkgo
and Gomega. It is now a Ginkgo spec in the existing cli suite.

Assisted-by: Claude:claude-opus-5-5
The catalog, packages and gallery-ui suites compare their reports with
the required cases of scripts/addons/suites.json, and the cases that
the source repository pin added were not listed.

The packages case "is for backend sources only: an add-on install
refuses it" no longer describes the behaviour: an add-on install now
accepts a pattern with a source repository. Its successor, which
refuses a pattern without a source repository before any registry
request, takes its place, next to the case that verifies a pattern with
a source repository.

The three cases of the signed library table get names that say what
they check.

Assisted-by: Claude:claude-opus-5-5
@mudler
mudler merged commit 41c45c2 into master Nov 21, 2026
232 of 235 checks passed
@mudler
mudler deleted the feat/addon-signer-pin branch November 21, 2026 19:17
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.

2 participants