server

package
v0.0.0-...-176b4ae Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IngestPolicyID = "ingest-access"
)

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, id_token.ValidateIdTokenServiceClient) (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
	SessionAddress           string
}

Config holds the server's configuration options.

type Server

type Server struct {
	// Map of authenticator IDs to authenticators.
	// Note: dex wraps this with a ResourceVersion, but that is due to storing
	// connectors in the database -- we don't do this
	TokenStorage tokens.Storage
	// 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(policiesClient authz.PoliciesServiceClient, pv tokens.ProjectValidator) *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