server

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthenticatorsConfig = map[string]func() AuthenticatorConfig{
	"mock-oidc":         func() AuthenticatorConfig { return new(mock.OidcConfig) },
	"mock-static":       func() AuthenticatorConfig { return new(mock.StaticConfig) },
	"mock-header-token": func() AuthenticatorConfig { return new(mock.HeaderTokenConfig) },
	"oidc":              func() AuthenticatorConfig { return new(oidc.Config) },
	"header-token":      func() AuthenticatorConfig { return new(tokens.HeaderTokenConfig) },
}

AuthenticatorsConfig variable provides an easy way to return a config struct depending on the authenticator type.

Functions

This section is empty.

Types

type AuthenticatorConfig

type AuthenticatorConfig interface {
	Open(*url.URL, *certs.ServiceCerts, *zap.Logger) (authenticator.Authenticator, error)
}

AuthenticatorConfig is a configuration that can open an authenticator.

type Config

type Config struct {
	// These are the configs of the specified Authenticators, which will be
	// Open()ed when this config is passed to NewServer
	Authenticators           map[string]AuthenticatorConfig
	Upstream                 *url.URL
	Logger                   *zap.Logger
	Token                    tokens.TokenConfig
	ServiceCerts             *certs.ServiceCerts
	TeamsAddress             string // "ip:port"
	AuthzAddress             string
	LegacyDataCollectorToken string
}

Config holds the server's configuration options.

type Server

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

Server is the top level object.

func NewServer

func NewServer(ctx context.Context, c Config) (*Server, error)

NewServer constructs a server from the provided config.

func (*Server) Authenticate

Authenticate provides a quick and dirty api.AuthenticationServer implementation for *Server

func (*Server) NewGRPCServer

func (s *Server) NewGRPCServer(authzClient authz.SubjectPurgeClient) *grpc.Server

NewGRPCServer returns a server that provides our services: token and authentication requests.

func (*Server) Serve

func (s *Server) Serve(grpcEndpoint, http1Endpoint string) error

Serve tells authn to start responding to GRPC and HTTP1 requests. On success, it never returns.

func (*Server) ServeHTTP1

func (s *Server) ServeHTTP1(pbmux *runtime.ServeMux, http1Endpoint string) error

Jump to

Keyboard shortcuts

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