a simple form application for review new user registration on Rauthy
  • Go 60.7%
  • Svelte 18.2%
  • Jsonnet 6.9%
  • TypeScript 5.5%
  • CSS 4.9%
  • Other 3.8%
Find a file
gobro d18a48ac9f
All checks were successful
ci/crow/push/test Pipeline was successful
ci/crow/push/docs Pipeline was successful
ci/crow/push/image Pipeline was successful
fix(build): set netrc_machine for git push auth
2026-07-08 09:31:05 -04:00
.crow fix(build): set netrc_machine for git push auth 2026-07-08 09:31:05 -04:00
cmd/server fix: public surface and stale provisioning status 2026-07-02 19:30:32 -04:00
deploy docs(book): add operator manual about administration 2026-07-08 00:08:51 -04:00
docs docs(book): add operator manual about administration 2026-07-08 00:08:51 -04:00
internal test: add rauthy integration test 2026-07-06 21:45:58 -04:00
migrations refactor: update the database schema and init migration 2026-06-21 18:13:04 -04:00
tools fix(build): error in docs build git push 2026-07-08 09:01:17 -04:00
web feat: configurable tos and rules 2026-07-03 16:30:33 -04:00
.dir-locals.el refactor: update the database schema and init migration 2026-06-21 18:13:04 -04:00
.dockerignore feat: minimal Crow CI pipeline 2026-07-06 00:59:41 -04:00
.env.example feat: add docker compose and image building 2026-07-03 16:31:36 -04:00
.envrc chore: tools direnv wrapper 2026-07-06 00:59:11 -04:00
.gitignore build(docs): add mdBook and Crow ci workflow to build docs 2026-07-07 00:33:45 -04:00
AGENTS.md feat(build): add sbom and cosign container signing 2026-07-07 18:53:44 -04:00
cosign.pub feat(build): add sbom and cosign container signing 2026-07-07 18:53:44 -04:00
docker-compose.yml feat: port new svelte site with go backend 2026-06-20 23:29:37 -04:00
Dockerfile feat: minimal Crow CI pipeline 2026-07-06 00:59:41 -04:00
flake.lock dev(flake): add crow-ci input for devshell and crow-cli tool 2026-07-06 21:51:35 -04:00
flake.nix build(docs): minor changes on documentation ci 2026-07-07 13:51:16 -04:00
go.mod feat: add go side backend code 2026-06-20 23:22:37 -04:00
go.sum feat: add go side backend code 2026-06-20 23:22:37 -04:00
LICENSE feat: add scaffholding starter code 2026-06-20 22:52:26 -04:00
package.json build(docs): add mdBook and Crow ci workflow to build docs 2026-07-07 00:33:45 -04:00
pnpm-lock.yaml tools: move tools/cli out from root workspace 2026-07-03 16:59:21 -04:00
pnpm-workspace.yaml tools: move tools/cli out from root workspace 2026-07-03 16:59:21 -04:00
README.md docs: add CI conventions, e2e design and ci badge 2026-07-06 21:52:08 -04:00

idp-register

Crow CI status

A small, self-hosted user-registration broker for an OIDC identity provider — the OIDC-era equivalent of Synapse's built-in registration tokens.

People apply through a public form. An invite code (limited by use-count and expiry) can auto-approve them; otherwise an admin reviews the application. On approval the service provisions the user into the target IdP (Rauthy today; Kanidm planned) and lets the IdP send a single "set your password / activate" email — which also verifies the address.

Built for a self-hosted stack (Matrix/Synapse + GoToSocial + Forgejo behind Rauthy), deployable as one OCI image behind Nginx/Cloudflare.

Two IdP roles (don't conflate them)

  • Admin-auth IdP — where admins log in. A standards-only OIDC Relying Party; never assumes provider-specific APIs.
  • Provisioning target IdP — where end users are created. Hidden behind a Provisioner interface; provider-specific code is isolated.

Status

⚠️ In progress. The Go backend (cmd/, internal/) is implemented and the SvelteKit frontend has been ported to web/ (adapter-static, embedded via go:embed). CI/CD and some hardening remain. Treat the docs as the source of truth.

Stack: Go backend · SvelteKit frontend (adapter-static, built into internal/web/assets and embedded via go:embed) · database/sql over SQLite or PostgreSQL · generic OIDC admin login · plaintext Synapse-style invite codes · GPLv3-or-later.

Documentation

  • AGENTS.md — context & hard invariants for AI agents and developers (read first).
  • docs/ARCHITECTURE.md — system design, flows, data model.
  • docs/DECISIONS.md — architecture decision records (the why).
  • docs/DATABASE.md — supported DB baselines, fresh-deploy policy, and manual backend-switching notes.
  • docs/SCHEMA.md — logical schema and SQLite/PostgreSQL type mapping.
  • docs/DEPLOYMENT.md — deployment modes (all-in-one / API-only / standalone static frontend) and the three future CI build targets.

Features (target)

  • Public application form: optional fields, deployer-configurable registration rules and ToS consent (FORM_RULES_TEXT / FORM_RULES_FILE / FORM_TERMS_URL), Cloudflare Turnstile, optional invite code.
  • Invite codes: use-count + expiry + manual disable; auto-approve on valid code (Synapse uses_allowed / pending / completed / expiry_time semantics).
  • Admin review panel (OIDC-protected): mint/list/disable codes, review/approve/reject applications.
  • Provisioning into the target IdP with safe retry on failure; server-side permission profiles map to IdP groups (public input never sets groups directly).
  • One user-facing email on the happy path (the IdP activation link).
  • Admin action audit log.

Development

The frontend (web/, a SvelteKit SPA) builds straight into internal/web/assets, which the Go binary embeds via //go:embed all:assets. Copy .env.example to .env and fill it in.

# Frontend dev (hot reload on :5173, proxies /api + /auth to the Go server on :8080)
pnpm install
pnpm --filter idp-register-web dev      # or: pnpm dev

# Run the Go backend (serves the embedded SPA + JSON API on :8080)
go run ./cmd/server

# Production build: build the SPA, then the binary embeds it
pnpm --filter idp-register-web build    # writes internal/web/assets
CGO_ENABLED=0 go build -o idp-register ./cmd/server

# Or build the single OCI image (Node → Go → distroless, multi-stage)
docker build -t idp-register .

# Tests (store layer; SQLite in-memory by default)
go test ./...

The embedded assets are generated and git-ignored; internal/web/assets/.gitkeep keeps the Go package compiling before the first frontend build. See AGENTS.md for the full layout.

License

GPL-3.0-or-later. Every source file carries an SPDX header.