Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cost int = bcrypt.DefaultCost
Cost defines the cost to use when hashing passwords
var Current byte = 0
Current version of the hashing algorithm; update this when the algorithm is changed
var VersionMismatch = errors.New("Version mismatch")
VersionMismatch is the error that is returned when a password matches but the version of the hashing algorithm is different from the one that generated the password
Functions ¶
func HashPassword ¶ added in v1.1.3
HashPassword hashes a cleartext password to its hashed and salted value
func VerifyPassword ¶ added in v1.1.3
VerifyPassword checks that the hashed version of a password matches its cleartext value. In the case of a match, true will be returned. In the case of a mismatch, false will be returned. If false is returned, an error is guaranteed. However, even if true is returned, an error may be present if the algorithm version that generated the password is different from the current version
Types ¶
type KMSJWTAccessGenerate ¶
type KMSJWTAccessGenerate struct {
// contains filtered or unexported fields
}
KMSJWTAccessGenerate allows for the generation of an access token using credentials pulled from KMS
func NewKMSJWTAccessGenerate ¶
func NewKMSJWTAccessGenerate(client jwtkms.KMSClient, keyID string, method jwt.SigningMethod) *KMSJWTAccessGenerate
NewKMSJWTAccessGenerate creates a new JWT access generator with the AWS config, key ID and signing method provided
func (*KMSJWTAccessGenerate) Token ¶
func (generate *KMSJWTAccessGenerate) Token(ctx context.Context, data *oauth2.GenerateBasic, isGenRefresh bool) (string, string, error)
Token generates a new access token from the OAuth2 basic generate information and a flag determining whether a refresh token should be generated or not