Documentation
¶
Index ¶
- Constants
- type AuthService
- func (a AuthService) AuthServiceType() string
- func (a AuthService) GetClaimsFromHeader(ctx context.Context, h http.Header) (map[string]any, error)
- func (a AuthService) GetName() string
- func (a AuthService) ToConfig() auth.AuthServiceConfig
- func (a AuthService) ValidateMCPAuth(ctx context.Context, h http.Header) error
- type Config
- type MCPAuthError
Constants ¶
View Source
const AuthServiceType string = "generic"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
Config
// contains filtered or unexported fields
}
struct used to store auth service info
func (AuthService) AuthServiceType ¶
func (a AuthService) AuthServiceType() string
Returns the auth service type
func (AuthService) GetClaimsFromHeader ¶
func (a AuthService) GetClaimsFromHeader(ctx context.Context, h http.Header) (map[string]any, error)
Verifies generic JWT access token inside the Authorization header
func (AuthService) GetName ¶
func (a AuthService) GetName() string
Returns the name of the auth service
func (AuthService) ToConfig ¶
func (a AuthService) ToConfig() auth.AuthServiceConfig
func (AuthService) ValidateMCPAuth ¶
ValidateMCPAuth handles MCP auth token validation
type Config ¶
type Config struct {
Name string `yaml:"name" validate:"required"`
Type string `yaml:"type" validate:"required"`
Audience string `yaml:"audience" validate:"required"`
McpEnabled bool `yaml:"mcpEnabled"`
AuthorizationServer string `yaml:"authorizationServer" validate:"required"`
ScopesRequired []string `yaml:"scopesRequired"`
}
Auth service configuration
func (Config) AuthServiceConfigType ¶
Returns the auth service type
func (Config) Initialize ¶
func (cfg Config) Initialize() (auth.AuthService, error)
Initialize a generic auth service
type MCPAuthError ¶
MCPAuthError represents an error during MCP authentication validation.
func (*MCPAuthError) Error ¶
func (e *MCPAuthError) Error() string
Click to show internal directories.
Click to hide internal directories.