forked from aws/amazon-ecs-agent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
37 lines (27 loc) · 771 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package authv4
import (
"github.com/aws/amazon-ecs-agent/agent/ecs_client/authv4/credentials"
"github.com/aws/amazon-ecs-agent/agent/ecs_client/authv4/sign"
"github.com/aws/amazon-ecs-agent/agent/ecs_client/authv4/signable"
"net/http"
)
type Signer interface {
Sign(signable.Signable) error
}
// Implements Signer
type DefaultSigner struct {
credentials.AWSCredentialProvider
Region, Service string
ExtraHeaders []string
Signer *sign.Signer
}
// Signs an http.Request by mutating it
type HttpSigner interface {
SignHttpRequest(*http.Request) error
}
// A signed round-tripper signs a request and subsequently returns a response.
type RoundTripperSigner http.RoundTripper
type DefaultRoundTripSigner struct {
HttpSigner
Transport http.RoundTripper
}