signatures

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZERO_SIGNATURE_NONCE_PREFIX = "ZERO_NONCE_"
	ZERO_SIGNATURE_NONCE_VALUE  = "cooling"

	HEADER_SIGNATURE_APP       = "ZoXappname"
	HEADER_SIGNATURE_SECRET    = "ZoXsecret"
	HEADER_SIGNATURE_NONCE     = "ZoXnonce"
	HEADER_SIGNATURE_TIMESTAMP = "ZoXtimestamp"
	HEADER_SIGNATURE_SIGN      = "ZoXsignature"

	SIGNATURE_RAW = "ZoXraw"

	SIGNATURE_OVERFLOW_TIME  = 600
	SIGNATURE_VALID_DURATION = 1200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroAppSecretFetcher

type ZeroAppSecretFetcher interface {
	FetchSecret(*ZeroSignature) string
}

type ZeroSignature

type ZeroSignature struct {
	ZoXappname   string
	ZoXsecret    string
	ZoXnonce     string
	ZoXtimestamp int64
	ZoXsignature string
	// contains filtered or unexported fields
}

func NewSignatureKeyValueParser

func NewSignatureKeyValueParser(req *http.Request, fetchers ...ZeroAppSecretFetcher) (*ZeroSignature, map[string]string, error)

func NewSignatureMaker

func NewSignatureMaker(appname, secret string) *ZeroSignature

func NewSignatureParser

func NewSignatureParser(xhttpreq *http.Request, fetchers ...ZeroAppSecretFetcher) (*ZeroSignature, error)

func NewSignatureRawParser

func NewSignatureRawParser(req *http.Request, fetchers ...ZeroAppSecretFetcher) (*ZeroSignature, *structs.ZeroRequest, error)

func NewSignatureStreamParser

func NewSignatureStreamParser(req *http.Request, maxmem int64, fetchers ...ZeroAppSecretFetcher) (*ZeroSignature, *server.XhttpFromFile, error)

func (*ZeroSignature) AddParam

func (zox *ZeroSignature) AddParam(k string, v string) *ZeroSignature

func (*ZeroSignature) AddParams

func (zox *ZeroSignature) AddParams(params map[string]string) *ZeroSignature

func (*ZeroSignature) AddRaw

func (zox *ZeroSignature) AddRaw(raw []byte) *ZeroSignature

func (*ZeroSignature) AddStream

func (zox *ZeroSignature) AddStream(name string, stream []byte) *ZeroSignature

func (*ZeroSignature) Check

func (zox *ZeroSignature) Check() error

func (*ZeroSignature) Complete

func (zox *ZeroSignature) Complete() error

func (*ZeroSignature) Xhttpreq added in v1.12.15

func (zox *ZeroSignature) Xhttpreq() *http.Request

Jump to

Keyboard shortcuts

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