Documentation ¶
Index ¶
- Variables
- func AccessKey(authClient *authclient.AuthClient, trustedIPs trustedip.List, log *zap.Logger) mux.MiddlewareFunc
- func AccessLog(log *zap.Logger, p *accesslogs.Processor, config AccessLogConfig) mux.MiddlewareFunc
- func CollectEvent(h http.Handler) http.Handler
- func GetAccessKeyID(r *http.Request) (string, error)
- func LogRequests(log *zap.Logger, h http.Handler, insecureLogPaths bool) http.Handler
- func LogResponses(log *zap.Logger, h http.Handler, insecureLogAll bool) http.Handler
- func Metrics(prefix string, next http.Handler) http.Handler
- func MonitorMinioGlobalHandler(i int, f mux.MiddlewareFunc) mux.MiddlewareFunc
- func NewLogRequests(log *zap.Logger, insecureLogPaths bool) mux.MiddlewareFunc
- func NewLogResponses(log *zap.Logger, insecureLogPaths bool) mux.MiddlewareFunc
- func NewMetrics(prefix string) mux.MiddlewareFunc
- func ParseFromForm(r *http.Request) (string, error)
- func SerializeAccessLogConfig(config AccessLogConfig) ([]string, error)
- func SetInMemory(next http.Handler) http.Handler
- type AccessLogConfig
- type Credentials
- type DestinationLogBucket
- type Limiter
- type V2
- type V4
- type V4Credential
- type WatchedBucket
Constants ¶
This section is empty.
Variables ¶
var ParseV2FromHeaderError = errs.Class("header")
ParseV2FromHeaderError is the default error class for V2 parsing header errors.
var ParseV2FromMPartError = errs.Class("V2 multipart form")
ParseV2FromMPartError is the default error class for V2 parsing multipart form errors.
var ParseV2FromQueryError = errs.Class("query")
ParseV2FromQueryError is the default error class for V2 parsing query errors.
var ParseV4CredentialError = errs.Class("credential")
ParseV4CredentialError is the default error class for V4 parsing credential errors.
var ParseV4FromHeaderError = errs.Class("header")
ParseV4FromHeaderError is the default error class for V4 parsing header errors.
var ParseV4FromMPartError = errs.Class("V4 multipart form")
ParseV4FromMPartError is the default error class for V4 parsing multipart form errors.
var ParseV4FromQueryError = errs.Class("query")
ParseV4FromQueryError is the default error class for V4 parsing query errors.
Functions ¶
func AccessKey ¶
func AccessKey(authClient *authclient.AuthClient, trustedIPs trustedip.List, log *zap.Logger) mux.MiddlewareFunc
AccessKey implements mux.Middlware and saves the accesskey to context.
func AccessLog ¶ added in v1.84.0
func AccessLog(log *zap.Logger, p *accesslogs.Processor, config AccessLogConfig) mux.MiddlewareFunc
AccessLog is a middleware function that logs access information for incoming HTTP requests.
func CollectEvent ¶
CollectEvent collects event data to send to eventkit.
func GetAccessKeyID ¶
GetAccessKeyID returns the access key ID from the request and a signature validator.
func LogRequests ¶
LogRequests logs requests.
func LogResponses ¶
LogResponses logs responses.
func Metrics ¶
Metrics sends a bunch of useful metrics using monkit: - response time - time to write header - bytes written partitioned by method, status code, API.
It also sends unmapped errors (in the case of Gateway-MT) through eventkit.
TODO(artur): calculate approximate request size.
func MonitorMinioGlobalHandler ¶
func MonitorMinioGlobalHandler(i int, f mux.MiddlewareFunc) mux.MiddlewareFunc
MonitorMinioGlobalHandler adds monkit metrics atop minio middlewares.
func NewLogRequests ¶
func NewLogRequests(log *zap.Logger, insecureLogPaths bool) mux.MiddlewareFunc
NewLogRequests is a convenience wrapper around LogRequests that returns LogRequests as mux.MiddlewareFunc.
func NewLogResponses ¶
func NewLogResponses(log *zap.Logger, insecureLogPaths bool) mux.MiddlewareFunc
NewLogResponses is a convenience wrapper around LogResponses that returns LogResponses as mux.MiddlewareFunc.
func NewMetrics ¶
func NewMetrics(prefix string) mux.MiddlewareFunc
NewMetrics is a convenience wrapper around Metrics that returns Metrics with prefix as mux.MiddlewareFunc.
func ParseFromForm ¶
ParseFromForm parses V2 or V4 credentials from multipart form credentials.
func SerializeAccessLogConfig ¶ added in v1.84.0
func SerializeAccessLogConfig(config AccessLogConfig) ([]string, error)
SerializeAccessLogConfig serializes AccessLogConfig into a slice of strings.
Types ¶
type AccessLogConfig ¶ added in v1.84.0
type AccessLogConfig map[WatchedBucket]DestinationLogBucket
AccessLogConfig is a map of WatchedBucket to DestinationLogBucket configuration.
func ParseAccessLogConfig ¶ added in v1.84.0
func ParseAccessLogConfig(log *zap.Logger, config []string) (AccessLogConfig, error)
ParseAccessLogConfig parses a slice of strings representing access log configurations.
type Credentials ¶
type Credentials struct { AccessKey string authclient.AuthServiceResponse Error error }
Credentials contains an AccessKey, SecretKey, AccessGrant, and IsPublic flag.
func GetAccess ¶
func GetAccess(ctx context.Context) *Credentials
GetAccess returns the credentials.
type DestinationLogBucket ¶ added in v1.84.0
type DestinationLogBucket struct { BucketName string Storage accesslogs.Storage Prefix string }
DestinationLogBucket represents a destination bucket to store logs.
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter imposes a limit per key.
func NewLimiter ¶
func NewLimiter(allowed uint, keyFunc func(*http.Request) (string, error), limitFunc func(w http.ResponseWriter, r *http.Request)) *Limiter
NewLimiter constructs a concurrency Limiter. Error and Limit functions are user defined in part because referencing the "minio" package here would cause an import loop.
func NewMacaroonLimiter ¶
func NewMacaroonLimiter(allowed uint, limitFunc func(w http.ResponseWriter, r *http.Request)) *Limiter
NewMacaroonLimiter constructs a Limiter that limits based on macaroon credentials. It relies on the AccessKey middleware being run to append credentials to the request context.
type V2 ¶
V2 represents S3 V2 all security related data.
func ParseV2FromFormValues ¶
ParseV2FromFormValues parses a V2 signature from the multipart form parameters.
func ParseV2FromHeader ¶
ParseV2FromHeader parses a V2 signature from the request headers.
type V4 ¶
type V4 struct { Credential *V4Credential SignedHeaders []string Signature string ContentSHA256 string Date time.Time FromHeader bool }
V4 represents S3 V4 all security related data.
func ParseV4FromFormValues ¶
ParseV4FromFormValues parses a V4 signature from the multipart form parameters.
func ParseV4FromHeader ¶
ParseV4FromHeader parses a V4 signature from the request headers.
type V4Credential ¶
V4Credential represents S3 V4 protocol credentials.
func ParseV4Credential ¶
func ParseV4Credential(data string) (*V4Credential, error)
ParseV4Credential parses the credential into it's parts.
type WatchedBucket ¶ added in v1.84.0
WatchedBucket represents a bucket to collect logs from.