auth

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmzAlgorithm     = "X-Amz-Algorithm"
	AmzCredential    = "X-Amz-Credential"
	AmzSignature     = "X-Amz-Signature"
	AmzSignedHeaders = "X-Amz-SignedHeaders"
	AmzExpires       = "X-Amz-Expires"
	AmzDate          = "X-Amz-Date"
	AmzContentSHA256 = "X-Amz-Content-Sha256"
	AuthorizationHdr = "Authorization"
	ContentTypeHdr   = "Content-Type"

	UnsignedPayload                    = "UNSIGNED-PAYLOAD"
	StreamingUnsignedPayloadTrailer    = "STREAMING-UNSIGNED-PAYLOAD-TRAILER"
	StreamingContentSHA256             = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD"
	StreamingContentSHA256Trailer      = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER"
	StreamingContentECDSASHA256        = "STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD"
	StreamingContentECDSASHA256Trailer = "STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER"
)

Variables

Functions

func IsStandardContentSHA256 added in v0.29.0

func IsStandardContentSHA256(key string) bool

func MultipartFormValue

func MultipartFormValue(r *http.Request, key string) string

MultipartFormValue gets value by key from multipart form.

func PresignRequest added in v0.28.0

func PresignRequest(creds *credentials.Credentials, reqData RequestData, presignData PresignData) (*http.Request, error)

PresignRequest forms pre-signed request to access objects without aws credentials.

Types

type AuthHeader added in v0.28.0

type AuthHeader struct {
	AccessKeyID  string
	Service      string
	Region       string
	SignatureV4  string
	SignedFields []string
	Date         string
	IsPresigned  bool
	Expiration   time.Duration
}

type Center

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

func New

func New(creds tokens.Credentials, prefixes []string) *Center

New creates an instance of AuthCenter.

func (*Center) Authenticate

func (c *Center) Authenticate(r *http.Request) (*middleware.Box, error)

type PresignData added in v0.28.0

type PresignData struct {
	Service  string
	Region   string
	Lifetime time.Duration
	SignTime time.Time
}

type RegexpSubmatcher

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

func NewRegexpMatcher

func NewRegexpMatcher(re *regexp.Regexp) *RegexpSubmatcher

NewRegexpMatcher creates a new regexp sub matcher.

func (*RegexpSubmatcher) GetSubmatches

func (r *RegexpSubmatcher) GetSubmatches(target string) map[string]string

GetSubmatches returns matches from provided string. Zero length indicates no match.

type RequestData added in v0.28.0

type RequestData struct {
	Method   string
	Endpoint string
	Bucket   string
	Object   string
}

Directories

Path Synopsis
signer
v4
Package v4 implements signing for AWS V4 signer
Package v4 implements signing for AWS V4 signer

Jump to

Keyboard shortcuts

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