summaryrefslogtreecommitdiff
path: root/internal/authentication/file_user_provider_test.go
diff options
context:
space:
mode:
authorClement Michaud <clement.michaud34@gmail.com>2019-12-27 17:55:00 +0100
committerClément Michaud <clement.michaud34@gmail.com>2019-12-28 09:08:54 +0100
commit1ee442e86f76ed368f96fcdcbded9bd724bab579 (patch)
treeafb56d085f60a66ac37ad34138e06c5ba6cc33b9 /internal/authentication/file_user_provider_test.go
parentd037fb2728ae41c026485d34017bb2c4dcd4a3c8 (diff)
Improve logs of password hashing to help troubleshoot issues.
Diffstat (limited to 'internal/authentication/file_user_provider_test.go')
-rw-r--r--internal/authentication/file_user_provider_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/authentication/file_user_provider_test.go b/internal/authentication/file_user_provider_test.go
index 01aea83ea..bb07fc4bf 100644
--- a/internal/authentication/file_user_provider_test.go
+++ b/internal/authentication/file_user_provider_test.go
@@ -98,6 +98,16 @@ func TestShouldRaiseWhenLoadingDatabaseWithBadSchemaForFirstTime(t *testing.T) {
})
}
+func TestShouldSupportHashPasswordWithoutCRYPT(t *testing.T) {
+ WithDatabase(UserDatabaseWithouCryptContent, func(path string) {
+ provider := NewFileUserProvider(path)
+ ok, err := provider.CheckUserPassword("john", "password")
+
+ assert.NoError(t, err)
+ assert.True(t, ok)
+ })
+}
+
var UserDatabaseContent = []byte(`
users:
john:
@@ -142,3 +152,16 @@ user:
- admins
- dev
`)
+
+var UserDatabaseWithouCryptContent = []byte(`
+users:
+ john:
+ password: "$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/"
+ email: john.doe@authelia.com
+ groups:
+ - admins
+ - dev
+ james:
+ password: "$6$rounds=500000$jgiCMRyGXzoqpxS3$w2pJeZnnH8bwW3zzvoMWtTRfQYsHbWbD/hquuQ5vUeIyl9gdwBIt6RWk2S6afBA0DPakbeWgD/4SZPiS0hYtU/"
+ email: james.dean@authelia.com
+`)