Uploaded image for project: 'mod-authtoken'
  1. mod-authtoken
  2. MODAT-49

Two caches for permissionsForUser and expandPermissions

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      CP: sprint 73
    • Story Points:
      3
    • Development Team:
      Core: Platform

      Description

      Adam wrote on https://github.com/folio-org/mod-authtoken/pull/53 :

      Note that the caching is still sub optimal.. There should be two cache entries.. Not one.

      The first (and existing one) should cache the result of getPermissionsForUser. So the key obviously depends on user and tenant.

      The second is the call toexpandPermissions. It does NOT depend on the user. This is important. The cache entry for that one can have a long TTL, because it only depends on ModuleDescriptors enabled for the tenant. These rarely changes!!!

      I think the code would also be clearer if it was a simple "intercept" of those calls. Since the former have a short TTL it makes the 2nd call being called at times where that is not necessary.

      If the cache are separate it also means the CacheEntry is simpler.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                adam Adam Dickmeiss
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases