federationout

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package federationout handles requests from other federation servers for data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(env *serverenv.ServerEnv, config *Config) pb.FederationServer

NewServer builds a new FederationServer.

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=5m"`
	TruncateWindow time.Duration `env:"TRUNCATE_WINDOW, default=1h"`

	// AllowAnyClient, if true, removes authentication requirements on the
	// federation endpoint. In practice, this is only useful in local testing.
	AllowAnyClient bool `env:"ALLOW_ANY_CLIENT"`

	// TLSCertFile is the certificate file to use if TLS encryption is enabled on
	// the server. If present, TLSKeyFile must also be present. These settings
	// should be left blank on Managed Cloud Run where the TLS termination is
	// handled by the environment.
	TLSCertFile string `env:"TLS_CERT_FILE"`
	TLSKeyFile  string `env:"TLS_KEY_FILE"`
}

Config is the configuration for the federation components (data sent to 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

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (Server) AuthInterceptor

func (s Server) AuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

AuthInterceptor validates incoming OIDC bearer token and adds corresponding FederationAuthorization record to the context.

func (Server) Fetch

Fetch implements the FederationServer Fetch endpoint.

Directories

Path Synopsis
Package database is a database interface to federation out.
Package database is a database interface to federation out.

Jump to

Keyboard shortcuts

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