Documentation
¶
Overview ¶
Package authsession holds the UI-side domain logic for the SSO session-extend feature. The Wails facades in client/ui/services/session*.go are thin adapters over these types.
Index ¶
Constants ¶
const ( MetaWarning = sessionwatch.MetaSessionWarning MetaFinal = sessionwatch.MetaSessionFinal MetaExpiresAt = sessionwatch.MetaSessionExpiresAt MetaLeadMinutes = sessionwatch.MetaSessionLeadMinutes MetaDeadlineRejected = sessionwatch.MetaSessionDeadlineRejected )
Re-exported from sessionwatch so UI-side consumers don't import the daemon-internal package directly.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DaemonConn ¶
type DaemonConn interface {
Client() (proto.DaemonServiceClient, error)
}
DaemonConn duplicates services.DaemonConn to avoid an import cycle.
type ExtendResult ¶
type ExtendResult struct {
ExpiresAt *time.Time `json:"sessionExpiresAt,omitempty"`
Preempted bool `json:"preempted,omitempty"`
}
ExtendResult: ExpiresAt is nil when the peer is ineligible for extension. Preempted means a newer WaitExtend took over the IdP poll — a no-op, not a failure.
type ExtendStartParams ¶
type ExtendStartParams struct {
// Hint is the OIDC login_hint, typically the user's email.
Hint string `json:"hint"`
}
type ExtendStartResult ¶
type ExtendWaitParams ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session bundles the session-auth daemon RPCs the UI drives.
func NewSession ¶
func NewSession(conn DaemonConn) *Session
func (*Session) DismissWarning ¶
DismissWarning suppresses the daemon's T-FinalWarningLead fallback dialog for the current deadline. Best-effort: a stale call is silently swallowed daemon-side.
func (*Session) RequestExtend ¶
func (s *Session) RequestExtend(ctx context.Context, p ExtendStartParams) (ExtendStartResult, error)
RequestExtend starts the SSO session-extension flow on the daemon.
func (*Session) WaitExtend ¶
func (s *Session) WaitExtend(ctx context.Context, p ExtendWaitParams) (ExtendResult, error)
WaitExtend blocks until the user completes the SSO flow started by RequestExtend.
type Warning ¶
type Warning struct {
// Absolute UTC deadline; best-effort, stays zero when metadata is
// missing or malformed (e.g. an older daemon) and the UI falls back
// to the Status snapshot.
ExpiresAt time.Time `json:"sessionExpiresAt"`
// Configured lead time, so the UI need not hardcode the constant.
LeadMinutes int `json:"leadMinutes"`
// True on the final-warning fallback event.
Final bool `json:"final"`
}
Warning is the typed payload emitted on the session-warning Wails events.