utils

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: GPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.0.3

func Contains(a string, values []string) bool

func DecodeJWTPart added in v0.0.3

func DecodeJWTPart(part string) ([]byte, error)

decodeJWTPart decodes a JWT base64url part

func EpochToHumanDate added in v0.0.3

func EpochToHumanDate(epochTime int) string

func GenerateLegacyToken

func GenerateLegacyToken(res *http.Response, username, password string) string

func GenerateOTP added in v0.0.3

func GenerateOTP(secret string) string

GenerateOTP generates a TOTP code for the given secret.

func OTPPending added in v0.8.0

func OTPPending(claims map[string]interface{}) bool

OTPPending reports whether the claims belong to a token of a user with 2FA enabled whose OTP has not been verified yet.

func ParseUserJWT added in v0.8.0

func ParseUserJWT(tokenString, secret string) (jwtv5.MapClaims, error)

ParseUserJWT validates a user JWT (HS256 signature with secret and expiration) and returns its claims.

func PerformLogin added in v0.0.3

func PerformLogin(testServerURL string) string

func Remove added in v0.0.3

func Remove(a string, values []string) []string

func Setup2FA added in v0.0.3

func Setup2FA(testServerURL string, token string, t *testing.T) string

func Verify2FA added in v0.0.3

func Verify2FA(testServerURL string, otp string, token string, t *testing.T) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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