Phase 2: Tenants + Identity + Licensing #24

Closed
opened 2026-03-30 09:23:42 +02:00 by claude · 0 comments
Owner

Overview

Integrate Logto as identity provider, add tenant and license management, set up Traefik reverse proxy, and deliver a Docker Compose production stack.

Architecture decision (2026-04-04): Custom user-facing auth (AuthController, AuthService) replaced by Logto OIDC. Ed25519 JWT retained for machine tokens only (agent bootstrap, license signing). See docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md.

Depends On

  • Phase 1 (#14-#23) Complete
  • #2 (Identity & Access Management — now Logto-based)
  • #7 (License & Feature Gating)

Key Deliverables

  • Logto integration — OIDC identity provider for all user-facing auth (login, registration, SSO, teams/orgs, MFA)
  • Tenant entity + CRUD API — always multi-tenant (Docker = 1 tenant, K8s = N tenants)
  • Logto organizations — 1:1 mapping to tenants, Logto Management API client for org provisioning
  • License token generation — Ed25519-signed JWT with tier, features, limits, expiry
  • License APIPOST /api/tenants/{id}/license (generate), GET /api/tenants/{id}/license (fetch active)
  • Traefik integration — ForwardAuth middleware for tenant-aware routing
  • Docker Compose production stack — 6 containers: Traefik, cameleer-saas, Logto, cameleer3-server, PostgreSQL, ClickHouse
  • Externalize Ed25519 keys — file-based loading instead of per-boot generation
  • Security refactor — Spring Security OAuth2 Resource Server for Logto OIDC + custom filter for machine tokens

Build-vs-Buy Decisions

Component Decision Tool
User-facing auth BUY Logto (MPL-2.0, 2 containers, ~0.5-1 GB)
Reverse proxy BUY Traefik v3 (MIT, native Docker + K8s)
License signing BUILD Custom Ed25519 JWT (core IP)
Tenant lifecycle BUILD Custom CRUD + Logto org sync

Removed from Scope (vs original)

  • Custom OIDC implementation → Logto provides this
  • Custom team management → Logto organizations handle this
  • Custom invite flow → Logto handles this
  • Custom password reset → Logto handles this

Implementation Plan

docs/superpowers/plans/2026-04-04-phase-2-tenants-identity-licensing.md — 12 tasks

PRD Reference

Sections 4 (Data Architecture — tenants), 5 (IAM — now Logto), 10 (License & Feature Gating)
Superseded by: docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md

## Overview Integrate Logto as identity provider, add tenant and license management, set up Traefik reverse proxy, and deliver a Docker Compose production stack. > **Architecture decision (2026-04-04):** Custom user-facing auth (AuthController, AuthService) replaced by Logto OIDC. Ed25519 JWT retained for machine tokens only (agent bootstrap, license signing). See `docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md`. ## Depends On - Phase 1 (#14-#23) ✅ Complete ## Related Epics - #2 (Identity & Access Management — now Logto-based) - #7 (License & Feature Gating) ## Key Deliverables - **Logto integration** — OIDC identity provider for all user-facing auth (login, registration, SSO, teams/orgs, MFA) - **Tenant entity + CRUD API** — always multi-tenant (Docker = 1 tenant, K8s = N tenants) - **Logto organizations** — 1:1 mapping to tenants, Logto Management API client for org provisioning - **License token generation** — Ed25519-signed JWT with tier, features, limits, expiry - **License API** — `POST /api/tenants/{id}/license` (generate), `GET /api/tenants/{id}/license` (fetch active) - **Traefik integration** — ForwardAuth middleware for tenant-aware routing - **Docker Compose production stack** — 6 containers: Traefik, cameleer-saas, Logto, cameleer3-server, PostgreSQL, ClickHouse - **Externalize Ed25519 keys** — file-based loading instead of per-boot generation - **Security refactor** — Spring Security OAuth2 Resource Server for Logto OIDC + custom filter for machine tokens ## Build-vs-Buy Decisions | Component | Decision | Tool | |-----------|----------|------| | User-facing auth | **BUY** | Logto (MPL-2.0, 2 containers, ~0.5-1 GB) | | Reverse proxy | **BUY** | Traefik v3 (MIT, native Docker + K8s) | | License signing | **BUILD** | Custom Ed25519 JWT (core IP) | | Tenant lifecycle | **BUILD** | Custom CRUD + Logto org sync | ## Removed from Scope (vs original) - ~~Custom OIDC implementation~~ → Logto provides this - ~~Custom team management~~ → Logto organizations handle this - ~~Custom invite flow~~ → Logto handles this - ~~Custom password reset~~ → Logto handles this ## Implementation Plan `docs/superpowers/plans/2026-04-04-phase-2-tenants-identity-licensing.md` — 12 tasks ## PRD Reference Sections 4 (Data Architecture — tenants), 5 (IAM — now Logto), 10 (License & Feature Gating) Superseded by: `docs/superpowers/specs/2026-04-04-dual-deployment-architecture.md`
claude added the authlicensingphase-2 labels 2026-03-30 09:24:43 +02:00
claude changed title from Phase 2: Tenants + Licensing to Phase 2: Tenants + Identity + Licensing 2026-04-04 14:39:33 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cameleer/cameleer-saas#24