hmac

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyHMACAuthClientConfig = HMACAuthClientConfig{}
	EmptyHMACAuthServerConfig = HMACAuthServerConfig{}
)

Functions

func HMACAuthHandlerFunc

func HMACAuthHandlerFunc(cfg HMACAuthServerConfig, next http.HandlerFunc) http.HandlerFunc

func HMACKey

func HMACKey(sharedKey, data string) (string, error)

func HMACKeyBytes

func HMACKeyBytes(sharedKey, data string) ([]byte, error)

Types

type HMACAuthClientConfig

type HMACAuthClientConfig struct {
	HMACAuthCommonConfig `mapstructure:",squash"`
}

func (HMACAuthClientConfig) IsEmpty

func (c HMACAuthClientConfig) IsEmpty() bool

type HMACAuthCommonConfig

type HMACAuthCommonConfig struct {
	AllowInsecureHTTP bool `mapstructure:"allow-insecure-http"`
	// Inline shared key used to HMAC with value from HTTPHeader
	SharedKey string `mapstructure:"shared-key"`
	// Path to read shared key from
	SharedKeyPath string `mapstructure:"shared-key-path"`
	Data          string `mapstructure:"data"`
}

type HMACAuthServerConfig

type HMACAuthServerConfig struct {
	HMACAuthCommonConfig `mapstructure:",squash"`
	// HTTP Header to use as data input
	HTTPHeader string `mapstructure:"http-header"`
}

func (HMACAuthServerConfig) IsEmpty

func (c HMACAuthServerConfig) IsEmpty() bool

type HMACClientAuth

type HMACClientAuth struct {
	Config HMACAuthClientConfig
}

func (HMACClientAuth) AddAuth

func (a HMACClientAuth) AddAuth(req *http.Request) error

Jump to

Keyboard shortcuts

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