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

Function newManager

internal/oauth/manager_test.go:18–30  ·  view source on GitHub ↗

newManager wires a Manager to the fake GitHub server. By default the browser auto-opens (driving the callback) and Docker detection is off.

(t *testing.T, f *fakeGitHub)

Source from the content-addressed store, hash-verified

16// newManager wires a Manager to the fake GitHub server. By default the browser
17// auto-opens (driving the callback) and Docker detection is off.
18func newManager(t *testing.T, f *fakeGitHub) *Manager {
19 t.Helper()
20 cfg := Config{
21 ClientID: "client-id",
22 ClientSecret: "client-secret",
23 Scopes: []string{"repo"},
24 Endpoint: f.endpoint(),
25 }
26 m := NewManager(cfg, testLogger())
27 m.openURL = browserGet
28 m.inDocker = func() bool { return false }
29 return m
30}
31
32func TestAuthenticatePKCEViaBrowser(t *testing.T) {
33 f := newFakeGitHub(t)

Calls 3

NewManagerFunction · 0.85
testLoggerFunction · 0.85
endpointMethod · 0.80

Tested by

no test coverage detected