diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2020-04-11 13:54:18 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-11 13:54:18 +1000 |
| commit | b3ce7fc37904476501980e1c7d9f4834f26e6376 (patch) | |
| tree | 48692115cfc5b7b227416e6f357040928a9ca1f9 /internal/authentication/file_user_provider.go | |
| parent | b0f81380c250b5ee5d30c6321243953f0609ba4b (diff) | |
[BUGFIX] Password hashing schema map mismatch with docs (#852)
* add a nolint for gosec 'possibly hardcoded password' that was incorrect
* make all parameters consistent
* update the docs for the correct key name 'password' instead of 'password_options' or 'password_hashing'
* reword some of the docs
* apply suggestions from code review
Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
Diffstat (limited to 'internal/authentication/file_user_provider.go')
| -rw-r--r-- | internal/authentication/file_user_provider.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/authentication/file_user_provider.go b/internal/authentication/file_user_provider.go index 58fd82dab..b2467fdb5 100644 --- a/internal/authentication/file_user_provider.go +++ b/internal/authentication/file_user_provider.go @@ -118,18 +118,18 @@ func (p *FileUserProvider) UpdatePassword(username string, newPassword string) e } var algorithm string - if p.configuration.PasswordHashing.Algorithm == "argon2id" { + if p.configuration.Password.Algorithm == "argon2id" { algorithm = HashingAlgorithmArgon2id - } else if p.configuration.PasswordHashing.Algorithm == "sha512" { + } else if p.configuration.Password.Algorithm == "sha512" { algorithm = HashingAlgorithmSHA512 } else { return errors.New("Invalid algorithm in configuration. It should be `argon2id` or `sha512`") } hash, err := HashPassword( - newPassword, "", algorithm, p.configuration.PasswordHashing.Iterations, - p.configuration.PasswordHashing.Memory*1024, p.configuration.PasswordHashing.Parallelism, - p.configuration.PasswordHashing.KeyLength, p.configuration.PasswordHashing.SaltLength) + newPassword, "", algorithm, p.configuration.Password.Iterations, + p.configuration.Password.Memory*1024, p.configuration.Password.Parallelism, + p.configuration.Password.KeyLength, p.configuration.Password.SaltLength) if err != nil { return err |
