Bug 1976779 - rsclientcerts: make each backend responsible for rate-limiting calls to find_objects r=jschanck
Before this patch, `rsclientcerts::manager` would rate-limit calls to
`find_objects` to once every 3 seconds because the underlying operation can be
time-consuming (in particular, on macOS and Windows, if there are many
certificates/keys available). On Android, keys aren't available until the user
selects one, which means that if a call to `find_objects` happened before the
selection prompt was shown (which is what happens) and the user chose one in
less than 3 seconds, the backend wouldn't search again, thus making it seem like
no keys were available, which would cause Firefox to not send a client
certificate. This patch makes each backend implementation responsible for this
rate-limiting, because only they know if it's appropriate to do so (in particular,
on Android, `find_objects` doesn't have the same performance concern as
on macOS and Windows because rather than searching for certificates and
keys, it asks `ClientAuthCertificateManager` for the cached list of certificates
and keys that have already been approved for use by the user).
Differential Revision: https://phabricator.services.mozilla.com/D257065
<!DOCTYPE html><body><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><script>// Here's the set-up for this test:// Step 1 (first window) Open new window to try setting cookie and clearing site data.// Step 2 (second window) Message first window with cookies present after load.// Step 3 (first window) Asserts cookies not present.async_test(t=>{// Step 3window.addEventListener("message",t.step_func(e=>{assert_equals(e.data,"");t.done();}),{once:true});// Step 1new_window=window.open("/clear-site-data/support/clear-site-data-cookie.py?location=after&target=cookies");t.add_cleanup(new_window.close);},"Setting a cookie after Clear-Site-Data for cookies shouldn't allow the cookie to take.");</script></body></html>