XMLWordPrintableJSON

Details

    Description

      When building an LDAP IAuthenticator plugin I ran into a few issues when trying to reuse the AuthCache similar to how PasswordAuthenticator implements it. Most of the problems stemmed from the underlying cache being inaccessible and not being able to override initCache properly.

      Anyway, I've had a stab at refactoring AuthCache with the following improvements:

      1. Make it possible to extend and override all necessary methods (initCache, init, validate)
      2. Makes it possible to specify a CacheLoader rather than just a Function, allowing you to have a get/load that throws exceptions.
      3. Use AuthCache on its own rather than extending it for each use case (invalidate(K) moved to be part of MBean)
      4. Provided a builder that uses sane defaults so we don't have unnecessary repeated code everywhere

      The refactor made all the extensions of AuthCache unnecessary, so I've simplified those cases to use AuthCache and removed any classes extending AuthCache. I also removed some noop compatibility classes that were marked to be removed in 4.0.

      Also added some tests in AuthCacheTest.

      Attachments

        Activity

          People

            KurtG Kurt Greaves
            KurtG Kurt Greaves
            Kurt Greaves
            Sam Tunnicliffe
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: