Documentation
¶
Overview ¶
Package common holds helpers shared across oneauth examples — the seam where "every example needs this now" updates land in one place instead of N copy-paste edits.
Each example follows the same shape:
main.go — boots the auth server and resource server. With
--serve, binds them on real ports and blocks so any
external client can drive them. Default behavior
spins them up in-process and runs the walkthrough.
walkthrough.go — defines the demokit demo (the "client") that drives
the servers and prints the protocol exchange.
SetupRenderer wires the TUI renderer when --tui is passed; the default PlainRenderer stays in place otherwise. Examples should call this before demo.Execute().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOneAuthLogger ¶
NewOneAuthLogger returns the canonical demokit ColorLogger used across oneauth examples. The baseline rules tint:
- error= and ERROR markers (red)
- [http] → outbound HTTP requests (gray / dim blue)
- [http] ← inbound HTTP responses (cyan / blue)
- "minted" / "issued" token-mint events (bright green / green)
extraRules append to the baseline so callers can tint example-specific lines without losing the shared set.
func SetupRenderer ¶
SetupRenderer wires the renderer matching demokit's --mode (or the legacy --tui alias):
--mode=tui → tui.New() (Lipgloss boxes) --mode=notebook → notebookbridge.New() (cell-based UI) default → demokit's PlainRenderer
Types ¶
This section is empty.