From 9a7756c6e4b4ddb945bede3ddb2dfbf241208915 Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Mon, 1 Jun 2020 23:56:47 -0600 Subject: caddyauth: Cache basicauth results (fixes #3462) (#3465) Cache capacity is currently hard-coded at 1000 with random eviction. It is enabled by default from Caddyfile configurations because I assume this is the most common preference. --- modules/caddyhttp/caddyauth/caddyfile.go | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/caddyhttp/caddyauth/caddyfile.go') diff --git a/modules/caddyhttp/caddyauth/caddyfile.go b/modules/caddyhttp/caddyauth/caddyfile.go index 9fe8a80..13e78fc 100644 --- a/modules/caddyhttp/caddyauth/caddyfile.go +++ b/modules/caddyhttp/caddyauth/caddyfile.go @@ -35,6 +35,7 @@ func init() { // If no hash algorithm is supplied, bcrypt will be assumed. func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) { var ba HTTPBasicAuth + ba.HashCache = new(Cache) for h.Next() { var cmp Comparer -- cgit v1.2.3