auth_hmac

package
v0.0.0-...-f19b43f Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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) Config

func (a *AuthHmac) Config() interface{}

func (*AuthHmac) ErrorDescriptions

func (a *AuthHmac) ErrorDescriptions() map[string]string

func (*AuthHmac) ErrorProtocolCodes

func (a *AuthHmac) ErrorProtocolCodes() map[string]int

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.

func (*AuthHmac) Init

func (a *AuthHmac) Init(cfg config.Config, log logger.Logger, vld validator.Validator, configPath ...string) error

type AuthHmacConfig

type AuthHmacConfig struct {
}

type UserWithHmacSecret

type UserWithHmacSecret interface {
	HmacSecret() string
}

Jump to

Keyboard shortcuts

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