tokenstatuslistissuer

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

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 is the token status list issuer service

func New

func New(ctx context.Context, cfg *model.Cfg, cacheService *cache.Service, dbService *db.Service, log *logger.Log) (*Service, error)

New creates a new token status list issuer service

func (*Service) AddStatus

func (s *Service) AddStatus(ctx context.Context, status uint8) (int64, int64, error)

AddStatus adds a new status to the status list and returns the section and index of the new status record.

func (*Service) Close

func (s *Service) Close(ctx context.Context) error

Close closes the status issuer service

func (*Service) CreateNewSectionIfNeeded

func (s *Service) CreateNewSectionIfNeeded(ctx context.Context) (int64, error)

CreateNewSectionIfNeeded checks if the current section has enough decoys and creates a new section if needed.

func (*Service) GenerateStatusListTokenCWT

func (s *Service) GenerateStatusListTokenCWT(ctx context.Context, cfg TokenConfig) ([]byte, error)

GenerateStatusListTokenCWT creates a signed Status List Token CWT per Section 6.1 using the tokenstatuslist package for core Token Status List operations.

func (*Service) GenerateStatusListTokenJWT

func (s *Service) GenerateStatusListTokenJWT(ctx context.Context, cfg TokenConfig) (string, error)

GenerateStatusListTokenJWT creates a signed Status List Token JWT per Section 5.1 using the tokenstatuslist package for core Token Status List operations.

func (*Service) GetAllSections

func (s *Service) GetAllSections(ctx context.Context) ([]int64, error)

GetAllSections returns all section IDs for Status List Aggregation (Section 9.3).

func (*Service) GetCachedCWT

func (s *Service) GetCachedCWT(ctx context.Context, section int64) []byte

GetCachedCWT returns a cached CWT for the given section, or nil if not cached

func (*Service) GetCachedJWT

func (s *Service) GetCachedJWT(ctx context.Context, section int64) string

GetCachedJWT returns a cached JWT for the given section, or empty string if not cached

func (*Service) GetStatusListForSection

func (s *Service) GetStatusListForSection(ctx context.Context, section int64) ([]uint8, error)

GetStatusListForSection retrieves all statuses for a given section from the database. Returns a slice of status values suitable for encoding into a Status List Token.

func (*Service) UpdateStatus

func (s *Service) UpdateStatus(ctx context.Context, section int64, index int64, status uint8) error

UpdateStatus updates the status of an existing entry at the given section and index.

type TokenConfig

type TokenConfig struct {
	tokenstatuslist.TokenConfig

	// SigningMethod is the JWT signing method (e.g., jwt.SigningMethodES256)
	SigningMethod jwt.SigningMethod
}

TokenConfig embeds tokenstatuslist.TokenConfig and adds signing method configuration.

Jump to

Keyboard shortcuts

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