Repository navigation
feat(addons): pin the signer of add-on libraries with an identity pattern and a source repository - #13378
Merged
Conversation
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
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.
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.
cosignverifyand 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.VerificationPolicygetssourceRepository(https URL, valid only withrequireSignature). The https rule lives in one exported helper,cosignverify.CheckSourceRepository.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.identity_regexandsource_repository; the CLI takes--identity-regexand--source-repository. The frontend forward to the add-on owner carries both, so a frontend does not drop them.Notes
modelsearch.RepoFile.kindthat master had not regenerated.Tests
-tags nosqlite,purego_utp; UI unit tests, lint and i18n checks pass. The fullcore/httpsuite exceeded the local test timeout, so its route coverage specs were run on their own.Assisted-by: Claude:claude-opus-5-5