boulder/wfe2
Jacob Hoffman-Andrews 1c573d592b
Add account cache to WFE (#5855)
Followup from #5839.

I chose groupcache/lru as our LRU cache implementation because it's part
of the golang org, written by one of the Go authors, and very simple
and easy to read.

This adds an `AccountGetter` interface that is implemented by both the
AccountCache and the SA. If the WFE config includes an AccountCache field,
it will wrap the SA in an AccountCache with the configured max size and
expiration time.

We set an expiration time on account cache entries because we want a
bounded amount of time that they may be stale by. This will be used in
conjunction with a delay on account-updating pathways to ensure we don't
allow authentication with a deactivated account or changed key.

The account cache stores corepb.Registration objects because protobufs
have an established way to do a deep copy. Deep copies are important so
the cache can maintain its own internal state and ensure nothing external
is modifying it.

As part of this process I changed construction of the WFE. Previously,
"SA" and "RA" were public fields that were mutated after construction. Now
they are parameters to the constructor, along with the new "accountGetter"
parameter.

The cache includes stats for requests categorized by hits and misses.
2021-12-15 11:10:23 -08:00
..
test Fix various WFE2 bugs. (#3292) 2017-12-19 13:13:29 -08:00
README.md Duplicate WFE to WFE2. (#2839) 2017-07-05 13:32:45 -07:00
cache.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00
cache_test.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00
prod_aia.go Remove wfe1 integration tests (#5840) 2021-12-10 12:40:22 -08:00
stale.go Unwrap SA Get[Pre]Certificate methods (#5588) 2021-08-19 15:43:48 -07:00
stale_test.go GRPC: Unwrap ra.DeactivateAuthorization (#5567) 2021-08-12 11:30:57 -07:00
stats.go Switch away from old style statsd metrics wrappers (#4606) 2019-12-18 11:08:25 -05:00
test_aia.go Remove wfe1 integration tests (#5840) 2021-12-10 12:40:22 -08:00
verify.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00
verify_test.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00
wfe.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00
wfe_test.go Add account cache to WFE (#5855) 2021-12-15 11:10:23 -08:00

README.md

WFE v2

The wfe2 package is copied from the wfe package in order to implement the "ACME v2" API. This design choice was made to facilitate a clean separation between v1 and v2 code and to support running a separate API process on a different port alongside the v1 API process.