Documentation
¶
Index ¶
- func CreateHMACSignature(method, path string, body []byte, ...) (string, error)
- func CreateSignedRequest(method, url string, body []byte, clientID, secretKey string, algorithm string) (*http.Request, error)
- func HMACAuthMiddleware(cfg HMACConfig) func(http.Handler) http.Handler
- type HMACClientSecret
- type HMACConfig
- type HMACRouteRights
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHMACSignature ¶
func CreateHMACSignature(method, path string, body []byte, dateHeader, contentHash, clientID, secretKey string, algorithm string) (string, error)
CreateHMACSignature creates HMAC signature for request (for testing)
func CreateSignedRequest ¶
func CreateSignedRequest(method, url string, body []byte, clientID, secretKey string, algorithm string) (*http.Request, error)
CreateSignedRequest creates HTTP request with HMAC signature (for testing)
func HMACAuthMiddleware ¶
func HMACAuthMiddleware(cfg HMACConfig) func(http.Handler) http.Handler
HMACAuthMiddleware creates HMAC authentication middleware
Types ¶
type HMACClientSecret ¶
type HMACClientSecret struct {
ClientID string `json:"clientid"`
Secret string `json:"secret"`
Department string `json:"department"`
Descr string `json:"descr"`
}
HMACClientSecret represents client secret
type HMACConfig ¶
type HMACConfig interface {
GetClientSecrets() []HMACClientSecret
GetRouteRights() HMACRouteRights
GetAlgorithm() string
GetMaxAge() int
IsRequired() bool
}
HMACConfig interface for HMAC configuration
type HMACRouteRights ¶
HMACRouteRights represents route access rights for clients
Click to show internal directories.
Click to hide internal directories.