utils

package
v0.0.0-...-04c0119 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PASSWORD_MAX_LENGTH = 24
View Source
const PASSWORD_MIN_LENGTH = 8

Variables

This section is empty.

Functions

func GetIssuerFromCookie

func GetIssuerFromCookie(r *http.Request, cookieName string, jwtSecret []byte) (string, error)

GetIssuerFromCookie is a helper function that takes a request and tht JWT_SECRET_TOKEN to retrieve the issuer and an error if any occured.

func PasswordIsValid

func PasswordIsValid(password string) bool

PasswordIsValid checks for a password validity.

Returns false if:

  • the password is too short (less than 8 characters)
  • the password is too long (more than 24 characters)
  • the password contains no upper case character
  • the password contains no lower case character
  • the password contains no number
  • the password contains no special character

Types

This section is empty.

Jump to

Keyboard shortcuts

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