Documentation
¶
Overview ¶
Package oauth provides manual OAuth token refresh helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderResult ¶
ProviderResult holds per-provider/account refresh outcome.
type RefreshOptions ¶
type RefreshOptions struct {
// Provider is the OAuth provider name (e.g. "google", "github").
// Empty when --all is set.
Provider string
// AccountID scopes the refresh to a single account.
// Empty means refresh all accounts for the provider.
AccountID string
// All refreshes all providers.
All bool
// BaseURL is the nSelf API base URL.
BaseURL string
// Stdout/Stderr for output.
Stdout io.Writer
Stderr io.Writer
// HTTPClient allows injection in tests.
HTTPClient *http.Client
}
RefreshOptions holds parsed flags for oauth refresh.
type RefreshResult ¶
type RefreshResult struct {
Results []ProviderResult
FailCount int
}
RefreshResult aggregates all per-provider results.
func Refresh ¶
func Refresh(ctx context.Context, opts RefreshOptions) (*RefreshResult, error)
Refresh triggers immediate OAuth token refresh outside the cron schedule.
--all refreshes every account on every provider in parallel. Success/failure is visible in the OAuth refresh Prometheus metrics within 5s (requires S41-T03 exporter). OAuth tokens are never exposed in output (only prefix match in logs). Exit non-zero if any account fails.
Click to show internal directories.
Click to hide internal directories.