feat(36-01): add EN/PL scope picker phrasebook copy, regenerate OpenAPI/TS schema, and update docs
This commit is contained in:
@@ -91,7 +91,7 @@ Guarded routes run surf's `locale.from-principal` after the backend guard: an in
|
||||
| POST and DELETE `/account/avatar` | Upload the signed-in administrator's avatar (one multipart `file_data` part: a jpg, jpeg, png, gif or webp image of at most 2 MiB; anything else is a 422 on `avatar`, a body over the cap a 413) replacing the previous one, or remove it (also 200 when there is none). Both answer the `cabana.AdminProfile`. Interactive session only. |
|
||||
| GET `/account/tokens`, POST `/account/tokens` | List the caller's personal API tokens (newest first; revoked only with `?revoked=1`) and create one (`cabana.AdminAPITokenRequest`: `name`, `expires`, `scopes`). Create answers 201 with `cabana.AdminAPITokenCreated` (plaintext `token` once). Interactive session only. |
|
||||
| DELETE `/account/tokens/{id}` | Soft-revoke one of the caller's own active tokens (`cabana.AdminAPIToken`); 404 otherwise. Interactive session only. |
|
||||
| GET `/account/tokens/scopes` | Scopes the caller may assign (`cabana.AdminAPITokenScope`), including `*`, `admin:read` and overlapping plugin scopes. Interactive session only. |
|
||||
| GET `/account/tokens/scopes` | Scopes the caller may assign (`cabana.AdminAPITokenScope`, including always-present `plugin_id` and `group` strings resolved from `pact.TokenScope` `Group`, else `<pluginID>::lang.plugin.name`, else unanimous matched permission `Tab`, else raw plugin ID; empty for framework and unknown scopes), including `*`, `admin:read` and overlapping plugin scopes. Interactive session only. |
|
||||
| GET `/account/contributions` | The sections plugins contribute to My account (`cabana.AccountContributionView`): translated label, description and status for the signed-in administrator, and the actions (`cabana.AccountContributionActionView`) they hold the permissions for and whose `Applies` reports true. A section whose status or one of whose actions' `Applies` failed carries `error: true`. An empty list when no plugin contributes. Interactive session only. |
|
||||
| GET `/mcp/consent/{request}` | A pending MCP authorization request of an administrator-only grant (`cabana.MCPConsentView`), resolved by the published `pact.MCPAdminConsent` for the signed-in administrator: the client (`cabana.MCPConsentClientView`, with the redirect URI's host), the administrator (`cabana.MCPConsentAdminView`: login, name, email), the requested scopes the administrator can grant in catalog order (`cabana.AdminAPITokenScope`; scopes outside the catalog or without an owned permission are hidden, as in the token picker), `offline_access` (requested), `consent_required` and `expires_at`. 404 `request_not_found` when no provider is published or the request is unknown. Interactive session only. |
|
||||
| POST `/mcp/consent/{request}` | Allow or deny that request (`cabana.MCPConsentDecisionRequest`: `decision` `allow` or `deny`, `scopes`, `offline_access`; at most 16 KiB, unknown fields 400). An allow keeps the submitted scopes that were requested and can be granted (others are dropped), normalises them like token creation (`*` collapses to `["*"]`), answers 422 `no_grantable_scopes` when nothing is left and grants offline access only when it was requested and asked for; the answer is `cabana.MCPConsentDecisionView` (`redirect_uri`). Both decisions load the request first, and a redirect the provider answers that does not go back to the request's redirect URI (same scheme, host and path) is refused with 500. cabana opens no transaction: the provider owns it. Interactive session only, AJAX header required. |
|
||||
@@ -285,10 +285,11 @@ func (p *BlogPlugin) AdminFS() fs.FS { return os.DirFS("testdata/docs") }
|
||||
| `cabana.ScopeLimitFor` | Filters stored scope names by one HTTP method into the `bouncer.ScopeLimit` the guard would set for a request with that method, with the known and method-allowed counts. |
|
||||
| `cabana.TokenScopeNames` | The personal-token scope catalog names in catalog order (`*`, `admin:read`, then the plugins' `TokenScopes`), compiled from the activated plugins, so it works at plugin Boot before `cabana.Activate`. |
|
||||
| `cabana.TokenScopeLabels` | The translated label of each catalog scope name, the name itself for an unknown one, in input order. |
|
||||
| `cabana.TokenScopeCovers` | Reports whether at least one non-`*` personal API token scope allows the given HTTP method and covers every required permission code (uses the activated catalog on the application when available, else compiles from the passed plugins). |
|
||||
| `cabana.MCPConsentView` / `cabana.MCPConsentClientView` / `cabana.MCPConsentAdminView` / `cabana.MCPConsentDecisionRequest` / `cabana.MCPConsentDecisionView` | JSON shapes of the MCP consent routes. `cabana.AdminMCPConsentShow` and `cabana.AdminMCPConsentDecide` carry their swag annotations. |
|
||||
| `cabana.BackendAccessRevokedEvent` | Fired inside the transaction of an admin save that ends an administrator's access (`AdminIDs`, `Reason`, `Tx`); a listener error rolls the save back. Reasons: `cabana.BackendAccessDeleted`, `cabana.BackendAccessDeactivated`, `cabana.BackendAccessPasswordChanged`, `cabana.BackendAccessPasswordSet`, `cabana.BackendAccessPasswordReset`, `cabana.BackendAccessPermissions`. |
|
||||
| `cabana.BackendPrincipal` | Loads an admin principal by id through the backend users provider (grants, superuser flag, backend kind set); nil, nil for a missing or deactivated admin. |
|
||||
| `cabana.AdminAPIToken` / `cabana.AdminAPITokenScope` / `cabana.AdminAPITokenCreated` / `cabana.AdminAPITokenRequest` | JSON shapes of the account token API. |
|
||||
| `cabana.AdminAPIToken` / `cabana.AdminAPITokenScope` / `cabana.AdminAPITokenCreated` / `cabana.AdminAPITokenRequest` | JSON shapes of the account token API. `cabana.AdminAPITokenScope` carries always-present `plugin_id` (`PluginID`) and `group` (`Group`) fields alongside `name`, `label`, `description`, `read_only` and `known`. |
|
||||
| `cabana.AccountItemView` | One row of a contributed section on `cabana.AccountContributionView.Items` (null for a section without `Items`, next to `cabana.AccountContributionView.ItemActions` and `cabana.AccountContributionView.ItemsEmpty`). `cabana.AdminAccountContributionItemAction` carries the item action route's swag annotation. |
|
||||
| `cabana.AccountContributionView` / `cabana.AccountContributionActionView` / `cabana.AccountActionResultView` | JSON shapes of the My account contribution routes: a contributed section with its status and offered actions, one action, and an action's answer (message and optional URL). |
|
||||
| `cabana.CompileList` / `cabana.CompileForm` | Compile a controller's list and form YAML into cached schemas. |
|
||||
|
||||
@@ -110,7 +110,7 @@ func (p *BlogPlugin) Schedule() []pact.ScheduledCommand {
|
||||
| `pact.HasMailPartials` | Ships mail partials, named `<plugin>::mail.partials.<name>` and loaded from `views/mail/partials/<name>.htm`. Independent of `pact.HasMailTemplates`. |
|
||||
| `pact.Permission` | One backend permission entry (code, tab, label, roles). |
|
||||
| `pact.HasPermissions` | Declares backend permissions. |
|
||||
| `pact.TokenScope` | One personal API token scope: name, label, description, permission patterns and HTTP methods. |
|
||||
| `pact.TokenScope` | One personal API token scope: name, label, description, optional `Group` (phrase key containing `::` or literal text, matching `pact.Permission`), permission patterns and HTTP methods. |
|
||||
| `pact.HasTokenScopes` | Declares personal API token scopes compiled at admin boot. |
|
||||
| `pact.FrontendTokenScope` | One member personal API token scope: `Name` (what a route's `user.scope:<name>` middleware checks), `Label`, `Description` and `Implies` (`""`, `read` or `write`; empty means not implied). The route middleware enforces the scope; `Implies` is data for a later OAuth MCP check and is not an expansion by itself. |
|
||||
| `pact.HasFrontendTokenScopes` | Declares member token scopes, the frontend counterpart of `pact.HasTokenScopes`; compiled by the plugin that owns member tokens, never by the admin token catalog. |
|
||||
|
||||
@@ -348,12 +348,63 @@ api_tokens:
|
||||
unknown_scope: ':name (unknown)'
|
||||
unknown_scope_hint: This scope is no longer registered and grants nothing.
|
||||
hint: Token ending in :last4
|
||||
access_level: Access level
|
||||
tier_full: Full (*)
|
||||
tier_read_only: Read-only
|
||||
tier_custom: Custom
|
||||
scope_customize: Customize scopes…
|
||||
scope_more: "+:count more"
|
||||
scope_count:
|
||||
one: ":count scope"
|
||||
other: ":count scopes"
|
||||
scope_write_count:
|
||||
one: ":count write scope"
|
||||
other: ":count write scopes"
|
||||
scope_plugin_count:
|
||||
one: ":count plugin"
|
||||
other: ":count plugins"
|
||||
scope_summary_line: ":scopes across :plugins"
|
||||
scope_summary_admin_read_only: Read-only across the whole admin
|
||||
scope_summary_admin_read_plus: "All read-only + :scopes across :plugins"
|
||||
scope_summary_empty: No scopes selected yet. Choose Customize scopes to pick access.
|
||||
scope_picker_title: Customize scopes
|
||||
scope_picker_description: Choose which scopes this token may use.
|
||||
scope_picker_apply: Apply scopes
|
||||
scope_picker_discard: Discard changes
|
||||
scope_picker_back: Back to token
|
||||
scope_picker_selected: ":scopes selected"
|
||||
scope_picker_selected_admin_read: "All read-only + :scopes"
|
||||
scope_picker_none_selected: Choose at least one scope to apply.
|
||||
scope_search_label: Search scopes
|
||||
scope_search_placeholder: Search plugins, groups, or scopes…
|
||||
scope_search_clear: Clear search
|
||||
scope_filter_label: Filter scopes
|
||||
scope_filter_all: "All (:count)"
|
||||
scope_filter_selected: "Selected (:count)"
|
||||
scope_filter_read_only: "Read-only (:count)"
|
||||
scope_filter_reset: Show all scopes
|
||||
scope_also_admin_read: Also allow reading all other plugins
|
||||
scope_also_admin_read_hint: Locks every read-only scope below. Leave unticked to block reading specific resources.
|
||||
via_admin_read: "via admin:read"
|
||||
group_select_read: Read
|
||||
group_select_all: All
|
||||
group_clear: Clear
|
||||
group_select_read_named: "Select read-only scopes in :group"
|
||||
group_select_all_named: "Select all scopes in :group"
|
||||
group_clear_named: "Clear selected scopes in :group"
|
||||
scope_empty_search_title: No matching scopes
|
||||
scope_empty_search_body: "No plugins, groups, or scopes match “:query”. Clear the search or try another term."
|
||||
scope_empty_selected_title: No scopes selected yet
|
||||
scope_empty_selected_body: Switch to All scopes to pick what this grant may access.
|
||||
scope_empty_readonly_title: No read-only scopes in this list
|
||||
scope_empty_readonly_body: Switch to All scopes to view the available write scopes.
|
||||
mcp_connect:
|
||||
request_not_found: This connection request has expired or does not exist.
|
||||
no_grantable_scopes: Choose at least one scope you can use.
|
||||
page_title: Connect an agent
|
||||
heading: Allow :client to use the admin as you?
|
||||
subline: The agent gets your permissions, limited to the scopes you tick. It never gets more access than your own account.
|
||||
subline: The agent gets your permissions, limited to the access you choose. It never gets more access than your own account.
|
||||
scope_picker_description: Choose which scopes :client may use on your behalf.
|
||||
signed_in_as: Signed in as
|
||||
admin_with_email: ":name (:email)"
|
||||
switch_account: Use another account
|
||||
|
||||
@@ -370,12 +370,69 @@ api_tokens:
|
||||
unknown_scope: ':name (nieznany)'
|
||||
unknown_scope_hint: Ten zakres nie jest już zarejestrowany i nic nie przyznaje.
|
||||
hint: Token kończący się na :last4
|
||||
access_level: Poziom dostępu
|
||||
tier_full: Pełny (*)
|
||||
tier_read_only: Tylko odczyt
|
||||
tier_custom: Własny
|
||||
scope_customize: Dostosuj zakresy…
|
||||
scope_more: "+:count więcej"
|
||||
scope_count:
|
||||
one: ":count zakres"
|
||||
few: ":count zakresy"
|
||||
many: ":count zakresów"
|
||||
other: ":count zakresu"
|
||||
scope_write_count:
|
||||
one: ":count zakres zapisu"
|
||||
few: ":count zakresy zapisu"
|
||||
many: ":count zakresów zapisu"
|
||||
other: ":count zakresu zapisu"
|
||||
scope_plugin_count:
|
||||
one: ":count wtyczce"
|
||||
few: ":count wtyczkach"
|
||||
many: ":count wtyczkach"
|
||||
other: ":count wtyczki"
|
||||
scope_summary_line: ":scopes w :plugins"
|
||||
scope_summary_admin_read_only: Tylko odczyt w całym panelu
|
||||
scope_summary_admin_read_plus: "Cały odczyt + :scopes w :plugins"
|
||||
scope_summary_empty: Nie wybrano jeszcze żadnych zakresów. Kliknij Dostosuj zakresy, aby określić dostęp.
|
||||
scope_picker_title: Dostosuj zakresy
|
||||
scope_picker_description: Wybierz zakresy, których może używać ten token.
|
||||
scope_picker_apply: Zastosuj zakresy
|
||||
scope_picker_discard: Odrzuć zmiany
|
||||
scope_picker_back: Wróć do tokenu
|
||||
scope_picker_selected: "Wybrano: :scopes"
|
||||
scope_picker_selected_admin_read: "Cały odczyt + :scopes"
|
||||
scope_picker_none_selected: Wybierz co najmniej jeden zakres, aby zastosować.
|
||||
scope_search_label: Szukaj zakresów
|
||||
scope_search_placeholder: Szukaj wtyczek, grup lub zakresów…
|
||||
scope_search_clear: Wyczyść wyszukiwanie
|
||||
scope_filter_label: Filtruj zakresy
|
||||
scope_filter_all: "Wszystkie (:count)"
|
||||
scope_filter_selected: "Wybrane (:count)"
|
||||
scope_filter_read_only: "Tylko odczyt (:count)"
|
||||
scope_filter_reset: Pokaż wszystkie zakresy
|
||||
scope_also_admin_read: Zezwól także na odczyt ze wszystkich pozostałych wtyczek
|
||||
scope_also_admin_read_hint: Blokuje jako zaznaczone wszystkie poniższe zakresy tylko do odczytu. Pozostaw odznaczone, aby wykluczyć odczyt wybranych zasobów.
|
||||
via_admin_read: "przez admin:read"
|
||||
group_select_read: Odczyt
|
||||
group_select_all: Wszystkie
|
||||
group_clear: Wyczyść
|
||||
group_select_read_named: "Zaznacz zakresy tylko do odczytu w grupie :group"
|
||||
group_select_all_named: "Zaznacz wszystkie zakresy w grupie :group"
|
||||
group_clear_named: "Wyczyść wybrane zakresy w grupie :group"
|
||||
scope_empty_search_title: Brak pasujących zakresów
|
||||
scope_empty_search_body: "Żadne wtyczki, grupy ani zakresy nie pasują do „:query”. Wyczyść wyszukiwanie lub wpisz inne słowo."
|
||||
scope_empty_selected_title: Nie wybrano jeszcze żadnych zakresów
|
||||
scope_empty_selected_body: Przełącz na Wszystkie zakresy, aby wybrać uprawnienia.
|
||||
scope_empty_readonly_title: Brak zakresów tylko do odczytu na tej liście
|
||||
scope_empty_readonly_body: Przełącz na Wszystkie zakresy, aby zobaczyć dostępne zakresy zapisu.
|
||||
mcp_connect:
|
||||
request_not_found: To żądanie połączenia wygasło albo nie istnieje.
|
||||
no_grantable_scopes: Wybierz co najmniej jeden zakres, którego możesz użyć.
|
||||
page_title: Połącz agenta
|
||||
heading: Pozwolić aplikacji :client korzystać z panelu w Twoim imieniu?
|
||||
subline: Agent otrzyma Twoje uprawnienia w granicach zaznaczonych zakresów. Nigdy nie dostanie szerszego dostępu niż Twoje konto.
|
||||
subline: Agent otrzyma Twoje uprawnienia w granicach wybranego dostępu. Nigdy nie dostanie szerszego dostępu niż Twoje konto.
|
||||
scope_picker_description: Wybierz zakresy, których aplikacja :client może używać w Twoim imieniu.
|
||||
signed_in_as: Zalogowano jako
|
||||
admin_with_email: ":name (:email)"
|
||||
switch_account: Użyj innego konta
|
||||
|
||||
@@ -138,7 +138,7 @@ An MCP client then connects to `https://example.com/mcp` with an OAuth access to
|
||||
|
||||
| Identifier | Description |
|
||||
|------------|-------------|
|
||||
| `pier.Mount` | Reads the `mcp.*` keys and, with `mcp.enabled` true, compiles every plugin's declaration, registers the built-in backend guard provider and mounts POST, GET and DELETE at `mcp.path` through the host's streaming route kind behind `throttle:<mcp.throttle>`; a bad declaration or a route already at the path fails with an error naming the plugin. Called by surf's tagged mount hook. |
|
||||
| `pier.Mount` | Reads the `mcp.*` keys and, with `mcp.enabled` true, compiles every plugin's declaration, checks backend non-`GET`/`HEAD` tools against non-`*` token scopes via `cabana.TokenScopeCovers` (emitting one structured warning per plugin with uncovered write tools without failing boot), registers the built-in backend guard provider and mounts POST, GET and DELETE at `mcp.path` through the host's streaming route kind behind `throttle:<mcp.throttle>`; a bad declaration or a route already at the path fails with an error naming the plugin. Called by surf's tagged mount hook. |
|
||||
| `pier.Host` | What pier needs from the router: `Routes`, `Handler` (the compiled chain of one route, resolved lazily), `MountStream`, `MountJSON` and `Owner`. surf passes an adapter. |
|
||||
| `pier.RouteInfo` | One registered route: method, pattern, plugin id and middleware names. |
|
||||
| `pier.PluginID` | `summercms.pier`, the pseudo-plugin id of pier's routes in the route table. |
|
||||
|
||||
Reference in New Issue
Block a user