persistent

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenContext

type TokenContext struct {
	Audience              string
	IssuedAt              time.Time
	ExpiresAt             time.Time
	UserID                string
	UserName              string
	UserEmail             string
	UserGroups            []string
	Picture               string
	AuthProviderName      string
	AuthProviderNamespace string
	AuthProviderUserID    string

	MCPID string

	// The following fields are for runs
	Namespace         string
	RunID             string
	ThreadID          string
	ProjectID         string
	TopLevelProjectID string
	ModelProvider     string
	Model             string
	AgentID           string
	WorkflowID        string
	WorkflowStepID    string
	Scope             string

	TokenType TokenType
}

type TokenService

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

func NewTokenService

func NewTokenService(serverURL string, gatewayClient *client.Client, credOnlyGPTClient *gptscript.GPTScript) (*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) EncodedJWKS added in v0.15.0

func (t *TokenService) EncodedJWKS(ctx context.Context) (string, 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 in the GPTScript client. It should only be called in a controller post-start hook which only allows one to be run at a time.

func (*TokenService) JWKS added in v0.15.0

func (t *TokenService) JWKS(ctx context.Context) ([]byte, error)

func (*TokenService) NewToken

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

func (*TokenService) NewTokenWithClaims added in v0.15.0

func (t *TokenService) NewTokenWithClaims(ctx context.Context, claims jwt.MapClaims) (*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

type TokenType added in v0.15.0

type TokenType string
const (
	TokenTypeRun TokenType = "run"
)

Jump to

Keyboard shortcuts

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