go-authcrunch
go-authcrunch copied to clipboard
feature: fast-path for password match in basicauth [non token mode]
When non-token authentication, e.g direct basicauth is used via the caddy security plugin, each request currently has to go through the costly bcrypt.CompareHashAndPassword
method resulting in ~ 4s latency to each call:
https://github.com/greenpau/go-authcrunch/blob/50f3edc60f01348d580c769761097734f4f0527e/pkg/identity/password.go#L117
Adding a cached fast-path as in the core caddyauth module would significantly improve the call latency for the follow-up requests:
https://github.com/caddyserver/caddy/blob/3b3d67871446ee6bf1921938ef0f16b6112c7ceb/modules/caddyhttp/caddyauth/basicauth.go#L186