GitHub user snoopdave opened a pull request:
https://github.com/apache/usergrid/pull/393
Cache expensively calculated Shiro authentication info in Cassandra
This PR introduces a new Cache<K, V> module that caches into a new
Cassandra column family and an Apache Shiro CacheManager implementation that is
backed by the new cache. The cache module is scoped by application so we can
invalidate all of an application's data in one shot. Each application's cache
is stored in one row and the cache key is used as the column name.
Whenever a role is granted or revoked, permissions change or a new app is
added, the cache for the associated application is invalidated.
Also, the PR includes a complete refactor of the Realm class. Logic that
was coded into a huge if-instanceof-then-else structure has now been moved into
the Principal classes, so each principal now knows how to calculate its own
permissions.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/usergrid usergrid-1007-shiro-cache
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/usergrid/pull/393.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #393
----
commit 0149864190ad4d80a509962671a2b50bbf946df5
Author: Dave Johnson <[email protected]>
Date: 2015-09-16T16:35:16Z
Beginnings of a new Cache module and classes for plugging it into Shiro.
commit af5d260ef9b33cd4001b831f01b10b175eb16351
Author: Dave Johnson <[email protected]>
Date: 2015-09-20T20:43:46Z
Merge branch 'two-dot-o-dev' into usergrid-1007-shiro-cache
Conflicts:
stack/rest/src/test/resources/log4j.properties
commit 6f5db8082618ed0e1d5256fab779273640b0dc68
Author: Dave Johnson <[email protected]>
Date: 2015-09-21T14:57:58Z
Cache now working with ExpandingShardLocator and BucketScopedRowKey fun.
commit 39f49d869c1892702c41d996589a710956276659
Author: Dave Johnson <[email protected]>
Date: 2015-09-21T18:37:31Z
Make ttl mandatory and add more tests.
commit ee66318c5394f9d17f707bc10bb7d5939e9dabe2
Author: Dave Johnson <[email protected]>
Date: 2015-09-21T18:38:02Z
Merge branch 'two-dot-o-dev' into usergrid-1007-shiro-cache
commit 08934c2df0b86897cf59d78fb117e6cf788e5ea3
Author: Dave Johnson <[email protected]>
Date: 2015-09-21T20:40:15Z
Merge branch 'two-dot-o-dev' into usergrid-1007-shiro-cache
commit dc7681f471aee41148c1931cf55f976a29d1a99e
Author: Dave Johnson <[email protected]>
Date: 2015-09-22T15:15:26Z
Plug our Cassandra backed auth-info cache into Shiro, some tests are
failing with the new cache.
commit b75e8325bd980b3769a64a86e6ec5e3ed956213b
Author: Dave Johnson <[email protected]>
Date: 2015-09-22T20:27:30Z
Couple more steps to hook in our cache for Shiro.
commit 17ff2db98a1b210ab637df39c7c27d00a4e2ee6e
Author: Dave Johnson <[email protected]>
Date: 2015-09-22T20:27:59Z
Merge branch 'two-dot-o-dev' into usergrid-1007-shiro-cache
commit 648763854a50c7dd8bb0abe2440c89aee781de9f
Author: Dave Johnson <[email protected]>
Date: 2015-09-24T18:34:59Z
Refactor Realm to move principal related logic into Principal class
hierarchy, also fixed serialization of AuthC and AuthZ info objects; tests
still failing...
commit 02fb362e7c9ae9f4efffce4ef390148c7aff5125
Author: Dave Johnson <[email protected]>
Date: 2015-09-28T13:17:54Z
Merge branch 'master' into usergrid-1007-shiro-cache
commit b9a7ab1c07d989f94ea457d5804825561fc33ded
Author: Dave Johnson <[email protected]>
Date: 2015-09-29T14:24:46Z
Adding cache invalidation at all the right places and support for all
Principal types makes all tests run except for one.
This guy still fails:
PermissionsResourceIT.getNonExistantEntityReturns404:213 expected:<404> but
was:<401>
commit 0f979e9c433ea9753fa580d6ae000bfa97669ae7
Author: Dave Johnson <[email protected]>
Date: 2015-09-29T16:19:32Z
Add support for ApplicationGuestPrincipal; all tests now passing with Shiro
Cache.
commit 030335d699aae370a6830deac6d9302cc679d56c
Author: Dave Johnson <[email protected]>
Date: 2015-09-29T21:08:38Z
Adding new "usergrid.auth.cache.time-to-live=3600" property to control
Shiro Cache timeout.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---