Documentation
¶
Index ¶
Constants ¶
const ( KindNone = "none" KindConsole = "console" KindKey = "key" )
Variables ¶
This section is empty.
Functions ¶
func ServeLoopback ¶ added in v0.6.0
func ServeLoopback(ln net.Listener, path, title string, callback func(context.Context, string) error)
ServeLoopback owns the HTTP transport on an already-bound loopback listener. Provider callbacks receive protocol input only; errors preserve the 400 contract.
func ServeLoopbackRoutes ¶ added in v0.7.35
func ServeLoopbackRoutes(ln net.Listener, routes []LoopbackRoute)
ServeLoopbackRoutes is ServeLoopback for a listener that answers more than one path. One listener can only be served once, so the routes share it.
Types ¶
type Identity ¶ added in v0.2.21
type Identity struct {
Kind string
KeyID string
Name string
AllowedProviders []string
// MaxInFlight caps concurrent /v1 chat requests for a named key. Zero
// means unlimited. Console traffic is never capped.
MaxInFlight int
}
func ConsoleIdentity ¶ added in v0.2.21
func ConsoleIdentity() Identity
func KeyIdentity ¶ added in v0.2.21
func (Identity) AllowsProvider ¶ added in v0.2.21
AllowsProvider answers the family-level grant question. The helpers live on accounts (Pool wrappers around grants.go) so this package does not import grant parsing and accounts does not import auth.
func (Identity) AllowsProviderRegion ¶ added in v0.5.1
AllowsProviderRegion reports whether a concrete account — family plus region — is covered by the key allowlist. This is the fail-closed gate for routing candidates; AllowsProvider only answers the family-level question.
type LoopbackRoute ¶ added in v0.7.35
LoopbackRoute is one path a loopback listener accepts. A provider that gets two redirects on the same port (Kiro's Microsoft sign-in does) registers both here instead of building its own server.
type Verifier ¶ added in v0.2.1
type Verifier struct {
// contains filtered or unexported fields
}
func NewVerifier ¶ added in v0.2.1
func (Verifier) Authenticate ¶ added in v0.2.21
func (Verifier) ConsoleKey ¶ added in v0.6.0
ConsoleKey reads the shared live key. Copies of Verifier share this state.
func (Verifier) SetConsoleKey ¶ added in v0.6.0
SetConsoleKey rotates a verifier created by NewVerifier without replacing the verifier copies already held by HTTP handlers.