Documentation ¶
Index ¶
- func Compare(hash, password string) bool
- func CreateAccessToken(dbClient db.Database, authCode *models.AuthCode) (*models.AccessToken, error)
- func CreateAuthorizationCode(dbClient db.Database, userID *protos.ObjectID, clientID string) (*models.AuthCode, error)
- func CreateKey(l int) (string, error)
- func CreateSession(dbClient db.Database, userID *protos.ObjectID, userAgent string, ...) (string, error)
- func DeleteOauthAccessToken(dbClient db.Database, token string) error
- func Hash(password string) (string, error)
- func ValidateAccessToken(dbClient db.Database, token string) (*protos.User, error)
- func ValidateAuthCode(dbClient db.Database, code string) (*models.AuthCode, error)
- func ValidateSession(dbClient db.Database, key string) (*protos.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccessToken ¶
func CreateAccessToken(dbClient db.Database, authCode *models.AuthCode) (*models.AccessToken, error)
CreateAccessToken creates and saves an access token with a year of validity
func CreateAuthorizationCode ¶
func CreateAuthorizationCode(dbClient db.Database, userID *protos.ObjectID, clientID string) (*models.AuthCode, error)
CreateAuthorizationCode creates and saves an authorization code with the client & user id
func CreateSession ¶
func CreateSession(dbClient db.Database, userID *protos.ObjectID, userAgent string, stayLoggedIn bool) (string, error)
CreateSession creates a session and stores it into database
func ValidateAccessToken ¶
ValidateAccessToken takes pointer to dbclient and token string to lookup and validate AccessToken
func ValidateAuthCode ¶
ValidateAuthCode takes pointer to db client and code string, finds the code and returns it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.