Plugins API
This page documents the 2 gateway endpoints tagged plugins in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| GET | /api/plugins | List the Admin UI plugins |
| GET | /api/plugins/auth-token | Issue a plugin session claim |
Endpoints
GET /api/plugins
List the Admin UI plugins
The plugins registered under general_settings.plugins, with name, display name and URL, for the Admin UI view
switcher. The plugin credential is never returned, the gateway adds it itself on reverse proxied calls. Any signed
in user or key may read the list.
Docs (https://docs.spanway.ai/docs/proxy/ui_plugins)
Example request:
curl -X GET "http://localhost:4000/api/plugins" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The registered plugins | application/json array of PluginSummary |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
GET /api/plugins/auth-token
Issue a plugin session claim
A short lived identity claim the Admin UI passes to a plugin iframe. It carries the viewer's user id and role, the
plugin name and an expiry 30 seconds out, encrypted with a key derived from SPANWAY_SALT_KEY and the plugin name,
so each plugin can read only its own claims. It never carries a gateway credential. Any signed in user or key may
ask for one.
Docs (https://docs.spanway.ai/docs/proxy/ui_plugins)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
plugin_name | query | string | No |
Example request:
curl -X GET "http://localhost:4000/api/plugins/auth-token" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | A claim for the named plugin that expires in 30 seconds | application/json PluginSessionClaim |
| 404 | No plugin has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 503 | SPANWAY_SALT_KEY is not set, so no claim can be encrypted | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
session_claim | string | Yes | Opaque token the plugin decrypts with its own derived key, valid 30 s |