oauth

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHandlers

func SetupHandlers(gatewayClient *client.Client, oauthChecker *MCPOAuthHandlerFactory, tokenService *jwt.TokenService, oauthConfig services.OAuthAuthorizationServerConfig, 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) *MCPOAuthHandlerFactory

func (*MCPOAuthHandlerFactory) CheckForMCPAuth

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

Jump to

Keyboard shortcuts

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