Open mdesmet opened 1 year ago
I'd prefer if we made the defaults more useful instead of adding hooks for custom behaviour and leaving users to implement them themselves.
It seems default should be to cache based on identity (which is what Trino itself seems to do).
I'd prefer if we made the defaults more useful instead of adding hooks for custom behaviour and leaving users to implement them themselves.
That won't work in a distributed web application. You would need to store and retrieve the tokens in a distributed cache (eg redis) as every request may be handled by different nodes.
It seems default should be to cache based on identity (which is what Trino itself seems to do).
This is not entirely true. The user is not required in the connect(args)
for OAuth connections. Without the user we would only be able to retrieve the identity by running a SELECT CURRENT_USER()
query.
Fixes #223