principal

package
v0.0.0-...-65c2b02 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterceptorLogger

func InterceptorLogger(l logrus.FieldLogger) logging.Logger

Types

type Listener

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

func (*Listener) Address

func (l *Listener) Address() string

func (*Listener) Host

func (l *Listener) Host() string

func (*Listener) Port

func (l *Listener) Port() int

type Server

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

func NewServer

func NewServer(ctx context.Context, appClient appclientset.Interface, namespace string, opts ...ServerOption) (*Server, error)

func (*Server) AppManager

func (s *Server) AppManager() *application.ApplicationManager

func (*Server) AuthMethods

func (s *Server) AuthMethods() *auth.Methods

func (*Server) Listen

func (s *Server) Listen(ctx context.Context, backoff wait.Backoff) error

func (*Server) Listener

func (s *Server) Listener() *Listener

Listener returns the listener of Server s

func (*Server) Queues

func (s *Server) Queues() *queue.SendRecvQueues

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown shuts down the server s. If no server is running, or shutting down results in an error, an error is returned.

func (*Server) Start

func (s *Server) Start(ctx context.Context, errch chan error) error

Start starts the Server s and its listeners in their own go routines. Any error during startup, before the go routines are running, will be returned immediately. Errors during the runtime will be propagated via errch.

func (*Server) StartEventProcessor

func (s *Server) StartEventProcessor(ctx context.Context) error

StartEventProcessor will start the event processor, which processes items from all queues as the items appear in the queues. Processing will be performed in parallel, and in the background, until the context ctx is done.

If an error occurs before the processor could be started, it will be returned.

func (*Server) TokenIssuer

func (s *Server) TokenIssuer() issuer.Issuer

TokenIssuer returns the token issuer of Server s

type ServerOption

type ServerOption func(o *Server) error

func WithAuthMethods

func WithAuthMethods(am *auth.Methods) ServerOption

func WithClientCertSubjectMatch

func WithClientCertSubjectMatch(match bool) ServerOption

WithClientCertSubjectMatch sets whether the subject of a client certificate presented by the agent must match the agent's name. Has no effect if client certificates are not required.

func WithEventProcessors

func WithEventProcessors(numProcessors int64) ServerOption

WithEventProcessors sets the maximum number of event processors to run concurrently.

func WithGRPC

func WithGRPC(serveGRPC bool) ServerOption

func WithGeneratedTLS

func WithGeneratedTLS(serverName string) ServerOption

WithGeneratedTLS configures the server to generate and use a new TLS keypair upon startup.

INSECURE: Do not use in production.

func WithGeneratedTokenSigningKey

func WithGeneratedTokenSigningKey() ServerOption

WithGeneratedTokenSigningKey generates a temporary JWT signing key. Note that this option should only be used for testing.

INSECURE: Do not use this in production.

func WithListenerAddress

func WithListenerAddress(host string) ServerOption

WithListenerAddress sets the address the server should listen on.

func WithListenerPort

func WithListenerPort(port int) ServerOption

WithListenerPort sets the listening port for the server. If the port is not valid, an error is returned.

func WithMetricsPort

func WithMetricsPort(port int) ServerOption

func WithMinimumTLSVersion

func WithMinimumTLSVersion(version string) ServerOption

WithMinimumTLSVersion configures the minimum TLS version to be accepted by the server.

func WithNamespaces

func WithNamespaces(namespaces ...string) ServerOption

WithNamespaces sets an

func WithREST

func WithREST(serveREST bool) ServerOption

func WithRequireClientCerts

func WithRequireClientCerts(require bool) ServerOption

WithRequireClientCerts sets whether all incoming agent connections must present a valid client certificate before being accepted.

func WithServerName

func WithServerName(serverName string) ServerOption

func WithShutDownGracePeriod

func WithShutDownGracePeriod(d time.Duration) ServerOption

WithShutDownGracePeriod configures how long the server should wait for client connections to close during shutdown. If d is 0, the server will not use a grace period for shutdown but instead close immediately.

func WithTLSCipherSuite

func WithTLSCipherSuite(cipherSuite string) ServerOption

WithTLSCipherSuite configures the TLS cipher suite to be used by the server. If an unknown cipher suite is specified, an error is returned.

func WithTLSKeyPair

func WithTLSKeyPair(cert *x509.Certificate, key *rsa.PrivateKey) ServerOption

WithTLSKeyPair configures the TLS certificate and private key to be used by the server. The key must not be passphrase protected.

func WithTLSKeyPairFromPath

func WithTLSKeyPairFromPath(certPath, keyPath string) ServerOption

WithTLSKeyPairFromPath configures the TLS certificate and private key to be used by the server. The function will not check whether the files exists, or if they contain valid data because it is assumed that they may be created at a later point in time.

func WithTLSRootCaFromFile

func WithTLSRootCaFromFile(caPath string) ServerOption

WithTLSRootCaFromFile loads the root CAs to be used to validate client certificates from the file at caPath.

func WithTokenSigningKey

func WithTokenSigningKey(key crypto.PrivateKey) ServerOption

WithTokenSigningKey sets the RSA private key to use for signing the tokens issued by the Server

func WithTokenSigningKeyFromFile

func WithTokenSigningKeyFromFile(path string) ServerOption

WithTokenSigningKey sets the RSA private key to use for signing the tokens issued by the Server

type ServerOptions

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

Directories

Path Synopsis
apis

Jump to

Keyboard shortcuts

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