persistent

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringSlice added in v0.24.0

type StringSlice []string

func (StringSlice) MarshalJSON added in v0.24.0

func (s StringSlice) MarshalJSON() ([]byte, error)

func (*StringSlice) UnmarshalJSON added in v0.24.0

func (s *StringSlice) UnmarshalJSON(data []byte) error

type Time added in v0.24.0

type Time struct {
	time.Time
}

func NewTime added in v0.24.0

func NewTime(t time.Time) Time

func (Time) MarshalJSON added in v0.24.0

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON added in v0.24.0

func (t *Time) UnmarshalJSON(data []byte) error

type TokenContext

type TokenContext struct {
	Issuer                string `json:"iss"`
	Audience              string `json:"aud"`
	IssuedAt              Time   `json:"iat"`
	ExpiresAt             Time   `json:"exp"`
	UserID                string `json:"sub"`
	UserName              string `json:"name"`
	UserEmail             string `json:"email"`
	OAuthScope            string `json:"scope"`
	Picture               string `json:"picture"`
	UserGroups            StringSlice
	AuthProviderName      string
	AuthProviderNamespace string
	AuthProviderUserID    string

	MCPID string

	// This is used for requesting community license
	InstallationID string `json:"installation_id,omitempty"`

	// The following fields are for runs
	Namespace     string
	ModelProvider string
	Model         string
}

func (TokenContext) GetAudience added in v0.24.0

func (t TokenContext) GetAudience() (jwt.ClaimStrings, error)

func (TokenContext) GetExpirationTime added in v0.24.0

func (t TokenContext) GetExpirationTime() (*jwt.NumericDate, error)

GetExpirationTime implements the Claims interface.

func (TokenContext) GetIssuedAt added in v0.24.0

func (t TokenContext) GetIssuedAt() (*jwt.NumericDate, error)

GetIssuedAt implements the Claims interface.

func (TokenContext) GetIssuer added in v0.24.0

func (t TokenContext) GetIssuer() (string, error)

GetIssuer implements the Claims interface.

func (TokenContext) GetNotBefore added in v0.24.0

func (t TokenContext) GetNotBefore() (*jwt.NumericDate, error)

GetNotBefore implements the Claims interface.

func (TokenContext) GetSubject added in v0.24.0

func (t TokenContext) GetSubject() (string, error)

GetSubject implements the Claims interface.

type TokenService

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

func NewTokenService

func NewTokenService(serverURL string, gatewayClient *client.Client) (*TokenService, error)

func (*TokenService) AuthenticateRequest

func (t *TokenService) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)

func (*TokenService) DecodeToken added in v0.15.0

func (t *TokenService) DecodeToken(ctx context.Context, token string) (*TokenContext, error)

func (*TokenService) EnsureJWK added in v0.15.0

func (t *TokenService) EnsureJWK(ctx context.Context) error

EnsureJWK ensures that the JWK is created and stored. It should only be called in a controller post-start hook which only allows one to be run at a time.

func (*TokenService) NewToken

func (t *TokenService) NewToken(ctx context.Context, context TokenContext) (*jwt.Token, string, error)

func (*TokenService) ReplaceJWK

func (t *TokenService) ReplaceJWK(req api.Context) error

func (*TokenService) ServeJWKS

func (t *TokenService) ServeJWKS(api api.Context) error

Jump to

Keyboard shortcuts

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