mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-18 04:29:54 +00:00
Shorten over-long godoc/inline comments across the client/ui tray and services code: drop narrative restatement, legacy-Fyne tangents, and text already evident from signatures and names. Keep only the non-obvious why (concurrency/lock ordering, platform quirks, ordering constraints, the profile-switch state table). No code changes.
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
//go:build !android && !ios && !freebsd && !js
|
|
|
|
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/netbirdio/netbird/client/ui/authsession"
|
|
)
|
|
|
|
// Re-exports so generated bindings reference services.* without importing authsession.
|
|
type (
|
|
ExtendStartParams = authsession.ExtendStartParams
|
|
ExtendStartResult = authsession.ExtendStartResult
|
|
ExtendWaitParams = authsession.ExtendWaitParams
|
|
ExtendResult = authsession.ExtendResult
|
|
)
|
|
|
|
// Session wraps authsession.Session, exposing only the subset the React frontend
|
|
// calls; the tray uses authsession.Session directly, keeping the generated TS surface minimal.
|
|
type Session struct {
|
|
inner *authsession.Session
|
|
}
|
|
|
|
// NewSession wraps inner; the caller retains ownership and may use it directly.
|
|
func NewSession(inner *authsession.Session) *Session {
|
|
return &Session{inner: inner}
|
|
}
|
|
|
|
// RequestExtend starts the SSO session-extension flow; the result carries the verification URI to open.
|
|
func (s *Session) RequestExtend(ctx context.Context, p ExtendStartParams) (ExtendStartResult, error) {
|
|
return s.inner.RequestExtend(ctx, p)
|
|
}
|
|
|
|
// WaitExtend blocks until the RequestExtend flow completes; the deadline is nil when the peer is ineligible.
|
|
func (s *Session) WaitExtend(ctx context.Context, p ExtendWaitParams) (ExtendResult, error) {
|
|
return s.inner.WaitExtend(ctx, p)
|
|
}
|