Documentation ¶
Index ¶
- func CheckAccessToken(accessToken, secret string) error
- func CheckPasswordHash(password, hash string) bool
- func CheckPasswordStructure(password string) (err error)
- func CreateAccessToken(userID, login, secret string) (accessToken string, validUntil time.Time, err error)
- func CreateAuthorizationCode(login string) (authCode string, validUntil time.Time)
- func CreateRefreshToken(login, secret string) (refreshToken string, validUntil time.Time, err error)
- func HashPassword(password string) (string, error)
- func ValidateLoginStructure(login string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAccessToken ¶
CheckAccessToken checks if access token is valid with given secret
func CheckPasswordHash ¶
CheckPasswordHash checks given password with given hashed password
func CheckPasswordStructure ¶
CheckPasswordStructure checks if password has valid format
func CreateAccessToken ¶
func CreateAccessToken(userID, login, secret string) (accessToken string, validUntil time.Time, err error)
CreateAccessToken creates access token
func CreateAuthorizationCode ¶
CreateAuthorizationCode creates new auth code based on login
func CreateRefreshToken ¶
func CreateRefreshToken(login, secret string) (refreshToken string, validUntil time.Time, err error)
CreateRefreshToken creates refresh token
func HashPassword ¶
HashPassword hashes given password with bcrypt
func ValidateLoginStructure ¶
ValidateLoginStructure validates login structure
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.