auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package auth provides AWS Signature V4 authentication utilities shared between s3 and s3db packages.

Index

Constants

View Source
const (
	// TimeFormat is the full-width form to be used in the X-Amz-Date header.
	TimeFormat = "20060102T150405Z"

	// ShortTimeFormat is the shortened form used in credential scope.
	ShortTimeFormat = "20060102"
)

Variables

This section is empty.

Functions

func CanonicalQueryString

func CanonicalQueryString(queryParams map[string][]string) string

CanonicalQueryString creates the canonical query string according to AWS specs

func GenerateAuthHeaderReq

func GenerateAuthHeaderReq(accessKey, secretKey, timestamp, region, service string, req *http.Request) error

GenerateAuthHeaderReq signs an HTTP request using AWS Signature V4

func GetSigningKey

func GetSigningKey(secret, date, region, service string) []byte

GetSigningKey derives the signing key for AWS Signature V4

func HashSHA256

func HashSHA256(s string) string

HashSHA256 returns the hex-encoded SHA256 hash of the input

func HmacSHA256

func HmacSHA256(key []byte, data string) []byte

HmacSHA256 returns the HMAC-SHA256 of data using the given key

func HmacSHA256Hex

func HmacSHA256Hex(key []byte, data string) string

HmacSHA256Hex returns the hex-encoded HMAC-SHA256 of data using the given key

func UriEncode

func UriEncode(input string, encodeSlash bool) string

UriEncode follows AWS's specific requirements for canonical URI encoding

Types

This section is empty.

Jump to

Keyboard shortcuts

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