Documentation
¶
Overview ¶
Package ui is the central UI service: a single pane of glass over the tier serves. It is a stateless aggregator — no domain state of its own — with Google OAuth login for humans (encrypted session cookie; the SPA never sees tokens) and Google OIDC service identity toward the tier serves. Routing and shapes for its JSON API come from api/ui.openapi.yaml (internal/uiapi).
Index ¶
Constants ¶
const SessionCookie = "tfsp_ui_session"
SessionCookie is the browser session cookie name (also named as the security scheme in api/ui.openapi.yaml).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the central UI HTTP service.
type Config ¶
type Config struct {
PublicBaseURL string // external base; the OAuth redirect URI is <base>/auth/callback
SessionSecret string
// GitHubWebhookSecret optionally verifies GitHub App webhook deliveries
// at the relay before fan-out (defense in depth — each serve verifies the
// HMAC itself either way; empty forwards blindly).
GitHubWebhookSecret string
AllowedDomain string // required id_token hd claim, lowercase
// OAuth is the Google authorization-code client. Endpoint is overridable
// so tests run against a fake token server.
OAuth *oauth2.Config
// QuotaProject rides x-goog-user-project on user-token PAM calls (user
// credentials attribute API quota to the OAuth client's project; empty
// sends no header). PAMBaseURL overrides the PAM endpoint for tests.
QuotaProject string
PAMBaseURL string
// VerifyIDToken validates the id_token from the code exchange and returns
// its claims (signature + audience checked; claim semantics enforced by
// the login handler). Injectable for offline tests.
VerifyIDToken gauth.VerifyClaimsFunc
Tiers []Tier
}
Config carries the wiring the ui face resolves from the `ui {}` block and its env-var secrets.
type Session ¶
Session is the server-side state carried by the encrypted cookie — identity only, no tokens (the SPA never sees Google credentials, and the UI backend stores none).
func SessionFrom ¶
SessionFrom returns the verified session riding the request context (zero value outside sessionAuth-guarded routes).