Implement a caching auth provider
We have a couple of auth provider implementations now which basically do the same thing when asked for a token:
- check local cache file and its validity (in terms of time expiry)
- if valid, great
- if not valid, fetch new token and cache it
Would be nice for webtau to have some sort of helper class/utils to make this easier and reduce the duplication.
Sounds like a good idea. On the other hand webtau doesn't know anything about auth at the moment. It has header provider and navigation page open handlers.
True, may require a bit of refactoring or building an auth specific helper but something like CachingHeaderProvider might work; the auth header could as easily be cached as the auth token.
it will work for http header with a decorator. Will not help with page browser open handler as it has imperative logic, not declarative.