Skip to content

Use raw htpasswd content consistently in crc-agent #34

Description

@caxu-rh

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions