Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BearerAuthTransport ¶
type BearerAuthTransport struct {
Transport http.RoundTripper
Token string
// TokenProvider, when non-nil, supplies the bearer token for each request
// and takes precedence over Token.
TokenProvider func() string
// AllowedHosts, when non-empty, restricts the hosts the Authorization
// header is attached to. The token is set only when the request host
// and port exactly match one of these entries (case-insensitive). This
// scopes the credential to the configured GitHub hosts, so that if a
// response redirects off them the token is not carried to the redirect
// target.
//
// net/http strips a cross-host Authorization header when it follows a
// redirect, but only for headers set on the initial request. This
// transport re-adds the header on every hop, so that protection does not
// otherwise apply here.
//
// When empty, the token is attached to every request, preserving the
// prior behavior.
AllowedHosts []string
}
type GraphQLFeaturesTransport ¶
type GraphQLFeaturesTransport struct {
// Transport is the underlying HTTP transport. If nil, http.DefaultTransport is used.
Transport http.RoundTripper
}
GraphQLFeaturesTransport is an http.RoundTripper that adds GraphQL-Features header to requests based on context values. This is required for using non-GA GraphQL API features like the agent assignment API.
This transport is used internally by the MCP server and is also exported for library consumers who need to build their own HTTP clients with GraphQL feature flag support.
Usage:
import "github.com/github/github-mcp-server/pkg/http/transport"
httpClient := &http.Client{
Transport: &transport.GraphQLFeaturesTransport{
Transport: http.DefaultTransport,
},
}
gqlClient := githubv4.NewClient(httpClient)
Then use ghcontext.WithGraphQLFeatures(ctx, "feature_name") when calling GraphQL operations.
type UserAgentTransport ¶
type UserAgentTransport struct {
Transport http.RoundTripper
Agent string
}
Click to show internal directories.
Click to hide internal directories.