httpserver

package
v0.0.0-...-2bf1e3b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameSpaceSettings

type NameSpaceSettings struct {
	// The Storage implementation that is serving this specific name space
	// within the server.
	Storage *storage.Storage

	// Protections around the Blast Path API access for this specific
	// name space.
	BlastPathACL *access.ACL

	// Protections around replica related operations. Servers in this Access
	// Control List will be able to create, update, and destroy replicas
	// on this server.
	PrimaryACL *access.ACL

	// Protections around read access for this specific name space.
	ReadACL *access.ACL

	// Protections around insert access for this specific name space.
	InsertACL *access.ACL
}

Each name space is given a specific security ACL configuration that allows it to be protected.

type Server

type Server interface {
	Addr() string
	Listen() error
	Run() error
}

An implementation of Server that exposes the public functions.

func New

func New(settings *Settings) Server

Creates a new Server that is capable of serving HTTP requests.

type Settings

type Settings struct {
	// The address and port that should be listened on for this server.
	Addr string
	Port int

	// A list of namespaces, mapped by name, that should be served
	// by this HTTP server.
	NameSpaces map[string]*NameSpaceSettings

	// Enable tracing for requests. Adds debugging but impacts performance
	// slightly.
	EnableTracing bool

	// If TLS is desired then this loader should be non nil and it should
	// return certificates to be used for serving on the TLS ports.
	TLSCerts *secretloader.Certificate

	// Debugging ACL
	EnableDebugPaths bool
	DebugPathsACL    *access.ACL

	// Health checking ACL
	HealthCheckACL *access.ACL

	// Status endpoint ACL
	StatusACL *access.ACL

	// Shut down endpoint ACL
	ShutDownACL *access.ACL

	// The Logger that will be used for all logs.
	Logger *slog.Logger

	// HTTP requests will be logged to this logger for access/request
	// logging. This is optional, if its left nil then no access logging
	// will be processed.
	AccessLogger *slog.Logger

	// These settings will be mapped into the underlying http.Server
	// object.
	WriteTimeout   time.Duration
	ReadTimeout    time.Duration
	IdleTimeout    time.Duration
	MaxHeaderBytes int

	// The prefix for the namespace= tag; a value of blobby_ for this field
	// would give blobby_namespace as the tag key in the rendered Prometheus
	// metrics:
	PrometheusTagPrefix string

	// If defined then web authentication will be enabled and users will
	// be allowed to authenticate to Blobby using a static web login form
	// server from _login.
	WebAuthProvider *access.WebAuthProvider

	// We allow SAML authentication from multiple sources. Each needs to be
	// configured and named. This stores a mapping of name to SAML
	// name to authentication details.
	SAMLAuth map[string]*access.SAML
}

Directories

Path Synopsis
Implements storage.Remote in a way that works with the existing httpserver package.
Implements storage.Remote in a way that works with the existing httpserver package.

Jump to

Keyboard shortcuts

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