summaryrefslogtreecommitdiff
path: root/internal/authentication/file_user_provider_test.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2020-04-11 13:54:18 +1000
committerGitHub <noreply@github.com>2020-04-11 13:54:18 +1000
commitb3ce7fc37904476501980e1c7d9f4834f26e6376 (patch)
tree48692115cfc5b7b227416e6f357040928a9ca1f9 /internal/authentication/file_user_provider_test.go
parentb0f81380c250b5ee5d30c6321243953f0609ba4b (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_test.go')
-rw-r--r--internal/authentication/file_user_provider_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/authentication/file_user_provider_test.go b/internal/authentication/file_user_provider_test.go
index b55196b19..c60f3ee18 100644
--- a/internal/authentication/file_user_provider_test.go
+++ b/internal/authentication/file_user_provider_test.go
@@ -131,8 +131,8 @@ func TestShouldUpdatePasswordHashingAlgorithmToSHA512(t *testing.T) {
WithDatabase(UserDatabaseContent, func(path string) {
config := DefaultFileAuthenticationBackendConfiguration
config.Path = path
- config.PasswordHashing.Algorithm = "sha512"
- config.PasswordHashing.Iterations = 50000
+ config.Password.Algorithm = "sha512"
+ config.Password.Iterations = 50000
provider := NewFileUserProvider(&config)
assert.True(t, strings.HasPrefix(provider.database.Users["john"].HashedPassword, "{CRYPT}$argon2id$"))
@@ -223,13 +223,13 @@ func TestShouldSupportHashPasswordWithoutCRYPT(t *testing.T) {
var (
DefaultFileAuthenticationBackendConfiguration = schema.FileAuthenticationBackendConfiguration{
Path: "",
- PasswordHashing: &schema.PasswordHashingConfiguration{
- Iterations: schema.DefaultCIPasswordOptionsConfiguration.Iterations,
- KeyLength: schema.DefaultCIPasswordOptionsConfiguration.KeyLength,
- SaltLength: schema.DefaultCIPasswordOptionsConfiguration.SaltLength,
- Algorithm: schema.DefaultCIPasswordOptionsConfiguration.Algorithm,
- Memory: schema.DefaultCIPasswordOptionsConfiguration.Memory,
- Parallelism: schema.DefaultCIPasswordOptionsConfiguration.Parallelism,
+ Password: &schema.PasswordConfiguration{
+ Iterations: schema.DefaultCIPasswordConfiguration.Iterations,
+ KeyLength: schema.DefaultCIPasswordConfiguration.KeyLength,
+ SaltLength: schema.DefaultCIPasswordConfiguration.SaltLength,
+ Algorithm: schema.DefaultCIPasswordConfiguration.Algorithm,
+ Memory: schema.DefaultCIPasswordConfiguration.Memory,
+ Parallelism: schema.DefaultCIPasswordConfiguration.Parallelism,
},
}
)