mozilla / PyFxA

Python library for interacting with the Firefox Accounts ecosystem
Other
31 stars 20 forks source link

Add a Client cache and a basic MemoryCache to not verify at each call. #13

Closed Natim closed 9 years ago

Natim commented 9 years ago

@rfk do you agree on the approach?

almet commented 9 years ago

Relevant: https://github.com/mozilla/PyBrowserID/blob/master/browserid/supportdoc.py#L117-L204

rfk commented 9 years ago

Thanks for diving into this. I like the idea of a swappable Cache class so we can do different backends. I wonder if we should just bake this into the base oauth.Client class, since it won't hurt and almost everyone will want it.

Maybe something like:

Thoughts?

Natim commented 9 years ago

Ok let's do that.

Natim commented 9 years ago

Updated.

rfk commented 9 years ago

Great stuff, thanks @Natim. r+ with one nit and one suggestion.

Natim commented 9 years ago

Thank you @rfk. I have updated the PR with your comments.

rfk commented 9 years ago

In future we should iterate on the cache class here, to e.g. enforce a max size as a guard against DOS attacks. Given the short ttls the initial version should be fine though.