shiro icon indicating copy to clipboard operation
shiro copied to clipboard

[SHIRO-849] Adds cache module for JCache

Open bdemers opened this issue 2 years ago • 1 comments

This will allow for any JCache implementation to work with Shiro, as well as new versions of EhCache & Hazelcast.

Fixes: SHIRO-816 Fixes: SHIRO-479

NOTE: This currently targets 1.8 (which would need to be bumped to 1.9 before merging) Going forward we could replace org.apache.shiro.cache with JCache, and update MemoryConstrainedCacheManager to be a safe fallback.

bdemers avatar Jan 14 '22 23:01 bdemers

Created issue: https://issues.apache.org/jira/browse/SHIRO-849 (fix version left unset for now, but we can fill it in once we move forward)

bdemers avatar Jan 24 '22 15:01 bdemers

LGTM. Can we move this forward? Thanks!

lprimak avatar Jan 26 '23 18:01 lprimak

I'm not sure what the osgi related config should be: https://github.com/apache/shiro/pull/332/files#diff-fe1d5bdae7660405b02de35c849a3f235600c2e7c318f64b8635accfabf4b1abR77-R81

I'm guessing the above is wrong (given the hazelcast package name) anyone want to take a pass at that part? After that I can clean it up (update the dependencies) and retarget main (potentially backporting where needed)

bdemers avatar Jan 26 '23 21:01 bdemers

Maybe we could replace synchronized(this) with an AtomicWrapper?

bmarwell avatar Jan 27 '23 05:01 bmarwell

I'm not sure what the osgi related config should be: https://github.com/apache/shiro/pull/332/files#diff-fe1d5bdae7660405b02de35c849a3f235600c2e7c318f64b8635accfabf4b1abR77-R81

I'm guessing the above is wrong (given the hazelcast package name) anyone want to take a pass at that part? After that I can clean it up (update the dependencies) and retarget main (potentially backporting where needed)

Let me take a look, we just need to import the jcache package to not depend on jcache implementation. For Hazelcast, user needs to install the hazelcast jcache osgi bundle.

I will make some tests.

fpapon avatar Jan 27 '23 08:01 fpapon

And agree, I will work on main branch first.

fpapon avatar Jan 27 '23 08:01 fpapon