test_utils

package
v0.0.0-...-d2864de Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWK

func GenerateJWK() (jwk.Key, jwk.Set, string, error)

GenerateJWK generates a JWK private key and a corresponding JWKS public key, and the string representation of the public key

func GenerateJWKS

func GenerateJWKS() (string, error)

func InitClient

func InitClient(t *testing.T, initCfg map[string]any)

Initialize the client for a unit test

Will set the configuration to a temporary directory (to avoid pulling in global configuration) and set some arbitrary viper configurations

func RegistryMockup

func RegistryMockup(t *testing.T, prefix string) *httptest.Server

For these tests, we only need to lookup key locations. Create a dummy registry that only returns the jwks_uri location for the given key. Once a server is instantiated, it will only return locations for the provided prefix. To change prefixes, create a new registry mockup.

func TestContext

func TestContext(ictx context.Context, t *testing.T) (ctx context.Context, cancel context.CancelFunc, egrp *errgroup.Group)

func WriteBigBuffer

func WriteBigBuffer(t *testing.T, fp io.WriteCloser, sizeMB int) (size int)

Writes a file at least the specified size in MB

Types

This section is empty.

Jump to

Keyboard shortcuts

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