Documentation
¶
Index ¶
- func GenerateAccessToken() string
- func GenerateOTPCode(length int) int
- func GeneratePassword(length int) string
- func GetFirebaseUser(accessToken string) (*firebase.UserRecord, error)
- func GetSHA256(value string) string
- func HasPermission(c echo.Context, subject string) bool
- func InitCasbin(config CasbinConfig) error
- type CasbinConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAccessToken ¶
func GenerateAccessToken() string
Total: (SHA-256 of nano secs = 256 bits) + (32 random bytes) = 64 bytes
func GenerateOTPCode ¶
func GeneratePassword ¶
Generate a random password with a specific length. It returns an empty string if there is any error.
func GetFirebaseUser ¶
func GetFirebaseUser(accessToken string) (*firebase.UserRecord, error)
func HasPermission ¶
HasPermission return true if a subject has permission on a request
func InitCasbin ¶
func InitCasbin(config CasbinConfig) error
InitCasbin creates an enforcer via file. See `casbin.NewEnforcer` for more info.
Types ¶
type CasbinConfig ¶
Click to show internal directories.
Click to hide internal directories.