Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNonceNotInRange = errors.New("submitted nonce is not in acceptable range")
ErrNonceNotInRange error when nonce not in acceptable range.
Functions ¶
func NewAuthenticator ¶
func NewAuthenticator(keyPairs ...KeyPair) (*httpsign.Authenticator, error)
NewAuthenticator create a httpsign.Authenticator to check the message signing is valid or not
Types ¶
type NonceValidator ¶
type NonceValidator struct { // MaxTimeGap is max time different between client submit timestamp // and server time that considered valid. The time precision is millisecond. MaxTimeGap time.Duration }
NonceValidator checking validate by time range
func NewNonceValidator ¶
func NewNonceValidator(options ...NonceValidatorOption) *NonceValidator
NewNonceValidator return NonceValidator with default value (30 second)
type NonceValidatorOption ¶
type NonceValidatorOption func(*NonceValidator)
NonceValidatorOption is the option of Nonce Validator constructor.
func NonceValidatorWithMaxTimeGap ¶
func NonceValidatorWithMaxTimeGap(gap time.Duration) NonceValidatorOption
NonceValidatorWithMaxTimeGap is the option to create NonceValidator with custom time gap.
Click to show internal directories.
Click to hide internal directories.