MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / blockingCountingOAuthHandler

Struct blockingCountingOAuthHandler

mcp/streamable_client_test.go:1027–1030  ·  view source on GitHub ↗

blockingCountingOAuthHandler is an OAuthHandler that blocks inside Authorize until the caller's context is cancelled, then returns a custom error that does NOT wrap context.Canceled. This mirrors real-world OAuth handlers that catch the cancellation internally and surface their own error type. The f

Source from the content-addressed store, hash-verified

1025// relying on the error from Authorize, so this must still trigger c.fail().
1026// It records how many times Authorize is invoked.
1027type blockingCountingOAuthHandler struct {
1028 mu sync.Mutex
1029 callCount int
1030}
1031
1032func (h *blockingCountingOAuthHandler) TokenSource(ctx context.Context) (oauth2.TokenSource, error) {
1033 return nil, nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected