eclipse / kapua

Eclipse Public License 2.0
225 stars 160 forks source link

:fix: was caching the wrong list #3963

Closed dseurotech closed 9 months ago

dseurotech commented 9 months ago

Fix for the following stacktrace:

2024-02-07 08:32:19,592 [qtp1027007693-184] ERROR o.e.k.c.s.internal.cache.EntityCache - Cache exception
java.lang.NullPointerException: null
at org.redisson.jcache.JCache.putAsync(JCache.java:1064)
at org.redisson.jcache.JCache.put(JCache.java:1187)
at org.eclipse.kapua.commons.service.internal.cache.EntityCache.putList(EntityCache.java:92)
at org.eclipse.kapua.service.authorization.role.shiro.RolePermissionCachingRepository.findByRoleId(RolePermissionCachingRepository.java:66)
at org.eclipse.kapua.service.authorization.role.shiro.RolePermissionServiceImpl.lambda$findByRoleId$4(RolePermissionServiceImpl.java:162)
at org.eclipse.kapua.storage.TxManagerImpl.execute(TxManagerImpl.java:50)
at org.eclipse.kapua.service.authorization.role.shiro.RolePermissionServiceImpl.findByRoleId(RolePermissionServiceImpl.java:162)
at org.eclipse.kapua.service.authorization.shiro.KapuaAuthorizingRealm.lambda$doGetAuthorizationInfo$5(KapuaAuthorizingRealm.java:167)
at org.eclipse.kapua.commons.security.KapuaSecurityUtils.doPrivileged(KapuaSecurityUtils.java:116)
at org.eclipse.kapua.service.authorization.shiro.KapuaAuthorizingRealm.doGetAuthorizationInfo(KapuaAuthorizingRealm.java:167)
at org.apache.shiro.realm.AuthorizingRealm.getAuthorizationInfo(AuthorizingRealm.java:342)
at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:465)
at org.apache.shiro.authz.ModularRealmAuthorizer.isPermitted(ModularRealmAuthorizer.java:239)
at org.apache.shiro.mgt.AuthorizingSecurityManager.isPermitted(AuthorizingSecurityManager.java:117)
codecov[bot] commented 9 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0828ec9) 21.18% compared to head (409c6b3) 21.18%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/3963/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/3963?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #3963 +/- ## ========================================== Coverage 21.18% 21.18% Complexity 10 10 ========================================== Files 1938 1938 Lines 41181 41181 Branches 3780 3780 ========================================== + Hits 8724 8726 +2 + Misses 32051 32050 -1 + Partials 406 405 -1 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/3963?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...on/role/shiro/RolePermissionCachingRepository.java](https://app.codecov.io/gh/eclipse/kapua/pull/3963?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9zZWN1cml0eS9zaGlyby9zcmMvbWFpbi9qYXZhL29yZy9lY2xpcHNlL2thcHVhL3NlcnZpY2UvYXV0aG9yaXphdGlvbi9yb2xlL3NoaXJvL1JvbGVQZXJtaXNzaW9uQ2FjaGluZ1JlcG9zaXRvcnkuamF2YQ==) | `13.63% <0.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/3963/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)