Documentation
¶
Index ¶
- type TokenContext
- type TokenService
- func (t *TokenService) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)
- func (t *TokenService) DecodeToken(ctx context.Context, token string) (*TokenContext, error)
- func (t *TokenService) EncodedJWKS(ctx context.Context) (string, error)
- func (t *TokenService) EnsureJWK(ctx context.Context) error
- func (t *TokenService) JWKS(ctx context.Context) ([]byte, error)
- func (t *TokenService) NewToken(ctx context.Context, context TokenContext) (string, error)
- func (t *TokenService) NewTokenWithClaims(ctx context.Context, claims jwt.MapClaims) (*jwt.Token, string, error)
- func (t *TokenService) ReplaceJWK(req api.Context) error
- func (t *TokenService) ServeJWKS(api api.Context) error
- type TokenType
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 (*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 (*TokenService) ReplaceJWK ¶
func (t *TokenService) ReplaceJWK(req api.Context) error
Click to show internal directories.
Click to hide internal directories.