security

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccessToken

func CreateAccessToken(ident *datatypes.UUID, duration time.Duration, scope *string) (string, error)

CreateAccessToken creates a new JWT token

func CreateRefreshToken

func CreateRefreshToken(ident *datatypes.UUID, duration time.Duration, scope *string) (string, error)

CreateRefreshToken creates a new JWT token

func GetClaimsIfAccessTokenIsValid

func GetClaimsIfAccessTokenIsValid(tokenString string) (*jwt.MapClaims, error)

GetClaimsIfAccessTokenIsValid validates this token and get the ISS claim

func GetClaimsIfRefreshTokenIsValid

func GetClaimsIfRefreshTokenIsValid(tokenString string) (*jwt.MapClaims, error)

GetClaimsIfRefreshTokenIsValid validates this token and get the ISS claim

func GetVerifiedAuthUser added in v0.1.36

func GetVerifiedAuthUser(userModel models.IModel) (models.IModel, bool)

GetVerifiedAuthUser authenticates the user

func HashAndSalt

func HashAndSalt(pwd string) (string, error)

HashAndSalt turns password into encrypted hash The salt is included in the hash

func IsSamePassword

func IsSamePassword(plainPwd string, hashedPwd string) bool

IsSamePassword checks if password is the same as in the db

Types

This section is empty.

Jump to

Keyboard shortcuts

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