auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnsignedPayload  = "UNSIGNED-PAYLOAD"
	StreamingPayload = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD"
)

Variables

This section is empty.

Functions

func BuildCanonicalHeaders

func BuildCanonicalHeaders(r *http.Request, auth *SigV4Authorization) map[string]string

func BuildCanonicalQueryString

func BuildCanonicalQueryString(rawQuery string) string

func BuildCanonicalURI

func BuildCanonicalURI(path string) string

func ComputeSignature

func ComputeSignature(cred *SigV4Credential, stringToSign string) (string, error)

Types

type SigV4Authorization

type SigV4Authorization struct {
	Credential    *SigV4Credential
	SignedHeaders []string
	Signature     string
}

func (*SigV4Authorization) String

func (auth *SigV4Authorization) String() string

type SigV4Chunk

type SigV4Chunk struct {
	Ctx    *SigV4Context
	Header *SigV4ChunkHeader
	Data   []byte
}

func (*SigV4Chunk) BuildChunkStringToSign

func (chunk *SigV4Chunk) BuildChunkStringToSign() string

type SigV4ChunkDecoder

type SigV4ChunkDecoder struct {
	Src io.ReadCloser
	// contains filtered or unexported fields
}

func NewSigV4ChunkedDecoder

func NewSigV4ChunkedDecoder(ctx *SigV4Context, src io.ReadCloser) *SigV4ChunkDecoder

func (*SigV4ChunkDecoder) Close

func (dec *SigV4ChunkDecoder) Close() error

func (*SigV4ChunkDecoder) Read

func (dec *SigV4ChunkDecoder) Read(buf []byte) (int, error)

type SigV4ChunkHeader

type SigV4ChunkHeader struct {
	Size      int
	Signature string
}

type SigV4Context

type SigV4Context struct {
	Signature   string
	Credential  *SigV4Credential
	Timestamp   string
	IsStreaming bool
}

func VerifySigV4

func VerifySigV4(r *http.Request) (*SigV4Context, error)

type SigV4Credential

type SigV4Credential struct {
	AccessKey string
	SecretKey string
	Scope     string
}

type SigV4Request

type SigV4Request struct {
	Method               string
	CanonicalURI         string
	CanonicalQueryString string
	CanonicalHeaders     map[string]string
	Authorization        *SigV4Authorization
	Timestamp            string
	PayloadHash          string
}

func (*SigV4Request) BuildStringToSign

func (req *SigV4Request) BuildStringToSign() string

Jump to

Keyboard shortcuts

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