Documentation
¶
Overview ¶
Package twctx carries the per-request values the MCP server derives from the caller's bearer token: which installation it belongs to, the token itself, the scopes it grants, and whether the installation lives in another region.
It exists as its own package so tool helpers can read those values without importing the server configuration, which would otherwise make every tool package depend on the whole startup path.
Index ¶
- func BearerTokenFromContext(ctx context.Context) (string, bool)
- func CustomerURLFromContext(ctx context.Context) (string, bool)
- func IsCrossRegion(ctx context.Context) bool
- func ScopesFromContext(ctx context.Context) []string
- func WithBearerToken(ctx context.Context, bearerToken string) context.Context
- func WithCrossRegion(ctx context.Context, crossRegion bool) context.Context
- func WithCustomerURL(ctx context.Context, customerURL string) context.Context
- func WithScopes(ctx context.Context, scopes []string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerTokenFromContext ¶
BearerTokenFromContext returns the bearer token from the context, if any.
func CustomerURLFromContext ¶
CustomerURLFromContext returns the customer URL from the context, if any.
func IsCrossRegion ¶
IsCrossRegion reports whether the request targets an installation in another region.
func ScopesFromContext ¶
ScopesFromContext returns the scopes granted to the bearer token, if any.
func WithBearerToken ¶
WithBearerToken returns a new context with the given bearer token.
func WithCrossRegion ¶
WithCrossRegion adds a boolean value to the context indicating if the request is cross-region.
func WithCustomerURL ¶
WithCustomerURL returns a new context with the given customer URL.
Types ¶
This section is empty.