From dad0d48a3dadbc32fe584e158e6200b545eaaa5f Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Wed, 27 May 2026 15:03:07 -0400 Subject: [PATCH 1/7] feat: add dynamic admin provider scenario --- scenarios.json | 12 + scenarios/90-admin-tailnet-demo/README.md | 15 + scenarios/90-admin-tailnet-demo/app/app.py | 269 +++++++++++++++++- .../90-admin-tailnet-demo/docker-compose.yml | 16 +- .../test/playwright-authz-qa.sh | 2 +- scenarios/90-admin-tailnet-demo/test/run.sh | 77 ++++- 6 files changed, 372 insertions(+), 19 deletions(-) diff --git a/scenarios.json b/scenarios.json index f710b38..5d0f744 100644 --- a/scenarios.json +++ b/scenarios.json @@ -1086,6 +1086,18 @@ "lastTested": null, "lastResult": null }, + "90-admin-tailnet-demo": { + "status": "testable", + "namespace": "local", + "deployed": false, + "testCount": 0, + "passCount": 0, + "failCount": 0, + "localOnly": true, + "notes": "Docker Compose app/admin demo with auth-gated admin portal, dynamic auth provider descriptor catalog, authz RBAC/ABAC/ReBAC UI, Ory Keto enforcement, and optional Tailscale sidecar.", + "lastTested": null, + "lastResult": null + }, "91-dns-delegation": { "status": "draft", "namespace": "local", diff --git a/scenarios/90-admin-tailnet-demo/README.md b/scenarios/90-admin-tailnet-demo/README.md index 2d90356..8489f10 100644 --- a/scenarios/90-admin-tailnet-demo/README.md +++ b/scenarios/90-admin-tailnet-demo/README.md @@ -5,14 +5,29 @@ This scenario runs a small app with an auth-gated administration portal, a decla - App: - Admin: - Authz admin contribution: +- Auth provider catalog API: - Status API: Demo users: - `admin@tailnet` / `admin`: full admin and frontend scopes. +- `provider-admin@tailnet` / `provider`: auth provider read-only admin. - `readonly-admin@tailnet` / `readonly`: admin read scopes only. - `app-user@tailnet` / `user`: frontend scopes only. +The auth provider catalog composes descriptor-shaped records for released +Workflow provider plugins: + +- `workflow-plugin-auth v0.2.11` +- `workflow-plugin-sso v0.1.6` +- `workflow-plugin-okta v0.2.4` +- `workflow-plugin-auth0 v0.1.0` +- `workflow-plugin-entra v0.1.0` +- `workflow-plugin-ory-kratos v0.1.0` +- `workflow-plugin-ory-hydra v0.1.0` +- `workflow-plugin-ory-polis v0.1.0` +- `workflow-plugin-scalekit v0.1.0` + The authz contribution displays frontend and admin scopes from the declared scope catalog, including owner plugin/module metadata. The demo defaults to `AUTHZ_PROVIDER=keto`, runs a local Ory Keto container, and resolves role assignments into Keto scope relationship checks for the app/admin surfaces. ## Run diff --git a/scenarios/90-admin-tailnet-demo/app/app.py b/scenarios/90-admin-tailnet-demo/app/app.py index 4af3bdd..4ee25c5 100644 --- a/scenarios/90-admin-tailnet-demo/app/app.py +++ b/scenarios/90-admin-tailnet-demo/app/app.py @@ -28,6 +28,10 @@ "password": "readonly", "scopes": ["admin:dashboard:read", "admin:authz.roles:read", "admin:authz.scopes:read"], }, + "provider-admin@tailnet": { + "password": "provider", + "scopes": ["admin:dashboard:read", "admin:auth.settings:read", "admin:auth.providers:read"], + }, "admin@tailnet": { "password": "admin", "scopes": [ @@ -37,6 +41,8 @@ "admin:app:update", "admin:auth.settings:read", "admin:auth.settings:update", + "admin:auth.providers:read", + "admin:auth.providers:update", "admin:authz.roles:read", "admin:authz.roles:update", "admin:authz.scopes:read", @@ -58,6 +64,8 @@ {"name": "admin:app:update", "context": "admin", "resource": "app", "actions": ["update"], "description": "Update application operations from admin", "owner_plugin": "workflow-plugin-admin", "owner_module": "admin", "category": "admin"}, {"name": "admin:auth.settings:read", "context": "admin", "resource": "auth.settings", "actions": ["read"], "description": "Inspect authentication plugin settings", "owner_plugin": "workflow-plugin-auth", "owner_module": "admin-config", "category": "security"}, {"name": "admin:auth.settings:update", "context": "admin", "resource": "auth.settings", "actions": ["update"], "description": "Validate and update authentication plugin settings", "owner_plugin": "workflow-plugin-auth", "owner_module": "admin-config", "category": "security"}, + {"name": "admin:auth.providers:read", "context": "admin", "resource": "auth.providers", "actions": ["read"], "description": "Inspect registered authentication provider descriptors", "owner_plugin": "workflow-plugin-auth", "owner_module": "provider-catalog", "category": "security"}, + {"name": "admin:auth.providers:update", "context": "admin", "resource": "auth.providers", "actions": ["update"], "description": "Update authentication provider configuration", "owner_plugin": "workflow-plugin-auth", "owner_module": "provider-catalog", "category": "security"}, {"name": "admin:authz.roles:read", "context": "admin", "resource": "authz.roles", "actions": ["read"], "description": "Inspect role assignments", "owner_plugin": "workflow-plugin-authz", "owner_module": "scope-catalog", "category": "security"}, {"name": "admin:authz.roles:update", "context": "admin", "resource": "authz.roles", "actions": ["update"], "description": "Create and remove role assignments", "owner_plugin": "workflow-plugin-authz", "owner_module": "scope-catalog", "category": "security"}, {"name": "admin:authz.scopes:read", "context": "admin", "resource": "authz.scopes", "actions": ["read"], "description": "Inspect declared application scopes", "owner_plugin": "workflow-plugin-authz", "owner_module": "scope-catalog", "category": "security"}, @@ -69,7 +77,8 @@ "roles": [ {"user": "app-user@tailnet", "role": "requester", "context": "frontend", "scopes": ["frontend:orders:read", "frontend:requests:create"]}, {"user": "readonly-admin@tailnet", "role": "authz-viewer", "context": "admin", "scopes": ["admin:dashboard:read", "admin:authz.roles:read", "admin:authz.scopes:read"]}, - {"user": "admin@tailnet", "role": "authz-admin", "context": "admin", "scopes": ["admin:dashboard:read", "admin:app:update", "admin:auth.settings:read", "admin:auth.settings:update", "admin:authz.roles:read", "admin:authz.roles:update", "admin:authz.scopes:read", "admin:authz.policies:read", "admin:authz.policies:update", "admin:authz.relations:read", "admin:authz.relations:update"]}, + {"user": "provider-admin@tailnet", "role": "auth-provider-viewer", "context": "admin", "scopes": ["admin:dashboard:read", "admin:auth.settings:read", "admin:auth.providers:read"]}, + {"user": "admin@tailnet", "role": "authz-admin", "context": "admin", "scopes": ["admin:dashboard:read", "admin:app:update", "admin:auth.settings:read", "admin:auth.settings:update", "admin:auth.providers:read", "admin:auth.providers:update", "admin:authz.roles:read", "admin:authz.roles:update", "admin:authz.scopes:read", "admin:authz.policies:read", "admin:authz.policies:update", "admin:authz.relations:read", "admin:authz.relations:update"]}, ], "auth_config": { "environment": "development", @@ -84,6 +93,15 @@ "google_oauth_redirect_url": "https://tailnet-demo.local/auth/google/callback", "totp_auth_enabled": True, "jwt_secret": "configured-secret", + "auth0_domain": "demo.auth0.example", + "auth0_client_id": "auth0-demo-client", + "auth0_client_secret": "configured-secret", + "auth0_callback_url": "http://127.0.0.1:18080/auth/auth0/callback", + "entra_tenant_id": "common", + "entra_client_id": "entra-demo-client", + "scalekit_environment_url": "https://demo.scalekit.com", + "scalekit_client_id": "scalekit-demo-client", + "scalekit_client_secret": "configured-secret", }, "attribute_policies": [ { @@ -258,7 +276,7 @@ def do_GET(self): self.send_html(page("Workflow Tailnet Demo Login", f"""