Documentation ¶
Overview ¶
Package utils provides utilities to be used in testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeVerificationDB ¶ added in v0.20.0
func InitializeVerificationDB(ctx context.Context, tb testing.TB, db *database.DB, ha *vm.HealthAuthority, hak *vm.HealthAuthorityKey, sk *SigningKey) int64
InitializeVerificationDB links the vdb, HA and SigningKeys together
Types ¶
type JWTConfig ¶
type JWTConfig struct { HealthAuthority *vm.HealthAuthority HealthAuthorityKey *vm.HealthAuthorityKey ExposureKeys []verifyapi.ExposureKey Key crypto.Signer 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.
type StatsJWTConfig ¶ added in v0.19.0
type StatsJWTConfig struct { HealthAuthority *vm.HealthAuthority HealthAuthorityKey *vm.HealthAuthorityKey Key *ecdsa.PrivateKey Audience string JWTWarp time.Duration }
StatsJWTConfig represents the configuration for an auth token to call the stats API. Requires the private key to sign JWTs.
func (*StatsJWTConfig) IssueStatsJWT ¶ added in v0.19.0
func (c *StatsJWTConfig) IssueStatsJWT(t testing.TB) string
IssueStatsJWT issues an auth token to call the stats API. This is meant for test purposes only. Normally these tokens would be issued outside this system.
Click to show internal directories.
Click to hide internal directories.