Repository navigation
feat: implement abstract cache service to allow support for flexible caching system, as well as support for multiple tokens - #3
Closed
ZejdCicak wants to merge 2 commits into
Conversation
…caching system, as well as support for multiple tokens
ZejdCicak
force-pushed
the
feat/add-support-for-multiple-tokens
branch
2 times, most recently
from
July 18, 2025 01:38
e020842 to
feaea4a
Compare
ZejdCicak
force-pushed
the
feat/add-support-for-multiple-tokens
branch
from
July 22, 2025 16:00
feaea4a to
acba110
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new caching mechanism by implementing an abstract base class for cache services and integrating it into the
moloni/base/client.pymodule. The changes improve code modularity and flexibility by allowing different caching strategies to be used. Below are the key changes:Addition of Cache Abstraction and Implementation
AbstractCacheServicewith methodsget,set, andget_keyto define a contract for cache services. (moloni/base/client.py, moloni/base/client.pyR16-R48)CacheServiceclass that extendsAbstractCacheServiceand usesTTLCachefor caching functionality. (moloni/base/client.py, moloni/base/client.pyR16-R48)Integration of Cache Service in the Client
__init__method of the client to accept an optionalAbstractCacheServiceinstance. If none is provided, a defaultCacheServiceis instantiated. (moloni/base/client.py, moloni/base/client.pyR64-R86)get_authmethod to leverage the new cache service for retrieving and storing tokens, replacing the previous direct use ofTTLCache. (moloni/base/client.py, moloni/base/client.pyR64-R86)