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) SetJWKS

      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

                  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.