ui

package
v0.7.9-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package ui is the server's own browser surface, served by agentryd at /ui/: the device-authorize page the CLI and the desktop app open, and, without a site in front, the hand-off to the deployment's OpenID provider, sign-out and the page an activation link opens. Everything else a person does is the API's, through the CLI, the desktop app or a site.

It is deliberately plain: server-rendered html/template, no JavaScript, one stylesheet, brand from config. Every page acts through the API's own handlers in-process with the browser's cookies (client.go), so a page can do nothing the API would refuse and the authorization matrix stays the only one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opt Options) http.Handler

New returns the handler to mount at /ui/.

Types

type Brand

type Brand struct {
	Name          string
	LogoURL       string
	CSSURL        string
	SupportEmail  string
	SecurityEmail string
	PrivacyURL    string
	TermsURL      string
}

Brand is what the pages call this deployment and where they send people.

type Options

type Options struct {
	// API is the server's full handler chain (middleware included); every
	// page call goes through it in-process.
	API http.Handler
	// Mode is config ui.mode: full or authorize (off is never mounted).
	Mode string
	// SiteURL is config web.url: when set, sign-in is the site's, and only
	// the authorize page is served here.
	SiteURL string
	// BaseURL is the server's public origin (for absolute links); may be "".
	BaseURL string
	Brand   Brand
	// Providers are the configured sign-in providers, in display order.
	Providers []Provider
	// IdPLogoutURL, when set, is where sign-out sends the browser after the
	// session is revoked (the directory's end-session flow).
	IdPLogoutURL string
	CookieSecure bool
	// TrustProxy reports whether a request reached the server through a
	// reverse proxy whose forwarded headers it believes (config
	// http.trustedProxies and http.trustedProxyCIDRs). Only then is
	// X-Forwarded-Host taken as the address the browser used; nil trusts
	// no proxy.
	TrustProxy func(*http.Request) bool
	Log        *slog.Logger
}

Options wires the surface to the server.

type Provider

type Provider struct {
	ID    string
	Label string
}

Provider is the sign-in provider the login page offers (config auth.oidc).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL