oauth

package
v0.15.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnsupportedGrantType = ErrorCode("unsupported_grant_type")
)

Variables

This section is empty.

Functions

func SetupHandlers

func SetupHandlers(oauthChecker *MCPOAuthHandlerFactory, tokenStore mcp.GlobalTokenStore, tokenService *persistent.TokenService, oauthConfig services.OAuthAuthorizationServerConfig, jwks system.EncodedJWKS, baseURL string, mux *server.Server)

Types

type Error

type Error struct {
	Code        ErrorCode `json:"error"`
	Description string    `json:"error_description,omitempty"`
	State       string    `json:"state,omitempty"`
}

Error represents an OAuth 2.0 error response.

func (Error) Error

func (e Error) Error() string

type ErrorCode

type ErrorCode string

ErrorCode defines the set of OAuth 2.0 error codes as per RFC 6749.

const (
	ErrInvalidRequest          ErrorCode = "invalid_request"
	ErrUnauthorizedClient      ErrorCode = "unauthorized_client"
	ErrAccessDenied            ErrorCode = "access_denied"
	ErrUnsupportedResponseType ErrorCode = "unsupported_response_type"
	ErrInvalidScope            ErrorCode = "invalid_scope"
	ErrServerError             ErrorCode = "server_error"
	ErrTemporarilyUnavailable  ErrorCode = "temporarily_unavailable"
	ErrInvalidClientMetadata   ErrorCode = "invalid_client_metadata"
)

type MCPOAuthHandlerFactory

type MCPOAuthHandlerFactory struct {
	// contains filtered or unexported fields
}

func NewMCPOAuthHandlerFactory

func NewMCPOAuthHandlerFactory(baseURL string, sessionManager *mcp.SessionManager, client kclient.Client, gptClient *gptscript.GPTScript, gatewayClient *client.Client, globalTokenStore mcp.GlobalTokenStore, jwks system.EncodedJWKS) *MCPOAuthHandlerFactory

func (*MCPOAuthHandlerFactory) CheckForMCPAuth

func (f *MCPOAuthHandlerFactory) CheckForMCPAuth(req api.Context, mcpServer v1.MCPServer, mcpServerConfig mcp.ServerConfig, userID, mcpID, oauthAppAuthRequestID string) (string, error)

type TokenExchangeResponse added in v0.15.0

type TokenExchangeResponse struct {
	AccessToken     string `json:"access_token"`
	IssuedTokenType string `json:"issued_token_type"`
	TokenType       string `json:"token_type"`
	ExpiresIn       int    `json:"expires_in"`
}

TokenExchangeResponse represents an RFC 8693 token exchange response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL