Versions in this module Expand all Collapse all v1 v1.1.0 Apr 6, 2021 Changes in this version + const IDKey + var PBKDF2DefaultIter = 8192 + var PBKDF2DefaultKeyLen = 20 + var PBKDF2DefaultSaltLen = 64 + var PBKDF2Hash = sha3.New512 + var TestNoHashAuth = TestNoSecurity + func OK(c *gin.Context) error + func Salt(saltLen int) (salt []byte) + func SaltDefault() (salt []byte) + func SetupJWT(app *gin.Engine, middleware bool) gin.HandlerFunc + func User(c *gin.Context) (types.User, error) + type AuthBackend interface + CheckID func(string) bool + CheckIDPBKDF2 func(string, string) bool + Close func() error + var JWTAuthBackend AuthBackend = TestNoHashAuth + type JWTAuthBind struct + ID string + Pass string + type JWTUser struct + ID string + type PBKDF2Config struct + Iter int + KeyLen int + Pass []byte + Salt []byte + func FromJSON(src []byte) (config PBKDF2Config, err error) + func (config PBKDF2Config) Key() []byte + func (config PBKDF2Config) ToJSON() (src []byte) + type Redis struct + func NewRedis(opt godis.Option) *Redis + func (r *Redis) CheckID(id string) bool + func (r *Redis) CheckIDPBKDF2(id string, pass string) bool + func (r *Redis) Close() error + type TestNoSecurity struct + func (t TestNoSecurity) CheckID(id string) bool + func (t TestNoSecurity) CheckIDPBKDF2(id string, hash string) bool + func (t TestNoSecurity) Close() error