Documentation ¶
Index ¶
- Constants
- func Check(f func() error)
- func GenerateEncryptedPassword(password []byte) (string, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func GetGender(s string) null.String
- func InitDB(attempts, retryMaxDelay int) (*gorm.DB, error)
- func InitMongoDB() (*mgo.Session, error)
- func RetrieveMailServiceAccessToken(expiration int) (string, error)
- func RetrieveV1Token(userID uint, email string) (string, error)
- func RetrieveV2AccessToken(userID uint, email string, expiration int) (string, error)
- func RetrieveV2IDToken(userID uint, email, firstName, lastName string, expiration int) (string, error)
- type AccessTokenJWTClaims
- type AuthTokenType
- type IDTokenJWTClaims
- type ReporterJWTClaims
Constants ¶
View Source
const ( IDTokenSubject = "ID_TOKEN" AccessTokenSubject = "ACCESS_TOKEN" )
Variables ¶
This section is empty.
Functions ¶
func GenerateEncryptedPassword ¶
GenerateEncryptedPassword returns encryptedly securely generated string.
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.
func InitMongoDB ¶
func InitMongoDB() (*mgo.Session, error)
InitMongoDB initiates the Mongo DB connection
func RetrieveMailServiceAccessToken ¶
RetrieveMailServiceAccessToken generate JWT for mail service validation
func RetrieveV2AccessToken ¶
Types ¶
type AccessTokenJWTClaims ¶
type AuthTokenType ¶
type AuthTokenType int
const ( AuthV1Token AuthTokenType = iota + 1 AuthV2IDToken AuthV2AccessToken )
type IDTokenJWTClaims ¶
type IDTokenJWTClaims struct { UserID uint `json:"user_id"` Email string `json:"email"` FirstName string `json:"first_name"` LastName string `json:"last_name"` jwt.StandardClaims }
IDToken
func (IDTokenJWTClaims) Valid ¶
func (idc IDTokenJWTClaims) Valid() error
type ReporterJWTClaims ¶
type ReporterJWTClaims struct { UserID uint `json:"user_id"` Email string `json:"email"` jwt.StandardClaims }
ReporterJWTClaims JWT claims we used
Click to show internal directories.
Click to hide internal directories.