Skip to content

feat: accept the host permissions shipped in nginx-ui v3.0.0 - #1

Merged
0xJacky merged 1 commit into
mainfrom
feat/host-v3-permissions
Nov 27, 2026
Merged

0xJacky merged 1 commit into
mainfrom
feat/host-v3-permissions

Conversation

@0xJacky

@0xJacky 0xJacky commented Nov 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Add nginx.snippet, nginx.config.read, sites.read and certs.read to the permission enum in schema/plugin.schema.json. nginx-ui has accepted them since v3.0.0 (knownPermissions in internal/plugin/manifest.go), and host.proto already documents the methods that need them. permission_reasons keys (top level and i18n/<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's CutPrefix(..., "credentials.read:") with a non-empty kind. It is unchanged.
  • New TestSchemaAcceptsHostProtoPermissions: every permission that a host.proto method 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.fail2ban v0.1.0 (it declares nginx.snippet and sites.read). The errors were on permissions[1], permissions[4] and the matching permission_reasons / i18n/zh_CN/permission_reasons keys.

Test plan

  • make check (buf lint/format, generated code and methods.json fresh, go vet + go test in both modules)
  • The v0.1.0 fail2ban plugin.json (from the tag and from the release package, which are identical), validated with the catalog's own schema-validator.mjs. The old schema gives the six errors from the failed run; this branch gives none.
  • The catalog repository's script tests (130) pass with PLUGIN_SPEC_DIR pointing at this branch.

🤖 Generated with Claude Code

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>
@0xJacky
0xJacky merged commit 51c7bb9 into main Nov 27, 2026
1 check passed
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