Package federationout handles requests from other federation servers for data.

Package federationout contains OpenCensus metrics and views for federationout operations



This section is empty.


This section is empty.


func NewServer

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

NewServer builds a new FederationServer.


type BuildIteratorRequest

type BuildIteratorRequest struct {
	// contains filtered or unexported fields

type Config

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

	Port           string        `env:"PORT, default=8080"`
	MaxRecords     uint32        `env:"MAX_RECORDS, default=500"`
	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.


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