MCPcopy Index your code
hub / github.com/github/github-mcp-server / Manager

Struct Manager

internal/oauth/manager.go:57–73  ·  view source on GitHub ↗

Manager owns the OAuth login flows and the resulting (refreshing) token for a single stdio session. It is safe for concurrent use; only one authorization flow runs at a time.

Source from the content-addressed store, hash-verified

55// single stdio session. It is safe for concurrent use; only one authorization
56// flow runs at a time.
57type Manager struct {
58 config Config
59 refreshConfig *oauth2.Config
60 logger *slog.Logger
61
62 // Test seams, set by NewManager to real implementations.
63 openURL func(string) error
64 inDocker func() bool
65
66 mu sync.Mutex
67 source oauth2.TokenSource // refreshing source, set once authorized
68 status flowStatus
69 pending *UserAction
70 done chan struct{}
71 lastErr error
72 refreshErrLogged bool // true once a refresh failure has been logged, reset on re-auth
73}
74
75// NewManager builds a Manager for the given configuration. A nil logger logs to
76// stderr.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected