diff --git a/pkg/provisioner/ironic/clients/auth_test.go b/pkg/provisioner/ironic/clients/auth_test.go index 2ef21834ed..b4b81efb85 100644 --- a/pkg/provisioner/ironic/clients/auth_test.go +++ b/pkg/provisioner/ironic/clients/auth_test.go @@ -1,10 +1,10 @@ package clients import ( - "testing" "os" "path" "path/filepath" + "testing" ) func TestConfigFromEndpointURL(t *testing.T) { @@ -119,12 +119,12 @@ func TestLoadAuth(t *testing.T) { return cleanup, err } - err = os.WriteFile(path.Join(authPath, "username"), []byte("testuser"), 0644) + err = os.WriteFile(path.Join(authPath, "username"), []byte("testuser"), 0600) if err != nil { return cleanup, err } - err = os.WriteFile(path.Join(authPath, "password"), []byte("testpassword"), 0644) + err = os.WriteFile(path.Join(authPath, "password"), []byte("testpassword"), 0600) if err != nil { return cleanup, err } @@ -182,7 +182,7 @@ func TestLoadAuth(t *testing.T) { defer cleanup() // Overwrite username file with empty content - err = os.WriteFile(path.Join(authRoot, "ironic", "username"), []byte(""), 0644) + err = os.WriteFile(path.Join(authRoot, "ironic", "username"), []byte(""), 0600) if err != nil { t.Fatalf("Failed to overwrite username file: %v", err) } @@ -202,7 +202,7 @@ func TestLoadAuth(t *testing.T) { defer cleanup() // Overwrite password file with empty content - err = os.WriteFile(path.Join(authRoot, "ironic", "password"), []byte(""), 0644) + err = os.WriteFile(path.Join(authRoot, "ironic", "password"), []byte(""), 0600) if err != nil { t.Fatalf("Failed to overwrite password file: %v", err) }