Documentation
¶
Overview ¶
Package s3sign builds SigV4 presigned URLs for S3 GET requests, offline and with the standard library only: the secret key never leaves the machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePath ¶
EncodePath encodes a decoded path for SigV4 and the URL: each segment on its own, the slashes kept and never collapsed.
func PathStyle ¶
PathStyle is the path of `key` in `bucket` on a path-style endpoint: "/bucket/key".
func PresignGet ¶
PresignGet returns the presigned GET URL. Only the host header is signed and the payload is UNSIGNED-PAYLOAD, like the AWS SDKs do for presigned URLs.
Types ¶
type Request ¶
type Request struct {
// Endpoint is the scheme and host (and port), e.g. https://eu.cubestorage.io.
Endpoint string
Region string
// Path is the decoded request path, e.g. "/photos/a/report.pdf". It is encoded per
// segment as S3 does: slashes are kept, everything but A-Z a-z 0-9 - . _ ~ is %XX.
Path string
AccessKey string
SecretKey string
Expires time.Duration
Now time.Time
}
Request is what a presigned GET signs.