Repository navigation
feat: accept the host permissions shipped in nginx-ui v3.0.0 - #1
Merged
Merged
Conversation
The permission enum of plugin.schema.json lacked nginx.snippet, nginx.config.read, sites.read and certs.read, which host.proto already documents and nginx-ui accepts since v3.0.0. The catalog checks rejected manifests that declare them, in permissions and in the keys of permission_reasons. TestSchemaAcceptsHostProtoPermissions now fails when host.proto names a permission the schema rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
nginx.snippet,nginx.config.read,sites.readandcerts.readto the permission enum inschema/plugin.schema.json. nginx-ui has accepted them since v3.0.0 (knownPermissionsininternal/plugin/manifest.go), andhost.protoalready documents the methods that need them.permission_reasonskeys (top level andi18n/<locale>) use the same$defs/permission, so they accept the new names too.credentials.read:<kind>already matches the host's rule:^credentials\.read:.+$versus the host'sCutPrefix(..., "credentials.read:")with a non-empty kind. It is unchanged.TestSchemaAcceptsHostProtoPermissions: every permission that ahost.protomethod comment names must be accepted by the schema. Against the old schema it fails on exactly the four missing names.Why
The catalog's entry checks validate manifests against this schema. They rejected
io.github.3130585774.fail2banv0.1.0 (it declaresnginx.snippetandsites.read). The errors were onpermissions[1],permissions[4]and the matchingpermission_reasons/i18n/zh_CN/permission_reasonskeys.Test plan
make check(buf lint/format, generated code and methods.json fresh, go vet + go test in both modules)plugin.json(from the tag and from the release package, which are identical), validated with the catalog's ownschema-validator.mjs. The old schema gives the six errors from the failed run; this branch gives none.PLUGIN_SPEC_DIRpointing at this branch.🤖 Generated with Claude Code