mirror of
https://github.com/distribution/distribution.git
synced 2026-05-04 10:13:25 +00:00
- Added a dummy hash for nonexistent users to prevent timing attacks. - Updated test cases to include a nonexistent user scenario for better coverage. - Introduced a global dummy hash variable to streamline authentication for nonexistent users. - Updated the authentication logic to utilize the new dummy hash for improved consistency. - Added support for overriding the dummy hash in the access controller for testing purposes. - Updated the authentication logic to utilize the provided dummy hash during user authentication. - Updated test cases to use `t.TempDir()` for creating temporary htpasswd files, enhancing test isolation and cleanup. - Simplified file reading and error handling in the `TestCreateHtpasswdFile` function. Co-authored-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: HexMix <32300164+mnixry@users.noreply.github.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>