server

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthError = errs.Class("authclient")

AuthError is the default error class for auth clients.

View Source
var (

	// ErrAccessGrant occurs when failing to parse the access grant from the
	// request.
	ErrAccessGrant = errs.Class("access grant")
)
View Source
var (
	// Error is an error class for internal Multinode Dashboard http server error.
	Error = errs.Class("gateway")
)

Functions

func LoadTLSConfigFromDir

func LoadTLSConfigFromDir(configDir string) (*tls.Config, error)

LoadTLSConfigFromDir reads a directory and loads certificates it contains.

func LogRequests added in v1.8.0

func LogRequests(log *zap.Logger, h http.Handler, insecureLogPaths bool) http.Handler

LogRequests logs requests.

func LogResponses added in v1.8.0

func LogResponses(log *zap.Logger, h http.Handler, insecureLogAll bool) http.Handler

LogResponses logs responses.

func NewMultiTenantGateway added in v1.14.2

func NewMultiTenantGateway(gateway minio.Gateway, connectionPool *rpcpool.Pool, config uplink.Config, insecureLogAll bool) minio.Gateway

NewMultiTenantGateway returns a wrapper of minio.Gateway that logs responses and makes gateway multi-tenant.

Types

type AuthClient

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

AuthClient communicates with the Auth Service.

func NewAuthClient

func NewAuthClient(baseURL *url.URL, token string) (*AuthClient, error)

NewAuthClient returns a new auth client.

func (*AuthClient) GetAccess

func (c *AuthClient) GetAccess(ctx context.Context, accessKeyID string, clientIP string) (response *GetAccessResponse, err error)

GetAccess returns the auth service access data for the give access key ID. clientIP is the IP of the client that has originated the request and it's required to be sent to the Auth service.

func (*AuthClient) GetHealthLive

func (c *AuthClient) GetHealthLive(ctx context.Context) (bool, error)

GetHealthLive returns the auth service health live status.

type Config added in v1.8.0

type Config struct {
	Address string `help:"Address to serve gateway on" default:"127.0.0.1:7777"`
	Dir     string `help:"Minio generic server config path" default:"$CONFDIR/minio"`
}

Config determines how server listens for requests.

type GetAccessResponse

type GetAccessResponse struct {
	AccessGrant string `json:"access_grant"`
	SecretKey   string `json:"secret_key"`
	IsPublic    bool   `json:"public"`
}

GetAccessResponse contains Access information from the Auth Service.

type MinioSystemLogTarget added in v1.7.0

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

MinioSystemLogTarget is used for receiving system error messages from minio.

func NewMinioSystemLogTarget added in v1.7.0

func NewMinioSystemLogTarget(log *zap.Logger) *MinioSystemLogTarget

NewMinioSystemLogTarget returns a new MinioSystemLogTarget.

func (*MinioSystemLogTarget) Endpoint added in v1.7.0

func (lt *MinioSystemLogTarget) Endpoint() string

Endpoint is used by minio logger.Target but unused for our purposes.

func (*MinioSystemLogTarget) Send added in v1.7.0

func (lt *MinioSystemLogTarget) Send(e interface{}, errKind string) error

Send is called by minio whenever it logs an unexpected error, such as an internal server error that isn't mapped to a minio response. A system error in minio is defined as not having request information, as it occurs early in the request. An example of a system error is the IAM store in minio failing to retrieve a user, so in our case not being able to contact the auth service. We deliberately don't use this facility to log request scoped logs, like for specific handler (e.g. ListBuckets) errors, as those are handled separately in LogResponsesNoPaths().

func (*MinioSystemLogTarget) String added in v1.7.0

func (lt *MinioSystemLogTarget) String() string

String is used by minio logger.Target but unused for our purposes.

func (*MinioSystemLogTarget) Validate added in v1.7.0

func (lt *MinioSystemLogTarget) Validate() error

Validate is used by minio logger.Target but unused for our purposes.

type Server

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

Server represents an S3 compatible http server.

func New

func New(listener net.Listener, log *zap.Logger, tlsConfig *tls.Config, useSetInMemoryMiddleware bool,
	trustedIPs trustedip.List, insecureLogAll bool, corsAllowedOrigins []string) *Server

New returns new instance of an S3 compatible http server.

TODO: at the time of wiring the new Signature middleware we'll start to use/ pass around the trustedIPs parameter.

func (*Server) Close

func (s *Server) Close() error

Close closes server and underlying listener.

func (*Server) Run

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

Run starts the S3 compatible http server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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