Wire founding override enforcement (TTL guard, periodic sweep, second- master auto-revoke, manual revocation) and replace the approve stub with a real Ed25519 signing flow through two bootstrap modes (self-sovereign and partner-hosted with Guildhouse as default partner). Pipeline now pauses at awaiting_approval, returns schematic_hash for the signer, and resumes via POST /api/approvals webhook. HostingAgreement table + HostingCeremony module support partner-hosted onboarding with auto-ratification for Guildhouse-as-partner. 70 tests, 0 failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Tyler J King <tking@guildhouse.dev>
59 lines
1.8 KiB
Elixir
59 lines
1.8 KiB
Elixir
defmodule GuildhallWeb.Router do
|
|
use GuildhallWeb, :router
|
|
|
|
import GuildhallWeb.Plugs.Auth, only: [fetch_current_user: 2]
|
|
|
|
pipeline :browser do
|
|
plug :accepts, ["html"]
|
|
plug :fetch_session
|
|
plug :fetch_live_flash
|
|
plug :put_root_layout, html: {GuildhallWeb.Layouts, :root}
|
|
plug :protect_from_forgery
|
|
plug :put_secure_browser_headers
|
|
plug :fetch_current_user
|
|
end
|
|
|
|
pipeline :api do
|
|
plug :accepts, ["json"]
|
|
end
|
|
|
|
# Public auth routes (no auth required)
|
|
scope "/auth", GuildhallWeb do
|
|
pipe_through :browser
|
|
|
|
get "/login", AuthController, :login
|
|
get "/callback", AuthController, :callback
|
|
get "/logout", AuthController, :logout
|
|
end
|
|
|
|
# Authenticated LiveView routes
|
|
scope "/", GuildhallWeb do
|
|
pipe_through :browser
|
|
|
|
live_session :authenticated, on_mount: {GuildhallWeb.AuthHooks, :require_auth} do
|
|
live "/", DashboardLive, :index
|
|
live "/ceremonies", CeremonyLive.Index, :index
|
|
live "/artifacts", ArtifactLive.Index, :index
|
|
live "/guilds", GuildLive.Index, :index
|
|
live "/guilds/register", GuildLive.Register, :new
|
|
live "/guilds/:slug", GuildLive.Show, :show
|
|
live "/guilds/:slug/schematic", GuildLive.Schematic, :schematic
|
|
live "/guilds/:slug/realization", GuildLive.Realization, :realization
|
|
live "/guilds/:slug/join", GuildLive.Join, :join
|
|
live "/guilds/:slug/members", GuildLive.Members, :members
|
|
end
|
|
end
|
|
|
|
# Machine-to-machine API endpoints (bearer token auth)
|
|
scope "/api", GuildhallWeb do
|
|
pipe_through :api
|
|
post "/approvals", ApprovalController, :create
|
|
post "/hosting-agreements/:id/ratify", HostingAgreementController, :ratify
|
|
end
|
|
|
|
# Health check endpoint for Kubernetes probes + LB targets.
|
|
scope "/health", GuildhallWeb do
|
|
pipe_through :api
|
|
get "/", HealthController, :check
|
|
end
|
|
end
|