testutils

package
v1.99.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEmptyTestDatabase

func CreateEmptyTestDatabase(s string) (*identity.Database, error)

CreateEmptyTestDatabase returns empty database instance.

func CreateTestDatabase

func CreateTestDatabase(s string) (*identity.Database, error)

CreateTestDatabase returns database instance.

func GetCookie

func GetCookie(name, value string, ttl int) *http.Cookie

GetCookie returns http cookie.

func GetSharedKey

func GetSharedKey() string

GetSharedKey returns shared key for HS algorithms.

func NewTestCryptoKeyStore

func NewTestCryptoKeyStore() *kms.CryptoKeyStore

NewTestCryptoKeyStore returns an instance of CryptoKeyStore with loaded HMAC key pair.

func NewTestGuestAccessList

func NewTestGuestAccessList() *acl.AccessList

NewTestGuestAccessList return ACL with guest access.

func NewTestGuestAccessListWithLogger

func NewTestGuestAccessListWithLogger() *acl.AccessList

NewTestGuestAccessListWithLogger return ACL with guest access and logger.

func NewTestUser

func NewTestUser() *user.User

NewTestUser returns test User with claims.

Types

type InjectedTestToken

type InjectedTestToken struct {
	Name string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
	// The locations to inject a token in this test.
	Location string `json:"location,omitempty" xml:"location,omitempty" yaml:"location,omitempty"`
	// The basic user claims.
	User *user.User `json:"user,omitempty" xml:"user,omitempty" yaml:"user,omitempty"`
}

InjectedTestToken is an instance of injected token.

func NewInjectedTestToken

func NewInjectedTestToken(name, location, cfg string) *InjectedTestToken

NewInjectedTestToken returns an instance of injected token.

Jump to

Keyboard shortcuts

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