Implements the full founding-guild onboarding stack across four phases: Phase A — Keycloak OIDC auth pipeline (oidcc) + guild registration with ceremony-engine approval (SingleApproval, hub operator approves via gRPC). Phase B — Founding schematic templates (MSP/ISV/NSP TOML), gRPC clients for ceremony-service and ffc-schematic-server, schematic fork/bind/realize LiveView with DB audit trail in guild_schematics. Phase C — RealizationPoller GenServer polling realization status every 5s, PubSub broadcast, live realization dashboard showing 7 reconciler sections. Phase D — Self-service member onboarding (join request → guild master approval via ceremony), member management LiveView, auto-create guild master on guild approval via Ecto.Multi transaction. Includes K8s manifests for ceremony-service (port 50053) and ffc-schematic-server (port 9091) as ClusterIP services, plus updated guildhall deployment with OIDC and gRPC service URL env vars. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Tyler J King <tking@guildhouse.dev>
24 lines
536 B
Elixir
24 lines
536 B
Elixir
defmodule GuildhallWeb.Plugs.Auth do
|
|
@moduledoc false
|
|
import Plug.Conn
|
|
import Phoenix.Controller
|
|
|
|
def init(opts), do: opts
|
|
|
|
def call(conn, _opts) do
|
|
case get_session(conn, :current_user) do
|
|
nil ->
|
|
conn
|
|
|> put_flash(:error, "Please sign in to continue.")
|
|
|> redirect(to: "/auth/login")
|
|
|> halt()
|
|
|
|
user ->
|
|
assign(conn, :current_user, user)
|
|
end
|
|
end
|
|
|
|
def fetch_current_user(conn, _opts) do
|
|
assign(conn, :current_user, get_session(conn, :current_user))
|
|
end
|
|
end
|