service

package
v0.0.0-...-6cdb919 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NeverExpire     = "never"
	ExpiresAtFormat = "2006-01-02"
)
View Source
const ClaimsIssuer = "horizon"

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	PipelinerunID *uint
	jwt.RegisteredClaims
}

type ClaimsOption

type ClaimsOption func(*Claims)

func WithPipelinerunID

func WithPipelinerunID(pipelinerunID uint) ClaimsOption

type Service

type Service interface {
	// CreateAccessToken used for personal access Token and resource access Token
	CreateAccessToken(ctx context.Context, name, expiresAtStr string,
		userID uint, scopes []string) (*tokenmodels.Token, error)
	CreateJWTToken(subject string, expiresIn time.Duration, options ...ClaimsOption) (string, error)
	ParseJWTToken(tokenStr string) (Claims, error)
}

func NewService

func NewService(manager *managerparam.Manager, config tokenconfig.Config) Service

Jump to

Keyboard shortcuts

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