-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DEVEX-2333]: Implement caching using dynamo #183
[DEVEX-2333]: Implement caching using dynamo #183
Conversation
32f1a3f
to
1b53bae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a first batch of comments (mainly typos). I like the idea of returning a RefreshingToken
and then having all the logic there
I have yet to understand how the various kinds of caches are configured but nice work 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumb question: what if the users create the table themselves but the key is not called key
and the value is not token
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stuff breaks. I guess we can document the table setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I would absolutely do that then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done to the best of my ability. I don't know that much about aws though
let redis_conn = config.cache_type().redis_connection_url().to_string(); | ||
let encryption_key = config.token_encryption_key().to_string(); | ||
Box::new( | ||
cache::RedisCache::new(redis_conn, encryption_key) | ||
.await | ||
.map_err(Into::<CacheError>::into)?, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got lost in the code but why does this default to the RedisCache
? Backwards compatibility...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that's what we did before
Co-authored-by: Cristiano Piemontese <cristiano.piemontese@prima.it>
Co-authored-by: Cristiano Piemontese <cristiano.piemontese@prima.it>
Co-authored-by: Cristiano Piemontese <cristiano.piemontese@prima.it>
82e39e7
to
577bf47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put the redis cache behind a feature flag (on by default)? 🤔
Aside from that, the only thing I would do is add a bit of examples in the docs of how to configure the various caches or in general document this as much as possible
doing that without breaking backwards compat is really weird and I don't really wanna think about it
Would you mind if we made that a separate task? I think the documentation on docs.rs makes these features fairly easy to discover and I've spent so much time on this card that I'd really like to just get it done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely fine with the code docs and eventually tackling this in a separate card 🚀
https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/DEVEX-2333
I guess this is done. Idk I'm tired of this library, I don't wanna touch it anymore