Documentation

Overview

Package model is a model abstraction of authorized apps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizedApp

type AuthorizedApp struct {
	// AppPackageName is the name of the package like com.company.app.
	AppPackageName string

	// AllowedRegions is the list of allowed regions for this app. If the list is
	// empty, all regions are permitted.
	AllowedRegions map[string]struct{}

	// AllowedHealthAuthorityIDs represents the set of allowed health authorities
	// that this app can obtain and verify diagnosis verification certificates from.
	AllowedHealthAuthorityIDs         map[int64]struct{}
	BypassHealthAuthorityVerification bool

	// If true - revision tokens will still be accepted and checked, but will not
	// enforce correctness. They will still be generated as output.
	BypassRevisionToken bool
}

AuthorizedApp represents the configuration for a single exposure notification application and their access to and requirements for using the API. DB times of 0 are interpreted to be "unbounded" in that direction.

func NewAuthorizedApp

func NewAuthorizedApp() *AuthorizedApp

NewAuthorizedApp initializes an AuthorizedApp structure including pre-allocating all included maps.

func (*AuthorizedApp) AllAllowedHealthAuthorityIDs

func (c *AuthorizedApp) AllAllowedHealthAuthorityIDs() []int64

AllAllowedHealthAuthorityIDs returns a slice of all allowed heauth authority IDs.

func (*AuthorizedApp) AllAllowedRegions

func (c *AuthorizedApp) AllAllowedRegions() []string

AllAllowedRegions returns a slice of all allowed region codes.

func (*AuthorizedApp) IsAllowedRegion

func (c *AuthorizedApp) IsAllowedRegion(s string) bool

IsAllowedRegion returns true if the regions list is empty or if the given region is in the list of allowed regions.

func (*AuthorizedApp) RegionsOnePerLine

func (c *AuthorizedApp) RegionsOnePerLine() string

RegionsOnePerLine returns a string with all authorized regions, one per line. This is a utility method for the admin console.

func (*AuthorizedApp) Validate

func (c *AuthorizedApp) Validate() []string

Validate checks an authorized app before a save operation.