middleware

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var S3AuthCtxKey s3Context = "s3-auth"

S3AuthCtxKey flag if we have perform authorisation

Functions

This section is empty.

Types

type S3Auth

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

S3Auth middleware for performing validation of signed requests

func NewS3AuthMiddleware

func NewS3AuthMiddleware(mortConfig *config.Config) *S3Auth

NewS3AuthMiddleware returns S3 compatible authorization handler it can handle AWS v2 (S3 mode) and AWS v4 (only header mode without streaming)

func (*S3Auth) Handler

func (s *S3Auth) Handler(next http.Handler) http.Handler

Handler main method of S3AuthMiddleware it check if request should be signed. If so it create copy of request and calculate signature and compare result with user request if signature is correct request is passed to next handler otherwise it return 403

Jump to

Keyboard shortcuts

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