Problem
Secret.Data["htpasswd"] contains decoded file bytes, but ParseExternalHtpasswdLines base64-decodes its input again. Normal htpasswd content therefore fails parsing and external users can be lost. The create path also stores the base64 text returned by BuildHtpasswd directly in Secret.Data, instead of storing raw file content.
References
cmd/crc-agent/cluster.go:292-330
cmd/crc-agent/htpasswd.go:58-101
Suggested direction
Make htpasswd helpers use raw file content. Encode only at the JSON patch boundary, and store raw bytes in Secret.Data.
Tests
Add create and update tests that verify valid bcrypt content and preservation of an external user.
Problem
Secret.Data["htpasswd"]contains decoded file bytes, butParseExternalHtpasswdLinesbase64-decodes its input again. Normal htpasswd content therefore fails parsing and external users can be lost. The create path also stores the base64 text returned byBuildHtpasswddirectly inSecret.Data, instead of storing raw file content.References
cmd/crc-agent/cluster.go:292-330cmd/crc-agent/htpasswd.go:58-101Suggested direction
Make htpasswd helpers use raw file content. Encode only at the JSON patch boundary, and store raw bytes in Secret.Data.
Tests
Add create and update tests that verify valid bcrypt content and preservation of an external user.