token

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log        *slog.Logger
	TokenStore tokenutil.TokenStore
	CertStore  certs.CertStore
	Repo       *repository.Store

	// AdminSubjects are the subjects for which the token service allows the creation of admin api tokens
	AdminSubjects []string

	// Issuer to sign the JWT Token with
	Issuer string
}

type TokenService

type TokenService interface {
	apiv2connect.TokenServiceHandler
	CreateConsoleTokenWithoutPermissionCheck(ctx context.Context, subject string, expiration *time.Duration) (*connect.Response[apiv2.TokenServiceCreateResponse], error)
	CreateApiTokenWithoutPermissionCheck(ctx context.Context, subject string, rq *connect.Request[apiv2.TokenServiceCreateRequest]) (*connect.Response[apiv2.TokenServiceCreateResponse], error)
}

func New

func New(c Config) TokenService

Jump to

Keyboard shortcuts

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