Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator represents an authentication.Authenticator implementation using v1HMAC signatures
func NewAuthenticator ¶
func NewAuthenticator(apiKeyID string, secretAPIKey string) (*Authenticator, error)
NewAuthenticator creates an Authenticator with the given apiKeyID and secretAPIKey
- The apiKeyID is an identifier for the secret API key. The apiKeyID can be retrieved from the Configuration Center This identifier is visible in the HTTP request and is also used to identify the correct account.
- secretAPIKey is a shared secret. The shared secret can be retrieved from the Configuration Center. An apiKeyID and secretAPIKey always go hand-in-hand, the difference is that secretAPIKey is never visible in the HTTP request. This secret is used as input for the HMAC algorithm.
func (Authenticator) GetAuthorization ¶
func (a Authenticator) GetAuthorization(httpMethod string, resourceURI url.URL, requestHeaders []communication.Header) (string, error)
GetAuthorization creates an authentication signature for the given httpMethod, resourceURI and requestHeaders
Click to show internal directories.
Click to hide internal directories.