sec

package
v0.0.0-...-007fb03 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPw

func CheckPw(h, p string) bool

CheckPw compares a bcrypt hash password against a clear text password.

func HashPwd

func HashPwd(p string) (string, error)

HashPwd returns the bcrypt hash of the supplied password. If something goes wrong (it shouldn't) this returns empty string along with an error.

func IssueJWT

func IssueJWT(sub uuid.UUID) (string, error)

IssueJWT creates a new token to be returned as part of a successful login response

func ParseJWT

func ParseJWT(t string) (jwt.MapClaims, error)

ParseJWT takes a token, validates it (and the algorithm used to sign it) and will return a slice of claims. If something went wrong and error will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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