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

Function NewManager

internal/oauth/manager.go:77–89  ·  view source on GitHub ↗

NewManager builds a Manager for the given configuration. A nil logger logs to stderr.

(cfg Config, logger *slog.Logger)

Source from the content-addressed store, hash-verified

75// NewManager builds a Manager for the given configuration. A nil logger logs to
76// stderr.
77func NewManager(cfg Config, logger *slog.Logger) *Manager {
78 if logger == nil {
79 logger = slog.New(slog.NewTextHandler(os.Stderr, nil))
80 }
81 m := &Manager{
82 config: cfg,
83 logger: logger,
84 openURL: openBrowser,
85 inDocker: isRunningInDocker,
86 }
87 m.refreshConfig = m.oauth2Config("")
88 return m
89}
90
91// AccessToken returns a currently valid access token, refreshing it if needed,
92// or "" if the session is not authorized (or a refresh has failed and

Callers 2

newManagerFunction · 0.85

Calls 1

oauth2ConfigMethod · 0.95

Tested by 2

newManagerFunction · 0.68