model

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package model is a model abstraction of health authorities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthAuthority

type HealthAuthority struct {
	ID             int64
	Issuer         string
	Audience       string
	Name           string
	Keys           []*HealthAuthorityKey
	JwksURI        *string
	EnableStatsAPI bool
}

HealthAuthority represents a public health authority that is authorized to issue diagnosis verification certificates accepted by this server.

func (*HealthAuthority) JWKSEnabled added in v0.23.0

func (ha *HealthAuthority) JWKSEnabled() bool

JWKSEnabled returns true if JWKS discovery is enabled for this health authority.

func (*HealthAuthority) SetJWKS added in v0.9.2

func (ha *HealthAuthority) SetJWKS(uri string)

SetJWKS sets the optional JwksURI property of the HealthAuthority.

func (*HealthAuthority) Validate

func (ha *HealthAuthority) Validate() error

Validate returns an error if the HealthAuthority struct is not valid.

type HealthAuthorityKey

type HealthAuthorityKey struct {
	AuthorityID  int64
	Version      string
	From         time.Time
	Thru         time.Time
	PublicKeyPEM string
}

HealthAuthorityKey represents a public key version for a given health authority.

func (*HealthAuthorityKey) IsFuture

func (k *HealthAuthorityKey) IsFuture() bool

func (*HealthAuthorityKey) IsValid

func (k *HealthAuthorityKey) IsValid() bool

IsValid returns true if the key is valid based on the current time.

func (*HealthAuthorityKey) IsValidAt

func (k *HealthAuthorityKey) IsValidAt(t time.Time) bool

IsValidAt returns true if the key is valid at a specific point in time.

func (*HealthAuthorityKey) PublicKey

func (k *HealthAuthorityKey) PublicKey() (*ecdsa.PublicKey, error)

PublicKey decodes the PublicKeyPEM text and returns the `*ecdsa.PublicKey` This system only supports verifying ECDSA JWTs, `alg: ES256`.

func (*HealthAuthorityKey) Revoke added in v0.9.0

func (k *HealthAuthorityKey) Revoke()

Revoke revokes a key.

func (*HealthAuthorityKey) Validate

func (k *HealthAuthorityKey) Validate() error

Validate returns an error if the HealthAuthorityKey is not valid.

Jump to

Keyboard shortcuts

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