activemq-artemis/tests
Justin Bertram 90853409a0 ARTEMIS-2886 optimize security auth
Both authentication and authorization will hit the underlying security
repository (e.g. files, LDAP, etc.). For example, creating a JMS
connection and a consumer will result in 2 hits with the *same*
authentication request. This can cause unwanted (and unnecessary)
resource utilization, especially in the case of networked configuration
like LDAP.

There is already a rudimentary cache for authorization, but it is
cleared *totally* every 10 seconds by default (controlled via the
security-invalidation-interval setting), and it must be populated
initially which still results in duplicate auth requests.

This commit optimizes authentication and authorization via the following
changes:

 - Replace our home-grown cache with Google Guava's cache. This provides
simple caching with both time-based and size-based LRU eviction. See more
at https://github.com/google/guava/wiki/CachesExplained. I also thought
about using Caffeine, but we already have a dependency on Guava and the
cache implementions look to be negligibly different for this use-case.
 - Add caching for authentication. Both successful and unsuccessful
authentication attempts will be cached to spare the underlying security
repository as much as possible. Authenticated Subjects will be cached
and re-used whenever possible.
 - Authorization will used Subjects cached during authentication. If the
required Subject is not in the cache it will be fetched from the
underlying security repo.
 - Caching can be disabled by setting the security-invalidation-interval
to 0.
 - Cache sizes are configurable.
 - Management operations exist to inspect cache sizes at runtime.
2020-08-26 13:36:24 -05:00
..
activemq5-unit-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
artemis-test-support [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
compatibility-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
config ARTEMIS-2732 Logging cleanup 2020-04-23 17:49:08 -04:00
extra-tests NO-JIRA POM on extra-tests to 2.16.0-SNAPSHOT 2020-08-24 16:24:25 +02:00
integration-tests ARTEMIS-2886 optimize security auth 2020-08-26 13:36:24 -05:00
jms-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
joram-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
karaf-client-integration-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
performance-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
smoke-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
soak-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
stress-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
timing-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
unit-tests [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2020-08-24 16:03:24 +02:00