mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 22:06:31 +00:00
fix(mcp): give every MCP round an identity provider to sign in with
An MCP client spec signs in through the client's own OIDC button, which redirects to Keycloak. Every provider put its MCP pairing in the lean variant, and that variant pinned sso off - so the round that exists to prove the pairing was the one round without an identity provider. Run 33574056480 shows what that costs: openwebui's MCP specs reached _shared.js:131 and died on "openwebui OIDC sign-in button must be visible on the auth page". The rule now demands two things of the variant that carries the consumers: the provider pins sso on, and each admitted consumer, in the variant that round actually pulls in, does not pin it off. The second half matters because a round deploys every dependency at its own index and falls back to variant 0 only when the dependency has fewer, so the client shipping alongside is that one and not the client's variant 0. A role that declares no sso, or pins it to a literal false because upstream speaks no OIDC, is exempt from a flag it cannot have. Twenty roles moved to satisfy it. Ten already had a second sso: false pin and only needed the flip. Six could host the pairing in variant 0, which already has sso on, and dropped back to two variants. Six kept a third lean variant to carry the false polarity variants-coverage wants. moodle and mattermost took swaps instead: moodle's variant 1 is the mandated LDAP-only branch, and mattermost was already at the three-variant cap with sso on in its variant 2. nextcloud also turns context_agent on in that round, the ExApp that serves the endpoint - with it off the round proved nothing it was built to prove. The rule moves to tests/lint/ansible/services/ because it reads meta YAML and executes nothing, which is where integration.md says such a check belongs, and its suppression key joins the catalog it was never listed in. nextcloud_exapp_reregister becomes nextcloud_exapp_renew: mcp-secret-masking matches `register:` unanchored, so the substring in the old name read as a task that prints a secret. register.yml already masks the two tasks that carry one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4e7fe45914
commit
4164f37981
27 files changed
+558
-272
No files matched your search
@@ -84,6 +84,7 @@ The placement rule is per check. The catalog "Position" column uses these labels
|
||||
| `playwright-service-flag` | comment block above | [test_env_services_match.py](../../../../tests/integration/roles/playwright/test_env_services_match.py) | Exempts a top-level service in `roles/<role>/meta/services.yml` from the "must be registered as `<NAME>_SERVICE_ENABLED=` in `templates/playwright.env.j2`" check. |
|
||||
| `playwright-service-gate` | same or above | [test_spec_env_gates.py](../../../../tests/integration/roles/playwright/test_spec_env_gates.py) | Exempts a `<NAME>_SERVICE_ENABLED=` line in `roles/<role>/templates/playwright.env.j2` from the "must be gated in `files/playwright/playwright.spec.js`" check. |
|
||||
| `mcp-consumer-services-entry` | head of file | [test_mcp_consumer_services_entry.py](../../../../tests/lint/ansible/services/test_mcp_consumer_services_entry.py) | Exempts a server-capable `roles/<role>/meta/mcp.yml` from the "must carry a `"{{ '<client>' in group_names }}"`-gated `services.<client-entity>` entry for every role declaring `mcp_consumer: true`" check. Reserved for a provider that legitimately owns no co-deploy edge to its clients. |
|
||||
| `mcp-consumer-variant` | head of file | [test_mcp_consumer_variant.py](../../../../tests/lint/ansible/services/test_mcp_consumer_variant.py) | Exempts a server-capable `roles/<role>/meta/mcp.yml` from the "must ship one `meta/variants.yml` entry enabling every admitted consumer, with `sso` pinned on, and pulling in a consumer variant that does not pin `sso: false`" check. Reserved for a provider whose pairing is genuinely proven elsewhere. |
|
||||
| `pkgmgr-deprecated` | same or above | [test_pkgmgr_deprecated.py](../../../../tests/lint/repository/dependencies/test_pkgmgr_deprecated.py) | Suppresses the warn-only deprecation notice for `include_role` / `import_role` of `pkgmgr` / `pkgmgr-install`. The check emits a `DeprecationWarning` locally and a GitHub Actions `::warning` annotation in CI. Prefer `pip install <name>` or `pip install git+<repo>`. |
|
||||
| `deprecated-http-header` | same or above | [test_no_deprecated_http_security_headers.py](../../../../tests/lint/repository/network/test_no_deprecated_http_security_headers.py) | Exempts a deprecated `add_header` / `Header set/add` line for `X-Frame-Options` / `X-XSS-Protection` / `X-Download-Options` / `X-Permitted-Cross-Domain-Policies`. Prefer Content-Security-Policy via the role's `meta/server.yml` (`csp.flags` / `csp.whitelist`). |
|
||||
| `container-name` | same or above | [test_mode_incompatible_keys.py](../../../../tests/lint/ansible/jinja/test_mode_incompatible_keys.py) | Allows a raw `container_name:` key in a `roles/*/templates/**/*.j2` template. Default path: route through the generic `compose_only` lookup (`{{ lookup('compose_only', 'container_name', NAME) }}`) so swarm-mode replicas do not collide on the static name. |
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
@@ -81,11 +81,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -64,8 +64,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
dashboard:
|
||||
enabled: false
|
||||
@@ -76,11 +76,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -61,8 +61,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
ollama:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
@@ -84,3 +84,39 @@
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
ollama:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
litellm:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
qdrant:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
@@ -73,8 +73,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
postgres:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
redis:
|
||||
@@ -89,3 +89,42 @@
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
seaweedfs:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -25,6 +25,30 @@
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
sso:
|
||||
enabled: true
|
||||
shared: true
|
||||
litellm:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override variant pins a literal off-switch
|
||||
tor:
|
||||
enabled: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
asset:
|
||||
enabled: false
|
||||
@@ -78,11 +78,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -66,12 +66,12 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
postgres:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
shared: true
|
||||
redis:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
shared: true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
@@ -82,8 +82,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
litellm:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
@@ -113,12 +113,12 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
postgres:
|
||||
shared: true
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
redis:
|
||||
shared: true
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
@@ -129,8 +129,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
litellm:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
|
||||
@@ -51,6 +51,50 @@
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
ldap:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
mariadb:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: true
|
||||
shared: true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
litellm:
|
||||
enabled: true
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
@@ -96,47 +140,3 @@
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
ldap:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
mariadb:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
litellm:
|
||||
enabled: true
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
@@ -32,14 +32,14 @@
|
||||
enabled: true
|
||||
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
@@ -73,11 +73,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -117,8 +117,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
coturn:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
@@ -132,8 +132,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
context_agent:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
|
||||
run_once: true
|
||||
vars:
|
||||
nextcloud_exapp_reregister: false
|
||||
nextcloud_exapp_renew: false
|
||||
|
||||
- name: "🔍 Read the MCP app password this deployment already issued"
|
||||
ansible.builtin.set_fact:
|
||||
@@ -70,7 +70,7 @@
|
||||
delegate_to: "{{ NEXTCLOUD_HOST_NODE }}"
|
||||
run_once: true
|
||||
vars:
|
||||
nextcloud_exapp_reregister: true
|
||||
nextcloud_exapp_renew: true
|
||||
when: nextcloud_mcp_probe.stdout != '200'
|
||||
|
||||
- name: "🩺 Re-check the endpoint behind the re-registered ExApp"
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
- "{{ NEXTCLOUD_CONTEXT_AGENT_SERVICE }}"
|
||||
- --force
|
||||
when:
|
||||
- nextcloud_exapp_reregister | bool
|
||||
- nextcloud_exapp_renew | bool
|
||||
- NEXTCLOUD_CONTEXT_AGENT_SERVICE in nextcloud_registered_exapps.stdout
|
||||
changed_when: true
|
||||
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
||||
@@ -85,7 +85,7 @@
|
||||
- --wait-finish
|
||||
when: >-
|
||||
NEXTCLOUD_CONTEXT_AGENT_SERVICE not in nextcloud_registered_exapps.stdout
|
||||
or nextcloud_exapp_reregister | bool
|
||||
or nextcloud_exapp_renew | bool
|
||||
changed_when: true
|
||||
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
||||
|
||||
|
||||
@@ -28,6 +28,33 @@
|
||||
shared: true
|
||||
tor:
|
||||
enabled: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: true
|
||||
shared: true
|
||||
litellm:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
litellm:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
postgres:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
redis:
|
||||
@@ -83,3 +83,39 @@
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -57,8 +57,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
@@ -76,3 +76,39 @@
|
||||
flowise:
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
dashboard:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
email:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
logout:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
matomo:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
css:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
flowise:
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -76,8 +76,8 @@
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
prometheus:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
container_backup:
|
||||
enabled: false
|
||||
@@ -89,11 +89,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
addons:
|
||||
activitypub:
|
||||
enabled: false
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
memcached:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
sso:
|
||||
enabled: false
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
enabled: true
|
||||
shared: true
|
||||
postgres:
|
||||
shared: false # nocheck: variants-static-override backup shared stays literally true
|
||||
prometheus:
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
hermes:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
openclaw:
|
||||
enabled: false
|
||||
shared: false
|
||||
enabled: true
|
||||
shared: true
|
||||
- services:
|
||||
matomo:
|
||||
enabled: false
|
||||
@@ -49,11 +49,11 @@
|
||||
tor:
|
||||
enabled: true
|
||||
openwebui:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
hermes:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
openclaw:
|
||||
enabled: true
|
||||
shared: true
|
||||
enabled: false
|
||||
shared: false
|
||||
@@ -1,118 +0,0 @@
|
||||
"""Integration guard: an MCP provider ships a round that proves the pairing.
|
||||
|
||||
A surface nobody deploys against is never exercised, so every role with a
|
||||
``meta/mcp.yml`` that admits at least one consumer needs one variant pinning
|
||||
every admitted consumer to ``enabled: true``. What else that variant carries
|
||||
is the role's own call.
|
||||
|
||||
Suppression (see ``docs/contributing/actions/testing/suppression.md``):
|
||||
|
||||
* ``# nocheck: mcp-consumer-variant`` in the head of the role's
|
||||
``meta/mcp.yml``.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from collections.abc import Mapping
|
||||
|
||||
from utils.annotations.suppress import is_suppressed_in_head
|
||||
from utils.cache.applications import get_application_defaults, get_variants
|
||||
from utils.cache.files import read_text
|
||||
from utils.roles.applications.mcp import derive_allowed_consumers
|
||||
from utils.roles.entity.name import get_entity_name
|
||||
from utils.roles.mapping import ROLE_FILE_META_MCP
|
||||
|
||||
from . import PROJECT_ROOT
|
||||
|
||||
_RULE = "mcp-consumer-variant"
|
||||
_SERVER_DIRECTIONS = frozenset({"server", "both"})
|
||||
|
||||
ROLES_DIR = PROJECT_ROOT / "roles"
|
||||
|
||||
|
||||
def _variant_findings(role: str, consumers: set[str], variant: Mapping) -> list[str]:
|
||||
"""Return why one variant does not prove the role's MCP pairing.
|
||||
|
||||
Args:
|
||||
role: the provider role id.
|
||||
consumers: entity keys of every admitted consumer.
|
||||
variant: one ``meta/variants.yml`` entry.
|
||||
"""
|
||||
services = variant.get("services")
|
||||
if not isinstance(services, Mapping):
|
||||
return [f"{role}: variant declares no services"]
|
||||
findings: list[str] = []
|
||||
for key in sorted(consumers):
|
||||
entry = services.get(key)
|
||||
if not isinstance(entry, Mapping) or entry.get("enabled") is not True:
|
||||
findings.append(f"{role}: {key} is not enabled")
|
||||
return findings
|
||||
|
||||
|
||||
def offenders() -> list[str]:
|
||||
"""Return one finding per provider that never deploys its consumers."""
|
||||
defaults = get_application_defaults(roles_dir=ROLES_DIR)
|
||||
services_by_role = {
|
||||
role: (config or {}).get("services")
|
||||
for role, config in defaults.items()
|
||||
if isinstance(config, dict)
|
||||
}
|
||||
variants = get_variants(roles_dir=ROLES_DIR)
|
||||
findings: list[str] = []
|
||||
for meta in sorted(ROLES_DIR.glob(f"*/{ROLE_FILE_META_MCP}")):
|
||||
role = meta.parent.parent.name
|
||||
block = (defaults.get(role) or {}).get("mcp")
|
||||
if not isinstance(block, Mapping):
|
||||
continue
|
||||
if str(block.get("direction") or "").strip().lower() not in _SERVER_DIRECTIONS:
|
||||
continue
|
||||
if is_suppressed_in_head(read_text(str(meta)).splitlines(), _RULE):
|
||||
continue
|
||||
consumers = {
|
||||
get_entity_name(c) for c in derive_allowed_consumers(role, services_by_role)
|
||||
}
|
||||
if not consumers:
|
||||
continue
|
||||
per_variant = [
|
||||
_variant_findings(role, consumers, v)
|
||||
for v in variants.get(role, [])
|
||||
if isinstance(v, Mapping)
|
||||
]
|
||||
if any(not f for f in per_variant):
|
||||
continue
|
||||
closest = min(per_variant, key=len) if per_variant else [f"{role}: no variants"]
|
||||
findings.append(
|
||||
f"{role}: no variant enables every admitted consumer; the closest "
|
||||
f"one still reports: {'; '.join(closest)}"
|
||||
)
|
||||
return findings
|
||||
|
||||
|
||||
class TestMcpConsumerVariant(unittest.TestCase):
|
||||
def test_every_provider_ships_a_variant_enabling_its_consumers(self) -> None:
|
||||
findings = offenders()
|
||||
self.assertEqual(
|
||||
[],
|
||||
findings,
|
||||
f"MCP provider(s) whose consumers never deploy ({len(findings)}):\n"
|
||||
+ "\n".join(f" - {f}" for f in findings),
|
||||
)
|
||||
|
||||
def test_the_scan_finds_providers(self) -> None:
|
||||
defaults = get_application_defaults(roles_dir=ROLES_DIR)
|
||||
seen = sum(
|
||||
1
|
||||
for meta in ROLES_DIR.glob(f"*/{ROLE_FILE_META_MCP}")
|
||||
if isinstance(
|
||||
(defaults.get(meta.parent.parent.name) or {}).get("mcp"), Mapping
|
||||
)
|
||||
)
|
||||
self.assertTrue(
|
||||
seen,
|
||||
"no role ships meta/mcp.yml, so the rule would pass vacuously",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
unittest.main()
|
||||
@@ -0,0 +1,205 @@
|
||||
"""Lint: an MCP provider ships a round that proves the pairing.
|
||||
|
||||
A surface nobody deploys against is never exercised, so every role with a
|
||||
``meta/mcp.yml`` that admits at least one consumer needs one variant pinning
|
||||
every admitted consumer to ``enabled: true``.
|
||||
|
||||
That round also has to be able to sign in. An MCP client spec signs in through
|
||||
the client's own OIDC button, which redirects to Keycloak, so a round without
|
||||
an identity provider skips the lot and proves nothing it was built to prove.
|
||||
The provider
|
||||
therefore keeps ``sso`` on in that variant, and so does each consumer in the
|
||||
variant the round actually pulls in: a round deploys every dependency at its
|
||||
own index, falling back to variant 0 when it has fewer, so the client that
|
||||
ships alongside is that one and not the client's variant 0.
|
||||
|
||||
A role that declares no ``sso`` service, or pins it to a literal ``false``
|
||||
because upstream speaks no OIDC, is exempt from the flag it cannot have.
|
||||
|
||||
Suppression (see ``docs/contributing/actions/testing/suppression.md``):
|
||||
|
||||
* ``# nocheck: mcp-consumer-variant`` in the head of the role's
|
||||
``meta/mcp.yml``.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from collections.abc import Mapping
|
||||
|
||||
from utils.annotations.suppress import is_suppressed_in_head
|
||||
from utils.cache.applications import get_application_defaults, get_variants
|
||||
from utils.cache.files import read_text
|
||||
from utils.roles.applications.mcp import derive_allowed_consumers
|
||||
from utils.roles.entity.name import get_entity_name
|
||||
from utils.roles.mapping import ROLE_FILE_META_MCP
|
||||
|
||||
from . import PROJECT_ROOT
|
||||
|
||||
_RULE = "mcp-consumer-variant"
|
||||
_SERVER_DIRECTIONS = frozenset({"server", "both"})
|
||||
|
||||
ROLES_DIR = PROJECT_ROOT / "roles"
|
||||
|
||||
|
||||
def _declares_sso(services: Mapping | None) -> bool:
|
||||
"""Whether a role can put an identity provider in front of itself.
|
||||
|
||||
A literal ``enabled: false`` is the shape a role uses when upstream
|
||||
speaks no OIDC at all, so there is nothing for a variant to pin on.
|
||||
"""
|
||||
if not isinstance(services, Mapping):
|
||||
return False
|
||||
entry = services.get("sso")
|
||||
return isinstance(entry, Mapping) and entry.get("enabled") is not False
|
||||
|
||||
|
||||
def _sso_flag(variant: Mapping | None) -> object:
|
||||
"""Return a variant's ``services.sso.enabled`` pin, or None when unpinned."""
|
||||
services = (variant or {}).get("services")
|
||||
if not isinstance(services, Mapping):
|
||||
return None
|
||||
entry = services.get("sso")
|
||||
return entry.get("enabled") if isinstance(entry, Mapping) else None
|
||||
|
||||
|
||||
def _round_variant(variants: list, index: int) -> Mapping | None:
|
||||
"""Return the entry a round at ``index`` deploys a role at.
|
||||
|
||||
Args:
|
||||
variants: that role's ``meta/variants.yml`` entries.
|
||||
index: the round index the provider's variant sits at.
|
||||
|
||||
A round pins every dependency to its own index and falls back to variant 0
|
||||
when the dependency has fewer, which is what
|
||||
:mod:`cli.administration.deploy.development.inventory` plans.
|
||||
"""
|
||||
if not variants:
|
||||
return None
|
||||
entry = variants[index] if index < len(variants) else variants[0]
|
||||
return entry if isinstance(entry, Mapping) else None
|
||||
|
||||
|
||||
def _variant_findings(
|
||||
role: str,
|
||||
consumers: set[str],
|
||||
variant: Mapping,
|
||||
index: int,
|
||||
services_by_role: Mapping,
|
||||
variants_by_role: Mapping,
|
||||
consumer_ids: Mapping,
|
||||
) -> list[str]:
|
||||
"""Return why one variant does not prove the role's MCP pairing.
|
||||
|
||||
Args:
|
||||
role: the provider role id.
|
||||
consumers: entity keys of every admitted consumer.
|
||||
variant: one ``meta/variants.yml`` entry.
|
||||
index: that entry's position, which is the round index.
|
||||
services_by_role: every role's services mapping.
|
||||
variants_by_role: every role's variant list.
|
||||
consumer_ids: entity key to consumer role id.
|
||||
"""
|
||||
services = variant.get("services")
|
||||
if not isinstance(services, Mapping):
|
||||
return [f"{role}: variant declares no services"]
|
||||
findings: list[str] = []
|
||||
for key in sorted(consumers):
|
||||
entry = services.get(key)
|
||||
if not isinstance(entry, Mapping) or entry.get("enabled") is not True:
|
||||
findings.append(f"{role}: {key} is not enabled")
|
||||
if findings:
|
||||
return findings
|
||||
|
||||
if _declares_sso(services_by_role.get(role)) and _sso_flag(variant) is not True:
|
||||
findings.append(f"{role}: variant {index} does not pin sso on")
|
||||
for key in sorted(consumers):
|
||||
consumer = consumer_ids.get(key)
|
||||
if not consumer or not _declares_sso(services_by_role.get(consumer)):
|
||||
continue
|
||||
pulled = _round_variant(variants_by_role.get(consumer) or [], index)
|
||||
if _sso_flag(pulled) is False:
|
||||
findings.append(
|
||||
f"{role}: {key} ships with sso off in the variant round "
|
||||
f"{index} pulls in, so its MCP specs skip"
|
||||
)
|
||||
return findings
|
||||
|
||||
|
||||
def offenders() -> list[str]:
|
||||
"""Return one finding per provider that never deploys its consumers."""
|
||||
defaults = get_application_defaults(roles_dir=ROLES_DIR)
|
||||
services_by_role = {
|
||||
role: (config or {}).get("services")
|
||||
for role, config in defaults.items()
|
||||
if isinstance(config, dict)
|
||||
}
|
||||
variants = get_variants(roles_dir=ROLES_DIR)
|
||||
findings: list[str] = []
|
||||
for meta in sorted(ROLES_DIR.glob(f"*/{ROLE_FILE_META_MCP}")):
|
||||
role = meta.parent.parent.name
|
||||
block = (defaults.get(role) or {}).get("mcp")
|
||||
if not isinstance(block, Mapping):
|
||||
continue
|
||||
if str(block.get("direction") or "").strip().lower() not in _SERVER_DIRECTIONS:
|
||||
continue
|
||||
if is_suppressed_in_head(read_text(str(meta)).splitlines(), _RULE):
|
||||
continue
|
||||
consumer_ids = {
|
||||
get_entity_name(c): c
|
||||
for c in derive_allowed_consumers(role, services_by_role)
|
||||
}
|
||||
consumers = set(consumer_ids)
|
||||
if not consumers:
|
||||
continue
|
||||
per_variant = [
|
||||
_variant_findings(
|
||||
role, consumers, v, index, services_by_role, variants, consumer_ids
|
||||
)
|
||||
for index, v in enumerate(variants.get(role, []))
|
||||
if isinstance(v, Mapping)
|
||||
]
|
||||
if any(not f for f in per_variant):
|
||||
continue
|
||||
closest = (
|
||||
min(
|
||||
per_variant,
|
||||
key=lambda f: (sum("is not enabled" in x for x in f), len(f)),
|
||||
)
|
||||
if per_variant
|
||||
else [f"{role}: no variants"]
|
||||
)
|
||||
findings.append(
|
||||
f"{role}: no variant enables every admitted consumer; the closest "
|
||||
f"one still reports: {'; '.join(closest)}"
|
||||
)
|
||||
return findings
|
||||
|
||||
|
||||
class TestMcpConsumerVariant(unittest.TestCase):
|
||||
def test_every_provider_ships_a_variant_enabling_its_consumers(self) -> None:
|
||||
findings = offenders()
|
||||
self.assertEqual(
|
||||
[],
|
||||
findings,
|
||||
f"MCP provider(s) whose consumers never deploy ({len(findings)}):\n"
|
||||
+ "\n".join(f" - {f}" for f in findings),
|
||||
)
|
||||
|
||||
def test_the_scan_finds_providers(self) -> None:
|
||||
defaults = get_application_defaults(roles_dir=ROLES_DIR)
|
||||
seen = sum(
|
||||
1
|
||||
for meta in ROLES_DIR.glob(f"*/{ROLE_FILE_META_MCP}")
|
||||
if isinstance(
|
||||
(defaults.get(meta.parent.parent.name) or {}).get("mcp"), Mapping
|
||||
)
|
||||
)
|
||||
self.assertTrue(
|
||||
seen,
|
||||
"no role ships meta/mcp.yml, so the rule would pass vacuously",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user