awsutl

package
v0.0.0-...-569481b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlgorithmKey = "X-Amz-Algorithm"
	AuthScheme   = "AWS4-HMAC-SHA256"

	ContentHashKey   = "X-Amz-Content-Sha256"
	EmptyContentHash = "UNSIGNED-PAYLOAD"

	QueryPrefix = "X-Amz-"

	CredentialEntryKey = "Credential"
	CredentialQueryKey = QueryPrefix + CredentialEntryKey

	SignedHeadersEntryKey = "SignedHeaders"
	SignedHeadersQueryKey = QueryPrefix + SignedHeadersEntryKey

	SignatureEntryKey = "Signature"
	SignatureQueryKey = QueryPrefix + SignatureEntryKey
)
View Source
const (
	TimeKey              = "X-Amz-Date"
	SigningDateKeyPrefix = "AWS4"
)

Variables

View Source
var (
	ErrUnknownAuthScheme          = errors.New("unknown AWS authorization scheme")
	ErrEmptyCredential            = errors.New("empty AWS credential")
	ErrEmptySignedHeaders         = errors.New("empty AWS signed headers")
	ErrEmptySignature             = errors.New("empty AWS signature")
	ErrEmptyContentHash           = errors.New("empty AWS content hash")
	ErrIncompleteCredentialFields = errors.New("incomplete AWS credential fields")
)

Functions

func SigChecker

func SigChecker(tenants api.Tenants, codec hyped.Codec) api.SigChecker

Types

type Authorization

type Authorization struct {
	Scheme        string
	Credential    *Credential
	SignedHeaders []string
	Signature     string
	ContentHash   string
}

func NewAuthorization

func NewAuthorization(r *http.Request) (*Authorization, error)

type Credential

type Credential struct {
	AccessKey api.AccessKey
	Date      string
	Region    string
	Service   string
	Suffix    string
}

func NewCredential

func NewCredential(raw string) (*Credential, error)

type Error

type Error struct {
	Status  int    `xml:"-"`
	Code    string `xml:",omitempty"`
	Message string `xml:",omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) StatusCode

func (e *Error) StatusCode() int

type S3Router

type S3Router struct {
	ListBuckets http.HandlerFunc
}

func (*S3Router) Route

func (r *S3Router) Route(req *http.Request) http.HandlerFunc

Jump to

Keyboard shortcuts

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