Documentation ¶
Overview ¶
Package awsauth implements AWS request signing using Signed Signature Version 2, Signed Signature Version 3, and Signed Signature Version 4. Supports S3 and STS.
Add a method for SigV4 signing of AWS IoT-Data MQTT-over-WebSocket URI. May be generalizeable to other services, or combine-able with S3 URI-signing, but the variability of SigV4 among services makes this tricky or inelegant.
Index ¶
- Variables
- func Sign(request *http.Request, credentials ...Credentials) *http.Request
- func Sign2(request *http.Request, credentials ...Credentials) *http.Request
- func Sign3(request *http.Request, credentials ...Credentials) *http.Request
- func Sign4(request *http.Request, credentials ...Credentials) *http.Request
- func Sign4WSIoTDataURL(rawURI string, credentials ...Credentials) string
- func SignCustomAPI(request *http.Request, region string, credentials ...Credentials) *http.Request
- func SignS3(request *http.Request, credentials ...Credentials) *http.Request
- func SignS3Url(request *http.Request, expire time.Time, credentials ...Credentials) *http.Request
- type Credentials
Constants ¶
This section is empty.
Variables ¶
var DEBUG_SignUrl bool = false
Prints debug-information (rather verbose)
Functions ¶
func Sign ¶
func Sign(request *http.Request, credentials ...Credentials) *http.Request
Sign signs a request bound for AWS. It automatically chooses the best authentication scheme based on the service the request is going to.
func Sign2 ¶
func Sign2(request *http.Request, credentials ...Credentials) *http.Request
Sign2 signs a request with Signed Signature Version 2. If the service you're accessing supports Version 4, use that instead.
func Sign3 ¶
func Sign3(request *http.Request, credentials ...Credentials) *http.Request
Sign3 signs a request with Signed Signature Version 3. If the service you're accessing supports Version 4, use that instead.
func Sign4 ¶
func Sign4(request *http.Request, credentials ...Credentials) *http.Request
Sign4 signs a request with Signed Signature Version 4.
func Sign4WSIoTDataURL ¶
func Sign4WSIoTDataURL(rawURI string, credentials ...Credentials) string
Take a bare URI and make a signed URI from it Input: something like...
wss://ABCD1234EFGH56.iot.us-east-1.amazonaws.com/mqtt
Output: something like...
wss://ABCD1234EFGH56.iot.us-east-1.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...
func SignCustomAPI ¶
SignCustomAPI signs a request to API Gateway behind a custom domain with Signed Signature Version 4.
func SignS3 ¶
func SignS3(request *http.Request, credentials ...Credentials) *http.Request
SignS3 signs a request bound for Amazon S3 using their custom HTTP authentication scheme.