feat(36-03): implement pact.HasTokenScopes (sitemap, sitemap:read)
This commit is contained in:
@@ -155,7 +155,7 @@ The site's HTML sitemap page (vue-seo-layer) reads two public JSON routes; both
|
||||
|
||||
### Management API and MCP
|
||||
|
||||
Each management route resolves the backend administrator from a backend JWT, a personal API token covering `golem15.sitemap.*`, or the MCP dispatch, and requires `golem15.sitemap.access_definitions` (401 without an administrator, 403 without the permission):
|
||||
Each management route resolves the backend administrator from a backend JWT, a personal API token covering `golem15.sitemap.*` (registered via `TokenScopes` as `sitemap` for full read/write access and `sitemap:read` for `GET`/`HEAD` only), or the MCP dispatch, and requires `golem15.sitemap.access_definitions` (401 without an administrator, 403 without the permission):
|
||||
|
||||
| Route | MCP tool | Effect |
|
||||
|-------|----------|--------|
|
||||
@@ -230,6 +230,7 @@ The files table lists the image and News files too. A save refuses an invalid si
|
||||
| `sitemap.Plugin.Buckets`, `sitemap.BucketSitemap`, `sitemap.BucketHTML`, `sitemap.BucketAPI` | The throttle buckets `sitemap-xml` (60 a minute), `sitemap-html` and `sitemap-api` (300 a minute) per client IP. |
|
||||
| `sitemap.Plugin.Jobs` | The rebuild job (`classes.RebuildKind`, three attempts) and the IndexNow job (`classes.IndexNowKind`, five). |
|
||||
| `sitemap.Plugin.MCP` | The tools `get_settings`, `update_settings` and `rebuild` (exposed with the prefix `sitemap_`). |
|
||||
| `sitemap.Plugin.TokenScopes` | Personal API token scopes `sitemap` (read/write) and `sitemap:read` (`GET`/`HEAD` only), limited to `golem15.sitemap.*`. |
|
||||
| `sitemap.Plugin.Schedule` | `sitemap:rebuild` daily at 03:00. |
|
||||
| `sitemap.Plugin.Commands` | `sitemap:rebuild`, `sitemap:import`, `sitemap:import-winter`. |
|
||||
| `sitemap.Plugin.ConfigFS` | The default `config/config.yaml`. |
|
||||
@@ -321,6 +322,6 @@ go test -short ./... # unit tests, no Docker
|
||||
go test ./... # also the Postgres tests
|
||||
```
|
||||
|
||||
Docker-free: `TestAssignSlots` and `TestRealChanges` (`classes`), `TestAllowedFrontendURL` and `TestSettingsValidate` (`models`), `TestWinterSettingsFrontendURL` (`console`), `TestSiteURLPrecedence`, `TestFileNames`, `TestScheduleAndJobs`, `TestCommandsDocumented` and `TestPluginManifest` (root).
|
||||
Docker-free: `TestAssignSlots` and `TestRealChanges` (`classes`), `TestAllowedFrontendURL` and `TestSettingsValidate` (`models`), `TestWinterSettingsFrontendURL` (`console`), `TestSiteURLPrecedence`, `TestFileNames`, `TestScheduleAndJobs`, `TestCommandsDocumented`, `TestPluginManifest`, `TestTokenScopes`, `TestTokenScopesCoverMCPTools` and `TestTokenScopesReadWriteEnforcement` (root).
|
||||
|
||||
The Postgres tests boot the plugin with a fake content plugin (two content types over an in-memory store), a fake blog plugin (an article type and a collection type) and, for the Filter, a fake plugin that publishes one: `TestSitemapIndex` (the index and files after a rebuild job, drafts absent, escaping, 404s), `TestStableNumbering`, `TestLastmod`, `TestDebouncedRebuild`, `TestHreflangAlternates`, `TestFilterExcludes`, `TestNoFilter`, `TestListing`, `TestSettingsSingleton` (the admin API, its refusals and the files partial), `TestMigrateDefinitions`, `TestImportWinter`, `TestImportFile`, `TestRebuildCommand`, `TestImageSitemap`, `TestNewsSitemap`, `TestIndexNow` (in production, against a fake engine through `fetchguard.WithTransport`), `TestIndexNowStaging`, `TestHTMLGroups` and `TestSitemapTools` (the management API, an MCP dispatch and pier compiling the tools).
|
||||
|
||||
Reference in New Issue
Block a user