testutil

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JwkKID = "uhctestkey"
	JwkAlg = "RS256"
)

Variables

This section is empty.

Functions

func ParseJWTKeys

func ParseJWTKeys() (*rsa.PrivateKey, *rsa.PublicKey, error)

func PrivateKeyBytes

func PrivateKeyBytes() ([]byte, error)

func PublicKeyBytes

func PublicKeyBytes() ([]byte, error)

Types

type BaseHelper

type BaseHelper struct {
	Ctx           context.Context
	DBFactory     db.SessionFactory
	AppConfig     *config.ApplicationConfig
	JWTPrivateKey *rsa.PrivateKey
	JWTCA         *rsa.PublicKey
	T             *testing.T
}

func NewBaseHelper

func NewBaseHelper(appConfig *config.ApplicationConfig, dbFactory db.SessionFactory) *BaseHelper

func (*BaseHelper) CleanDB

func (h *BaseHelper) CleanDB() error

func (*BaseHelper) Count

func (h *BaseHelper) Count(table string) int64

func (*BaseHelper) CreateJWTString

func (h *BaseHelper) CreateJWTString(account *amv1.Account) string

func (*BaseHelper) CreateJWTToken

func (h *BaseHelper) CreateJWTToken(account *amv1.Account) *jwt.Token

func (*BaseHelper) Delete

func (h *BaseHelper) Delete(obj interface{})

func (*BaseHelper) DeleteAll

func (h *BaseHelper) DeleteAll(table interface{})

func (*BaseHelper) HealthCheckURL

func (h *BaseHelper) HealthCheckURL(path string) string

func (*BaseHelper) MetricsURL

func (h *BaseHelper) MetricsURL(path string) string

func (*BaseHelper) MigrateDB

func (h *BaseHelper) MigrateDB() error

func (*BaseHelper) MigrateDBTo

func (h *BaseHelper) MigrateDBTo(migrationID string)

func (*BaseHelper) NewAccount

func (h *BaseHelper) NewAccount(username, name, email string) *amv1.Account

func (*BaseHelper) NewID

func (h *BaseHelper) NewID() string

func (*BaseHelper) NewRandAccount

func (h *BaseHelper) NewRandAccount() *amv1.Account

func (*BaseHelper) NewUUID

func (h *BaseHelper) NewUUID() string

func (*BaseHelper) ResetDB

func (h *BaseHelper) ResetDB() error

func (*BaseHelper) RestURL

func (h *BaseHelper) RestURL(path string) string

func (*BaseHelper) SkipIfShort

func (h *BaseHelper) SkipIfShort()

func (*BaseHelper) StartJWKCertServerMock

func (h *BaseHelper) StartJWKCertServerMock() (jwkURL string, teardown func() error)

func (*BaseHelper) StartJWKServerMock added in v0.0.26

func (h *BaseHelper) StartJWKServerMock() (certURL string, tokenURL string, teardown func() error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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