utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package utils provides utilities to be used in testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitalizeVerificationDB added in v0.5.0

func InitalizeVerificationDB(ctx context.Context, tb testing.TB, db *database.DB, ha *vm.HealthAuthority, hak *vm.HealthAuthorityKey, sk *SigningKey)

InitalizeVerificationDB links the vdb, HA and SigningKeys together

func IssueJWT

func IssueJWT(t *testing.T, cfg *JWTConfig) (jwtText, hmacKey string)

IssueJWT generates a JWT as if it came from the authorized health authority.

Types

type JWTConfig

type JWTConfig struct {
	HealthAuthority      *vm.HealthAuthority
	HealthAuthorityKey   *vm.HealthAuthorityKey
	ExposureKeys         []verifyapi.ExposureKey
	Key                  *ecdsa.PrivateKey
	JWTWarp              time.Duration
	ReportType           string
	SymptomOnsetInterval uint32
}

JWTConfig stores the config used to fetch a verification jwt certificate

type SigningKey

type SigningKey struct {
	Key       *ecdsa.PrivateKey
	PublicKey string
}

SigningKey holds a single signing key and the PEM public key.

func GetSigningKey

func GetSigningKey(tb testing.TB) *SigningKey

GetSigningKey returns a new signing key to be used for verification.

Jump to

Keyboard shortcuts

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