v1hmac

package
v0.0.0-...-97c5a11 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause, MIT Imports: 10 Imported by: 1

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

Jump to

Keyboard shortcuts

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