feat(pluginhost): introduce browser-navigable plugin resources in Management API

- Added `resources` field in `management.register` for defining browser-accessible resources.
- Updated examples and documentation to reflect resource-based paths under `/v0/resource/plugins/<pluginID>/...`.
- Replaced legacy `GET` menu routes with resource-based implementations for consistent plugin behavior.
- Enhanced request handling for resource paths, including proper response headers and streamlined test coverage.
This commit is contained in:
Luis Pater
2026-06-09 22:46:27 +08:00
parent 2aeb41cecf
commit 44ea9abced
22 changed files with 342 additions and 70 deletions
+3 -1
View File
@@ -187,7 +187,9 @@ PUT /v0/management/plugins/{pluginID}/config
PATCH /v0/management/plugins/{pluginID}/config
```
Plugin-owned Management API routes are registered through `management.register` and handled through `management.handle`.
Plugin-owned Management API routes are registered through the `routes` field of `management.register` and handled through `management.handle`.
Browser-navigable menu resources are registered through the `resources` field of `management.register`. CPA exposes those resources under `/v0/resource/plugins/<pluginID>/...`; for example, a plugin with ID `example` and resource path `/status` is served as `/v0/resource/plugins/example/status`.
## Trust Boundary