auth

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Cost defines the cost to use when hashing passwords

View Source
var Current byte = 0

Current version of the hashing algorithm; update this when the algorithm is changed

View Source
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

func HashPassword(cleartext string) (string, error)

HashPassword hashes a cleartext password to its hashed and salted value

func VerifyPassword added in v1.1.3

func VerifyPassword(hashed string, cleartext string) (bool, error)

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

Jump to

Keyboard shortcuts

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