generic

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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) GetAuthorizationServer

func (a AuthService) GetAuthorizationServer() string

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) GetScopesRequired

func (a AuthService) GetScopesRequired() []string

func (AuthService) IsMCPEnabled

func (a AuthService) IsMCPEnabled() bool

func (AuthService) ToConfig

func (a AuthService) ToConfig() auth.AuthServiceConfig

func (AuthService) ValidateMCPAuth

func (a AuthService) ValidateMCPAuth(ctx context.Context, h http.Header) (map[string]any, error)

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"`
	IntrospectionEndpoint  string   `yaml:"introspectionEndpoint"`
	IntrospectionMethod    string   `yaml:"introspectionMethod"`
	IntrospectionParamName string   `yaml:"introspectionParamName"`
}

Auth service configuration

func (Config) AuthServiceConfigType

func (cfg Config) AuthServiceConfigType() string

Returns the auth service type

func (Config) Initialize

func (cfg Config) Initialize() (auth.AuthService, error)

Initialize a generic auth service

func (Config) IsMCPEnabled

func (cfg Config) IsMCPEnabled() bool

type MCPAuthError

type MCPAuthError = auth.MCPAuthError

MCPAuthError represents an error during MCP authentication validation.

Jump to

Keyboard shortcuts

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