publish

package
v0.0.0-...-075157f Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package publish defines the exposure keys publishing API.

Package publish defines the exposure keys publishing API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ctx context.Context, config *Config, env *serverenv.ServerEnv) (http.Handler, error)

NewHandler creates the HTTP handler for the TTK publishing API.

Types

type Config

type Config struct {
	AuthorizedApp         authorizedapp.Config
	Database              database.Config
	SecretManager         secrets.Config
	Verification          verification.Config
	ObservabilityExporter observability.Config

	Port             string `env:"PORT, default=8080"`
	MaxKeysOnPublish uint   `env:"MAX_KEYS_ON_PUBLISH, default=30"`
	// Provides compatibility w/ 1.5 release.
	MaxSameStartIntervalKeys     uint          `env:"MAX_SAME_START_INTERVAL_KEYS, default=3"`
	MaxIntervalAge               time.Duration `env:"MAX_INTERVAL_AGE_ON_PUBLISH, default=360h"`
	MaxMagnitudeSymptomOnsetDays uint          `env:"MAX_SYMPTOM_ONSET_DAYS, default=21"`
	CreatedAtTruncateWindow      time.Duration `env:"TRUNCATE_WINDOW, default=1h"`

	// Flags for local development and testing. This will cause still valid keys
	// to not be embargoed.
	// Normally "still valid" keys can be accepted, but are embargoed.
	ReleaseSameDayKeys bool `env:"DEBUG_RELEASE_SAME_DAY_KEYS"`
}

Config represents the configuration and associated environment variables for the publish components.

func (*Config) AuthorizedAppConfig

func (c *Config) AuthorizedAppConfig() *authorizedapp.Config

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Config

func (*Config) DebugReleaseSameDayKeys

func (c *Config) DebugReleaseSameDayKeys() bool

func (*Config) MaxExposureKeys

func (c *Config) MaxExposureKeys() uint

func (*Config) MaxIntervalStartAge

func (c *Config) MaxIntervalStartAge() time.Duration

func (*Config) MaxSameDayKeys

func (c *Config) MaxSameDayKeys() uint

func (*Config) MaxSymptomOnsetDays

func (c *Config) MaxSymptomOnsetDays() uint

func (*Config) ObservabilityExporterConfig

func (c *Config) ObservabilityExporterConfig() *observability.Config

func (*Config) SecretManagerConfig

func (c *Config) SecretManagerConfig() *secrets.Config

func (*Config) TruncateWindow

func (c *Config) TruncateWindow() time.Duration

Directories

Path Synopsis
Package database is a database interface to publish.
Package database is a database interface to publish.
Package model is a model abstraction of publish.
Package model is a model abstraction of publish.

Jump to

Keyboard shortcuts

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