Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type JWTAuthBind
- type JWTUser
- type PBKDF2Config
- type Redis
- type TestNoSecurity
Constants ¶
View Source
const IDKey = "aibou_id"
Variables ¶
View Source
var PBKDF2DefaultIter = 8192
View Source
var PBKDF2DefaultKeyLen = 20
View Source
var PBKDF2DefaultSaltLen = 64
View Source
var PBKDF2Hash = sha3.New512
View Source
var TestNoHashAuth = TestNoSecurity{}
Functions ¶
func SaltDefault ¶
func SaltDefault() (salt []byte)
Types ¶
type AuthBackend ¶
type AuthBackend interface { CheckID(string) bool CheckIDPBKDF2(string, string) bool Close() error }
var JWTAuthBackend AuthBackend = TestNoHashAuth
type JWTAuthBind ¶
type PBKDF2Config ¶
type PBKDF2Config struct { Pass []byte `json:"pass"` Salt []byte `json:"salt"` Iter int `json:"iter"` KeyLen int `json:"key_len"` }
func FromJSON ¶
func FromJSON(src []byte) (config PBKDF2Config, err error)
func (PBKDF2Config) Key ¶
func (config PBKDF2Config) Key() []byte
func (PBKDF2Config) ToJSON ¶
func (config PBKDF2Config) ToJSON() (src []byte)
type TestNoSecurity ¶
type TestNoSecurity struct{}
func (TestNoSecurity) CheckID ¶
func (t TestNoSecurity) CheckID(id string) bool
func (TestNoSecurity) CheckIDPBKDF2 ¶
func (t TestNoSecurity) CheckIDPBKDF2(id string, hash string) bool
func (TestNoSecurity) Close ¶
func (t TestNoSecurity) Close() error
Click to show internal directories.
Click to hide internal directories.