federationin

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package federationin handles pulling data from other federation servers.

Index

Constants

View Source
const (
	// DefaultAudience is the default OIDC audience.
	DefaultAudience = "https://exposure-notifications-server/federation"
)

Variables

View Source
var (
	// ValidAudienceStr is the regexp string of a valid audience string.
	ValidAudienceStr = `\Ahttps://.*\z`
	// ValidAudienceRegexp is the compiled regexp of a valid audience string.
	ValidAudienceRegexp = regexp.MustCompile(ValidAudienceStr)
)
View Source
var (
	ErrInvalidReportType = errors.New("invalid report type")
)

Functions

func NewHandler

func NewHandler(env *serverenv.ServerEnv, config *Config) http.Handler

NewHandler returns a handler that will fetch server-to-server federation results for a single federation query.

Types

type Config

type Config struct {
	Database              database.Config
	SecretManager         secrets.Config
	ObservabilityExporter observability.Config

	Port                         string        `env:"PORT, default=8080"`
	Timeout                      time.Duration `env:"RPC_TIMEOUT, default=10m"`
	TruncateWindow               time.Duration `env:"TRUNCATE_WINDOW, default=1h"`
	MaxIntervalAge               time.Duration `env:"MAX_INTERVAL_AGE_ON_PUBLISH, default=360h"`
	MaxMagnitudeSymptomOnsetDays uint          `env:"MAX_SYMPTOM_ONSET_DAYS, default=14"`

	// 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"`

	// TLSSkipVerify, if set to true, causes the server certificate to not be
	// verified. This is typically used when testing locally with self-signed
	// certificates.
	TLSSkipVerify bool `env:"TLS_SKIP_VERIFY"`

	// TLSCertFile points to an optional cert file that will be appended to the
	// system certificates.
	TLSCertFile string `env:"TLS_CERT_FILE"`

	// CredentialsFile points to a JSON credentials file. If running on Managed
	// Cloud Run, or if using $GOOGLE_APPLICATION_CREDENTIALS, leave this value
	// empty.
	CredentialsFile string `env:"CREDENTIALS_FILE"`

	// Sync configuration.
	// If accepted, both self report and recursive will be sent as clinical,
	// otherwise they will be dropped.
	AcceptSelfReport bool `env:"ACCEPT_SELF_REPORT, default=false"`
	AcceptRecursive  bool `env:"ACCEPT_RECURSIVE, default=false"`
}

Config is the configuration for federation-pull components (data pulled from other servers).

func (*Config) DatabaseConfig

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

func (*Config) ObservabilityExporterConfig

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

func (*Config) SecretManagerConfig

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

Directories

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

Jump to

Keyboard shortcuts

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