Skip to content

feat(lifecycle): add plugin.settings.test and settings_schema.test - #3

Open
0xJacky wants to merge 1 commit into
mainfrom
feat/settings-test-hook
Open

0xJacky wants to merge 1 commit into
mainfrom
feat/settings-test-hook

Conversation

@0xJacky

@0xJacky 0xJacky commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Adds the contract for a settings "test connection" hook, as implemented in nginx-ui draft 0xJacky/nginx-ui#2188.

What it adds

  • lifecycle.proto: rpc SettingsTest with rpc_name = "plugin.settings.test", plus PluginSettingsTestRequest { Struct settings } and PluginSettingsTestResponse { bool ok; string message }. The host sends it only to a plugin whose manifest declares settings_schema.test. A plugin may also answer -32003 with data.field.
  • manifest.proto and plugin.schema.json:
    • settings_schema.test (SettingsTest { int32 timeout_seconds }, 0 to 60, where 0 or absent means 15). If it is there, the plugin serves the hook.
    • settings[].bound_to (list of setting keys, for secret fields). During a test the host passes a stored secret to the plugin only while every field it is bound to still has its saved value. Absent means it is bound to every other field. Saving is unchanged.
  • gen/: regenerated with make generate (pinned buf 1.73.0, protoc-gen-go 1.36.12, protoc-gen-go-grpc 1.6.2). gen/methods.json gains plugin.settings.test.
  • Vectors 53-plugin-settings-test-valid.json and 54-plugin-settings-test-invalid-config.json.

The change is additive and api_version stays 1. Older hosts ignore the new manifest members, and the schema used to reject test and bound_to.

Landing order

  1. This PR (plugin-spec) goes first.
  2. Then the SDKs: feat: serve plugin.settings.test through Plugin.TestSettings plugin-sdk-go#1 (Plugin.TestSettings) and feat: type settings tests and the settings panel props plugin-sdk-web#3 (SettingsTestResult, SettingsPanelProps).
  3. Then nginx-ui #2188.

nginx-ui and plugin-sdk-go keep verbatim copies of gen/go/nginxui/plugin/v1. Their PRs copy this branch's output byte for byte, including the author field from #2 that neither had synced yet.

Checks

make check passes locally: buf lint and format, the generated code and methods.json are current, and the tests of both Go modules pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0xJacky added a commit to 0xJacky/nginx-ui that referenced this pull request Dec 5, 2026
Copy gen/go of nginxui/plugin-spec#3 verbatim. Spec main also carries
the informational Manifest.author (nginxui/plugin-spec#2), so mirror it in
protocol.Manifest to keep the alignment test green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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