Skip to content

feat(services): org-admin curated service catalogs + hard instantiation gate#435

Merged
angel-manuel merged 1 commit into
devfrom
feat/org-curated-catalogs
Jul 7, 2026
Merged

feat(services): org-admin curated service catalogs + hard instantiation gate#435
angel-manuel merged 1 commit into
devfrom
feat/org-curated-catalogs

Conversation

@angel-manuel

Copy link
Copy Markdown
Contributor

Summary

Overslash already had the backend primitives to curate the global service-template catalog per org (orgs.global_templates_enabled + the enabled_global_templates allow-list), but they had no dashboard UI and were only enforced on discovery surfaces — a caller who knew a curated-out template key could still instantiate a service from it. This PR turns catalog curation into a real, admin-managed feature and makes it a hard restriction.

Backend

  • New per-org flag allow_services_outside_catalog (migration 092, default false).
    • false (default) → hard: non-admins get 403 when creating a service from a global template outside the curated catalog.
    • truesoft: curated-out globals stay hidden from discovery but remain instantiable.
    • Org admins are always exempt; only the global tier is curated (org/user templates are in-catalog by definition).
  • Enforcement at instantiation in kernel_create_service, reusing the same allow-list filter as discovery (is_global_curated_out) so the enforced set and the hidden set can never diverge.
  • GET /v1/orgs/{id}/template-settings added (was PATCH-only) so the dashboard can read current state; the new flag is threaded through the PATCH request/response, repo accessors, and audit detail.

Dashboard

  • Org Settings → "Service catalog" card with three toggles: Make all global services available, Allow services outside the curated catalog, Allow user-defined templates.
  • Services → Catalog gains an admin-only per-global enable/disable curation grid (new CATALOG column) backed by GET /v1/templates/admin, active only when the org is in curated mode.

Tests

  • Integration coverage for the full matrix: settings GET/PATCH round-trip, admin-only gating, non-admin 403 on curated-out global, non-admin success on curated-in global, admin exemption, and soft-mode allow.
  • A real-stack screenshot script (dashboard/scripts/screenshot-curated-catalog.mjs) built on the scenarios library.

Screenshots

Org Settings → Service catalog (curated mode):

Org settings service catalog card

Services → Catalog curation grid (GitHub + Slack curated in, rest curated out):

Catalog curation grid

Verification

  • cargo test -p overslash-api --test templates — 25 passed (incl. 4 new curation tests).
  • cargo clippy, cargo fmt --check, svelte-check, dashboard strict build — all clean (pre-commit hook).
  • Real-stack e2e boot (make e2e-up) + screenshot script exercised both dashboard surfaces and the settings PATCH round-trip.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
overslash Ready Ready Preview, Comment Jul 7, 2026 9:31am

Request Review

Comment thread dashboard/src/lib/components/templates/TemplateCatalog.svelte
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.59091% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/overslash-api/src/routes/orgs.rs 89.28% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread dashboard/src/lib/components/templates/TemplateCatalog.svelte Outdated
…on gate

Org admins can already restrict the global template catalog to a curated
allow-list (`global_templates_enabled` + `enabled_global_templates`), but it
had no dashboard UI and was only enforced on discovery surfaces — a caller who
knew a curated-out key could still instantiate it.

Backend:
- New per-org `allow_services_outside_catalog` flag (migration 092, default
  false). When false, non-admins get 403 creating a service from a global
  template outside the curated catalog; when true, curated-out globals stay
  hidden from discovery but remain instantiable. Admins are always exempt.
- Enforce at instantiation in `kernel_create_service`, reusing the same
  allow-list filter as discovery (`is_global_curated_out`) so the two can't
  diverge.
- Add `GET /v1/orgs/{id}/template-settings` (was PATCH-only) and thread the new
  flag through the PATCH request/response, repo accessors, and audit detail.

Dashboard:
- Org Settings gains a "Service catalog" card with three toggles (make all
  global services available, allow services outside the curated catalog, allow
  user-defined templates).
- Services → Catalog gains an admin-only per-global enable/disable curation
  grid backed by `/v1/templates/admin`, active only in curated mode.

Tests + scenarios: integration coverage for the 403/soft/admin-exempt matrix
and settings round-trip; a real-stack screenshot script for both surfaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@angel-manuel angel-manuel force-pushed the feat/org-curated-catalogs branch from a9a4fe7 to 4cb6347 Compare July 7, 2026 09:31
@angel-manuel angel-manuel merged commit 95bcc3e into dev Jul 7, 2026
15 checks passed
@angel-manuel angel-manuel deleted the feat/org-curated-catalogs branch July 7, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant