http

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Audience = "kubernetes-mcp-server"
)

Variables

This section is empty.

Functions

func AuthorizationMiddleware

func AuthorizationMiddleware(requireOAuth bool, serverURL string, oidcProvider *oidc.Provider, mcpServer *mcp.Server) func(http.Handler) http.Handler

AuthorizationMiddleware validates the OAuth flow using Kubernetes TokenReview API

func RequestMiddleware

func RequestMiddleware(next http.Handler) http.Handler

func Serve

func Serve(ctx context.Context, mcpServer *mcp.Server, staticConfig *config.StaticConfig, oidcProvider *oidc.Provider) error

Types

type JWTClaims

type JWTClaims struct {
	jwt.Claims
	Scope string `json:"scope,omitempty"`
}

func ParseJWTClaims

func ParseJWTClaims(token string) (*JWTClaims, error)

func (*JWTClaims) GetScopes

func (c *JWTClaims) GetScopes() []string

func (*JWTClaims) Validate

func (c *JWTClaims) Validate(audience string) error

Validate Checks if the JWT claims are valid and if the audience matches the expected one.

Jump to

Keyboard shortcuts

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