security

package
v0.0.0-...-aa65b62 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccessToken

func CheckAccessToken(accessToken, secret string) error

CheckAccessToken checks if access token is valid with given secret

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash checks given password with given hashed password

func CheckPasswordStructure

func CheckPasswordStructure(password string) (err error)

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

func CreateAuthorizationCode(login string) (authCode string, validUntil time.Time)

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

func HashPassword(password string) (string, error)

HashPassword hashes given password with bcrypt

func ValidateLoginStructure

func ValidateLoginStructure(login string) (err error)

ValidateLoginStructure validates login structure

Types

This section is empty.

Jump to

Keyboard shortcuts

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