Documentation ¶
Index ¶
- Variables
- func Base64Decode(base64Data string) (string, error)
- func Base64Encode(data string) string
- func EncryptPassword(password string) (string, error)
- func ExtractToken(c *fiber.Ctx) (string, error)
- func Hash(url string) string
- func LoadCATLSCredentials(cert_path string) (credentials.TransportCredentials, error)
- func LoadServerTLSCredentials(cert_path string) (credentials.TransportCredentials, error)
- func NewToken(userId string) (string, error)
- func ParseToken(tokenString string) (*jwt.Token, error)
- func ValidateToken(tokenString string) (string, error)
- func VerifyPassword(hashed, password string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBase64Decode = errors.New("invalid base64 data")
)
View Source
var (
ErrInvalidToken = errors.New("invalid token")
)
Functions ¶
func Base64Decode ¶
Base64Decode provides base64 decoding.
func EncryptPassword ¶
LoadServerTLSCredentials provides encrypt of password.
func ExtractToken ¶
ExtractToken extracts the JWT token from the request header.
func LoadCATLSCredentials ¶
func LoadCATLSCredentials(cert_path string) (credentials.TransportCredentials, error)
LoadCATLSCredentials provides loading of cat tls credentials.
func LoadServerTLSCredentials ¶
func LoadServerTLSCredentials(cert_path string) (credentials.TransportCredentials, error)
LoadServerTLSCredentials provides loading of server tls credentials.
func ParseToken ¶
ParseToken parses and verifies the JWT token.
func ValidateToken ¶
ValidateToken validates the JWT token and returns the user ID.
func VerifyPassword ¶
LoadServerTLSCredentials provides verify of password.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.