Commit Graph

35 Commits

Author SHA1 Message Date
9d11ee0328 Add member-console demo seeder with person seeding
Add a `seed-demo` subcommand (cmd/seed_demo.go + internal/demoseed/)
that inserts a fixed reference catalog into the member-console DB so
the operator panel has rows to walk through for UX research. Catalog:
6 demo-* products (4 by product_type + 2 extra plans), 1 plan ladder
with 3 tiers, 1 entitlement set with 2 rules (limit + boolean), and 1
grant on Alice's personal org (once she's logged in).

Person rows for bob/carlos/diana are seeded via provisioning.AutoProvision
keyed on the pinned Keycloak UUIDs — no longer fragile now that
seed-keycloak.sh's partialImport switch preserves the pinned id. Alice
is intentionally NOT pre-seeded so the lazy-creation OIDC flow stays
exercised on every fresh stack.

Idempotency: list+filter by `name` for catalog rows, by `oidc_subject`
for persons. Re-running is a no-op for created rows; warns + skips
the grant if alice hasn't logged in yet.

Host-side invocation only — run `./test/seed-demo.sh` after
bootstrap-stack.sh. Mirrors how member-console itself runs on the
host (config + secrets live under test/).

Two OpenSpec changes folded in: 2026-05-10-member-console-demo-seeder
(the seeder) and 2026-05-11-demo-seeder-persons (the persons follow-up
unlocked by the Keycloak fix).
2026-05-11 10:55:14 -05:00
dbde5bd59f Fix Keycloak test seed user-id pinning
POST /admin/realms/{realm}/users silently drops the `id` field on
Keycloak 26.x. Switch user creation in seed-keycloak.sh to
POST /admin/realms/{realm}/partialImport, which preserves the pinned
id (verified by round-trip). This restores deterministic UUIDs for
alice/bob/carlos/diana and unblocks downstream consumers that depend
on stable `sub` claims (FedWiki owner.json references, demo seeder
person rows).
2026-05-11 10:55:14 -05:00
535810c2ef Seed FedWiki fixtures from Keycloak
Add a fedwiki-render compose service and render.sh to resolve real
Keycloak user UUIDs and render .tpl templates into testdata on compose
up.
Convert hardcoded FedWiki testdata into templates, add seed-stack.sh
helper,
and update compose/env and .gitignore to run seeding before starting
fedwiki.
2026-04-29 15:55:40 -05:00
66c8d84a2c worktree test stacks isolation. 2026-04-29 03:28:43 -05:00
043f4082dc Unify test startup, slug derivation, teardown
Use the unified ./cmd entrypoint in test docs and bootstrap scripts
instead of ./cmd/member-console. Add derive_slug to pick a more
informative SLUG for worktrees (prefer parent dir or branch when the
basename is "member-console"). Improve teardown to remove root-owned
test files via a short-lived docker container fallback.
2026-04-28 23:25:17 -05:00
a50084aee5 Add per-worktree test stack bootstrap and docs 2026-04-28 23:16:03 -05:00
751bae7768 Use plan ladder for org defaults
Add default_plan_ladder_id with a forward data migration and update
the runtime to resolve the ladder's rank-0 tier at use-time. Regenerate
sqlc, update auto-provisioning, ReapplyDefaultsForPool, operator UI and
tests; add GetTierByLadderRank and pool/provision query helpers. Add a
CSP-safe confirm-action modal and wire operator actions to it. Close
plan-sole-writer safety gaps and serialize IssueGrant with a FOR UPDATE
pool lock to prevent ladder races.
2026-04-27 01:57:17 -05:00
8f6a93f74d Add operator enrollment UI and plan docs
Introduce operator enrollment partials and handlers that route plan-tier
granting and revocation through entitlements.Transition(). Add
member-facing
tier labels, plan architecture and grant-plan-safety documentation, plus
unit and e2e tests. Also add small querier helpers and wire Temporal
client
hooks for trial expiration scheduling.
2026-04-24 12:28:00 -05:00
eaa69e525f Local secrets management. 2026-04-05 00:22:06 -05:00
3d602c0601 Add billing accounts and Stripe customer sync 2026-04-04 04:08:23 -05:00
3aad9268df Stripe Billing Plumbing 2026-04-03 19:25:24 -05:00
9db333f1e0 Use testdata/ for test fixtures
gopls ignores the testdata directory
2026-04-03 18:40:43 -05:00
6330ae7a42 Grants management! 2026-03-24 17:35:14 -05:00
f737dd0314 Identity and organization modules. 2026-03-23 17:28:14 -05:00
6f9b0c221c remove test data noise 2026-03-21 13:36:52 -05:00
5b7c2c6d2d Use session key constants and typed accessors. Fixes issues with
previous commit.
2026-02-02 22:37:06 -06:00
ddb206f7ac Use Valkey for server-side session storage with SCS. 2026-02-02 22:19:22 -06:00
2d579b377c Move from sqlite to postgres. 2026-02-02 22:19:16 -06:00
1860ec6068 feat: Implement operator dashboard with user, site, and payment management views. 2026-01-17 15:56:22 -06:00
b1282c7488 Make site ownership work correctly for fucks sake. 2026-01-01 22:07:11 -06:00
c07487e324 Implement FedWiki site synchronization workflow and related configurations 2025-12-29 19:24:52 -06:00
0751e71f3c Add error handling for HTMX requests with toast notifications 2025-12-28 16:16:37 -06:00
98b5cee5a7 Create site flow now assigns ownership correctly. FedWiki access token issues are now not retryable. 2025-12-27 17:57:21 -06:00
8512f368fb Implement Temporal OAuth2 authentication support and configuration 2025-12-24 16:46:54 -06:00
9865302536 Switch Temporal start-dev with full-blown Temporal to test auth. 2025-12-23 03:23:57 -06:00
cc30219e1c Documentation 2025-12-19 15:47:32 -06:00
b9ccae5929 Refactor FedWiki site management UI and error handling; enhance user feedback for site creation and deletion processes. 2025-12-18 16:09:58 -06:00
74002e424f Rough FedWiki Site management through temporal workflows! 2025-12-18 01:05:55 -06:00
5efa9ba71a database creation was acting weird. Now works fine? 2025-12-14 05:01:03 -06:00
9009c3f133 Add Temporal workflows scaffolding and documentation. 2025-12-13 16:42:07 -06:00
c54a1f8d9a Rename hostname to base-url for accuracy 2025-05-18 18:32:26 -05:00
ed00e1150f Refactor OIDC configuration keys for consistency and clarity 2025-05-18 17:48:51 -05:00
4d29a58f94 Set the stage for using embeds for files served by the mc-server. 2025-05-09 03:14:40 -05:00
f0fc18ab7f Very minimal development compose setup for Keycloak. 2025-02-20 18:48:10 -06:00
f8d7daf96b Fix port flag, add env prefix, and start writing the keycloak compose file. 2025-02-20 02:39:26 -06:00