ksn135/htpasswd-bundle
Symfony bundle for HTTP Basic authentication backed by Apache-style htpasswd files. Protect routes with existing credentials, configure user file paths, and add htpasswd-based access control to Symfony applications.
htpasswd-format file. That is a ~50–150 line middleware/event listener plus a password_verify() call. This package is a reference implementation for scoping that work, not a dependency worth carrying.auth.basic middleware — this package does not enter that comparison at all.Consider it only when all of the following hold:
htpasswd files, typically produced by the Apache htpasswd utility, and want to avoid migrating them.bcrypt/$apr1$/SHA formats) before it touches anything real.Look elsewhere — or build in-house — when any of these apply:
htpasswd files give you none of these.bcrypt/argon2 with modern cost factors. htpasswd's default formats are dated, and interop with a modern hasher is not free.To executives: This is a small, unmaintained Symfony 2 add-on that lets an app check usernames and passwords stored in a plain htpasswd file. It is not a candidate for adoption — it's a candidate for replication. The capability is a few dozen lines of code, so paying for it in the form of an unsupported third-party dependency (3 stars, no downstream users, tied to an end-of-life framework) is a bad trade. Its real value to us is as a trigger: it tells us which of our systems still authenticate people against flat files, and that's a security and modernization item for the roadmap.
To engineering: Treat this as a spec, not a library. If we need htpasswd-style Basic auth on a legacy Symfony 2 app, implement a small kernel event listener that reads the file once, caches it, and uses hash_equals() for constant-time comparison. Budget half a day. If we need it on anything current, use the framework's native Basic auth middleware and a real user provider — do not port this bundle forward.
Bottom line for the decision log: Recommend do not adopt. Recommend do build a minimal in-house equivalent if the legacy need is confirmed, and do schedule a migration off file-based credentials for anything beyond staging.
How can I help you explore Laravel packages today?