Documentation ¶
Index ¶
- Constants
- type AuthHmac
- func (a *AuthHmac) Config() interface{}
- func (a *AuthHmac) ErrorDescriptions() map[string]string
- func (a *AuthHmac) ErrorProtocolCodes() map[string]int
- func (a *AuthHmac) Handle(ctx auth.AuthContext) (bool, error)
- func (a *AuthHmac) Init(cfg config.Config, log logger.Logger, vld validator.Validator, ...) error
- type AuthHmacConfig
- type UserWithHmacSecret
Constants ¶
View Source
const ErrorCodeInvalidHmac = "hmac_invalid"
View Source
const HmacParameter = "hmac"
View Source
const HmacProtocol = "hmac"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHmac ¶
type AuthHmac struct { auth.AuthHandlerBase AuthHmacConfig }
func (*AuthHmac) ErrorDescriptions ¶
func (*AuthHmac) ErrorProtocolCodes ¶
func (*AuthHmac) Handle ¶
func (a *AuthHmac) Handle(ctx auth.AuthContext) (bool, error)
Check HMAC in request. Call this handler after discovering user (ctx.AuthUser() must be not nil). HMAC secret must be set for the user. HMAC string is calculated as BASE64(HMAC_SHA256(RequestMethod,RequestPath,RequestContent)), where BASE64 is calculated with padding.
type AuthHmacConfig ¶
type AuthHmacConfig struct { }
type UserWithHmacSecret ¶
type UserWithHmacSecret interface {
HmacSecret() string
}
Click to show internal directories.
Click to hide internal directories.