Documentation ¶
Index ¶
- type Service
- func (service *Service) GenerateToken(data *portainer.TokenData) (string, error)
- func (service *Service) GenerateTokenForKubeconfig(data *portainer.TokenData) (string, error)
- func (service *Service) GenerateTokenForOAuth(data *portainer.TokenData, expiryTime *time.Time) (string, error)
- func (service *Service) ParseAndVerifyToken(token string) (*portainer.TokenData, error)
- func (service *Service) SetUserSessionDuration(userSessionDuration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents a service for managing JWT tokens.
func NewService ¶
func NewService(userSessionDuration string, dataStore dataservices.DataStore) (*Service, error)
NewService initializes a new service. It will generate a random key that will be used to sign JWT tokens.
func (*Service) GenerateToken ¶
GenerateToken generates a new JWT token.
func (*Service) GenerateTokenForKubeconfig ¶
GenerateTokenForKubeconfig generates a new JWT token for Kubeconfig
func (*Service) GenerateTokenForOAuth ¶
func (service *Service) GenerateTokenForOAuth(data *portainer.TokenData, expiryTime *time.Time) (string, error)
GenerateTokenForOAuth generates a new JWT token for OAuth login token expiry time response from OAuth provider is considered
func (*Service) ParseAndVerifyToken ¶
ParseAndVerifyToken parses a JWT token and verify its validity. It returns an error if token is invalid.
func (*Service) SetUserSessionDuration ¶
SetUserSessionDuration sets the user session duration
Click to show internal directories.
Click to hide internal directories.