@@ -19,7 +19,7 @@ func TestHTPasswdWatcherOriginal(t *testing.T) {
1919 username , _ := test .GenerateRandomString ()
2020 password1 , _ := test .GenerateRandomString ()
2121 password2 , _ := test .GenerateRandomString ()
22- htpasswdPath := test .MakeHtpasswdFileFromString (test .GetCredString (username , password1 ))
22+ htpasswdPath := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username , password1 ))
2323
2424 defer os .Remove (htpasswdPath )
2525
@@ -49,7 +49,7 @@ func TestHTPasswdWatcherOriginal(t *testing.T) {
4949 So (present , ShouldBeTrue )
5050
5151 // 2. Change file
52- err = os .WriteFile (htpasswdPath , []byte (test .GetCredString (username , password2 )), 0o600 )
52+ err = os .WriteFile (htpasswdPath , []byte (test .GetBcryptCredString (username , password2 )), 0o600 )
5353 So (err , ShouldBeNil )
5454
5555 // 3. Give some time for the background task
@@ -98,8 +98,8 @@ func TestHTPasswdWatcher(t *testing.T) {
9898 username2 , _ := test .GenerateRandomString ()
9999 password2 , _ := test .GenerateRandomString ()
100100
101- htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetCredString (username1 , password1 ))
102- htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetCredString (username2 , password2 ))
101+ htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username1 , password1 ))
102+ htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username2 , password2 ))
103103
104104 defer os .Remove (htpasswdPath1 )
105105 defer os .Remove (htpasswdPath2 )
@@ -150,15 +150,15 @@ func TestHTPasswdWatcher(t *testing.T) {
150150 So (present , ShouldBeTrue )
151151
152152 // Change file content and verify automatic reload
153- err = os .WriteFile (htpasswdPath1 , []byte (test .GetCredString (username1 , password2 )), 0o600 )
153+ err = os .WriteFile (htpasswdPath1 , []byte (test .GetBcryptCredString (username1 , password2 )), 0o600 )
154154 So (err , ShouldBeNil )
155155 time .Sleep (100 * time .Millisecond )
156156 ok , present = htp .Authenticate (username1 , password2 )
157157 So (ok , ShouldBeTrue )
158158 So (present , ShouldBeTrue )
159159
160160 // Test multiple users
161- multiUserContent := test .GetCredString (username1 , password1 ) + "\n " + test .GetCredString (username2 , password2 )
161+ multiUserContent := test .GetBcryptCredString (username1 , password1 ) + "\n " + test .GetBcryptCredString (username2 , password2 )
162162 err = os .WriteFile (htpasswdPath1 , []byte (multiUserContent ), 0o600 )
163163 So (err , ShouldBeNil )
164164 time .Sleep (100 * time .Millisecond )
@@ -194,8 +194,8 @@ func TestHTPasswdWatcher(t *testing.T) {
194194 username2 , _ := test .GenerateRandomString ()
195195 password2 , _ := test .GenerateRandomString ()
196196
197- htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetCredString (username1 , password1 ))
198- htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetCredString (username2 , password2 ))
197+ htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username1 , password1 ))
198+ htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username2 , password2 ))
199199
200200 defer os .Remove (htpasswdPath1 )
201201 defer os .Remove (htpasswdPath2 )
@@ -236,7 +236,7 @@ func TestHTPasswdWatcher(t *testing.T) {
236236 So (present , ShouldBeTrue )
237237
238238 // Test file rename (should not trigger reload)
239- htpasswdPath3 := test .MakeHtpasswdFileFromString (test .GetCredString (username1 , password1 ))
239+ htpasswdPath3 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username1 , password1 ))
240240 defer os .Remove (htpasswdPath3 )
241241 err = htw .ChangeFile (htpasswdPath3 )
242242 So (err , ShouldBeNil )
@@ -302,8 +302,8 @@ func TestHTPasswdWatcher(t *testing.T) {
302302 username2 , _ := test .GenerateRandomString ()
303303 password2 , _ := test .GenerateRandomString ()
304304
305- htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetCredString (username1 , password1 ))
306- htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetCredString (username2 , password2 ))
305+ htpasswdPath1 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username1 , password1 ))
306+ htpasswdPath2 := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username2 , password2 ))
307307
308308 defer os .Remove (htpasswdPath1 )
309309 defer os .Remove (htpasswdPath2 )
@@ -408,7 +408,7 @@ func TestHTPasswdWatcher(t *testing.T) {
408408 // Test 2: File watching with fsnotify resources cleanup
409409 username , _ := test .GenerateRandomString ()
410410 password , _ := test .GenerateRandomString ()
411- htpasswdPath := test .MakeHtpasswdFileFromString (test .GetCredString (username , password ))
411+ htpasswdPath := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username , password ))
412412
413413 defer os .Remove (htpasswdPath )
414414
@@ -490,7 +490,7 @@ func TestHTPasswdWatcher(t *testing.T) {
490490 So (test .WaitForLogMessages (logBuffer , "htpasswd watcher terminating..." , 1 , 5 * time .Second ), ShouldBeTrue )
491491
492492 // Test file with empty lines and comments
493- content := "\n \n " + test .GetCredString (username , password ) + "\n # comment\n "
493+ content := "\n \n " + test .GetBcryptCredString (username , password ) + "\n # comment\n "
494494 commentedPath := test .MakeHtpasswdFileFromString (content )
495495
496496 defer os .Remove (commentedPath )
@@ -520,7 +520,7 @@ func TestHTPasswdWatcher(t *testing.T) {
520520 So (err , ShouldBeNil )
521521
522522 // Load some initial data
523- htpasswdPath := test .MakeHtpasswdFileFromString (test .GetCredString (username , password ))
523+ htpasswdPath := test .MakeHtpasswdFileFromString (test .GetBcryptCredString (username , password ))
524524 defer os .Remove (htpasswdPath )
525525
526526 // Load initial file (this will populate the store)
0 commit comments