server

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package server provides functionality so that other uses of sansshell can provide their own main.go without having to cargo-cult everything across for common use cases. i.e. adding additional modules that are locally defined.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, rs RunState)

Run takes the given context and RunState and starts up a sansshell server. As this is intended to be called from main() it doesn't return errors and will instead exit on any errors.

Types

type RunState added in v1.0.2

type RunState struct {
	// Logger is used for all logging.
	Logger logr.Logger
	// CredSource is a registered credential source with the mtls package.
	CredSource string
	// Hostport is the host:port to run the server.
	Hostport string
	// Policy is an OPA policy for determining authz decisions.
	Policy string
	// Justification if true requires justification to be set in the
	// incoming RPC context Metadata (to the key defined in the telemetry package).
	Justification bool
	// JustificationFunc will be called if Justication is true and a justification
	// entry is found. The supplied function can then do any validation it wants
	// in order to ensure it's compliant.
	JustificationFunc func(string) error
}

Jump to

Keyboard shortcuts

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