Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDateNotInRange = newPublicError("Date submit is not in acceptable range")
ErrDateNotInRange error when date not in acceptable range
View Source
var ErrInvalidDigest = &gin.Error{ Err: errors.New("sha256 of body is not match with digest"), Type: gin.ErrorTypePublic, }
ErrInvalidDigest error when sha256 of body do not match with submitted digest
Functions ¶
This section is empty.
Types ¶
type DateValidator ¶
type DateValidator struct { // TimeGap is max time different between client submit timestamp // and server time that considered valid. The time precision is millisecond. TimeGap time.Duration }
DateValidator checking validate by time range
func NewDateValidator ¶
func NewDateValidator() *DateValidator
NewDateValidator return DateValidator with default value (30 second)
func (*DateValidator) Validate ¶
func (v *DateValidator) Validate(r *http.Request) error
Validate return error when checking if header date is valid or not
type DigestValidator ¶
type DigestValidator struct{}
DigestValidator checking digest in header match body
func NewDigestValidator ¶
func NewDigestValidator() *DigestValidator
NewDigestValidator return pointer of new DigestValidator
func (*DigestValidator) Validate ¶
func (v *DigestValidator) Validate(r *http.Request) error
Validate return error when checking digest match body
Click to show internal directories.
Click to hide internal directories.