Documentation
¶
Overview ¶
Package pairing implements device-code secrets and transitions independently of HTTP, storage, and credential issuance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flow ¶
type Flow struct {
State State
Subject string
CreatedAt time.Time
ExpiresAt time.Time
NextPoll time.Time
Interval time.Duration
}
Flow owns the decision and polling state for one request. Callers synchronize access and atomically persist or consume it together with their own records. No callbacks run here. Browser login reserves a decision across its audit; OAuth reserves and finishes within its durable transaction.
func New ¶
New creates a ten-minute pending request. A positive interval enforces polling cadence and cumulative five-second slow_down. Zero leaves cadence enforcement to the adapter's existing rate limiter.
func (*Flow) Finish ¶
Finish commits a reserved decision, or restores pending when its audit failed. Expiry prevents a blocked audit from resurrecting a request. The caller also checks that its reservation still belongs to the stored request.