nonce

package
v0.19.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cache zerocache.Cache, opts ...Option) zeroapi.Handler

New 判断 nonce 是否有效,在一段时间内其不可重复 需要启用 cache 功能

Types

type Option

type Option struct {
	// Field nonce 字段名称,默认为 nonce
	Field string
	// 在一定时间内,nonce 不可以重复,单位 秒
	// 如果开启了 middleware/timestamp 验证,该时间 >= timestamp.Diff 即可
	Expire string
	// Enable 是否开启检测,默认 true
	Enable bool
	// PrefixNonce 在缓存中的前缀, 如 "nonce:"
	PrefixNonce string
}

Option ..

Jump to

Keyboard shortcuts

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