MCPcopy
hub / github.com/github/github-mcp-server / FetchTokenScopes

Function FetchTokenScopes

pkg/scopes/fetcher.go:124–131  ·  view source on GitHub ↗

FetchTokenScopes is a convenience function that creates a default fetcher and fetches the token scopes.

(ctx context.Context, token string)

Source from the content-addressed store, hash-verified

122// FetchTokenScopes is a convenience function that creates a default fetcher
123// and fetches the token scopes.
124func FetchTokenScopes(ctx context.Context, token string) ([]string, error) {
125 apiHost, err := utils.NewAPIHost("https://api.github.com/")
126 if err != nil {
127 return nil, fmt.Errorf("failed to create default API host: %w", err)
128 }
129
130 return NewFetcher(apiHost, FetcherOptions{}).FetchTokenScopes(ctx, token)
131}
132
133// FetchTokenScopesWithHost is a convenience function that creates a fetcher
134// for a specific API host and fetches the token scopes.

Callers

nothing calls this directly

Calls 3

NewAPIHostFunction · 0.92
NewFetcherFunction · 0.85
FetchTokenScopesMethod · 0.65

Tested by

no test coverage detected