Uploaded image for project: 'OpenAM Agents'
  1. OpenAM Agents
  2. AMAGENTS-2214

New Policy Cache Mode: Polices are downloaded although mode is disabled

    XMLWordPrintable

    Details

      Description

      Bug description

      New Policy Cache Mode: Polices are downloaded although mode is disabled.

      How to reproduce the issue

      1.) Create policy in AM

      2.) Set ENV variable e.g AM_POLICY_CACHE_DIR=/opt/cache (on nginx need to be set in nginx.conf = env AM_POLICY_CACHE_DIR=/opt/cache; )

      Note: By default new policy cache mode is disabled, for sure you can set env variable: AM_POLICY_CACHE_MODE=off

      3.) Start web server

      4.) Hit the agent protected page

      Expected behaviour
      Should be used the old policy mod and policies are not downloaded 
      Current behaviour
      Policy is has been downloaded in specified directory
      
      cat /opt/cache/policy_3263908671.json
      {"result":[{"_id":"aaaa","_rev":"1544169121051","name":"aaaa","active":true,"description":"","applicationName":"iPlanetAMWebAgentService","actionValues":{"POST":true,"GET":true},"resources":["*://*:*/index.html"],"subject":{"type":"AuthenticatedUsers"},"resourceTypeUuid":"76656a38-5f8e-401b-83aa-4ccb74ce88d2","lastModifiedBy":"id=amadmin,ou=user,dc=openam,dc=forgerock,dc=org","lastModifiedDate":"2018-12-07T07:52:01.51Z","createdBy":"id=amadmin,ou=user,dc=openam,dc=forgerock,dc=org","creationDate":"2018-12-07T07:51:47.414Z"}],"resultCount":1,"pagedResultsCookie":null,"totalPagedResultsPolicy":"NONE","totalPagedResults":-1,"remainingPagedResults":0
      

       In the system log (after increasing log level) is possible to see request to AM

      2018-12-07 07:52:27 GMT DEBUG   [45b8896e-a06c-cb49-a914-db4cf0866ea5]: (source/sdk_base.c:180) http request to openam.localtest.me:8443
      GET /am/json/realms/root/policies?_queryFilter=applicationName%20eq%20%22iPlanetAMWebAgentService%22 HTTP/1.1
      Host: openam.localtest.me:8443
      User-Agent: OpenAM Web Agent/5.5.0-SNAPSHOT
      Accept: application/json
      Content-Type: application/json; charset=UTF-8
      iPlanetDirectoryPro: zuOw-xMFLf0t9aXW-LsWyAAeD8E.*AAJTSQACMDEAAlNLABxMSmx5Y2tSR0tIOFUxVEozcVZFaDZaZW0wSXc9AAR0eXBlAANDVFMAAlMxAAA.*
      Connection: Close
      X-ForgeRock-TransactionId: 45b8896e-a06c-cb49-a914-db4cf0866ea5/4
      
      
      2018-12-07 07:52:27 GMT DEBUG   [45b8896e-a06c-cb49-a914-db4cf0866ea5]: (source/net_ssl.c:779) net_ssl_msg_callback(): SSL negotiation finished successfully (SSLOK )
      2018-12-07 07:52:27 GMT DEBUG   [45b8896e-a06c-cb49-a914-db4cf0866ea5]: (source/net_ssl.c:779) net_ssl_msg_callback(): SSL negotiation finished successfully (SSLOK )
      2018-12-07 07:52:27 GMT DEBUG   [45b8896e-a06c-cb49-a914-db4cf0866ea5]: (source/sdk_base.c:222) http response 200 from openam.localtest.me:8443
      X-Frame-Options: SAMEORIGIN
      Cache-Control: no-cache
      Content-API-Version: protocol=2.1,resource=2.1
      Content-API-Version: resource=2.1
      X-Content-Type-Options: nosniff
      Content-Type: application/json;charset=UTF-8
      Content-Length: 655
      Date: Fri, 07 Dec 2018 07:52:27 GMT
      Connection: close
      {"result":[{"_id":"aaaa","_rev":"1544169121051","name":"aaaa","active":true,"description":"","applicationName":"iPlanetAMWebAgentService","actionValues":{"POST":true,"GET":true},"resources":["*://*:*/index.html"],"subject":{"type":"AuthenticatedUsers"},"resourceTypeUuid":"76656a38-5f8e-401b-83aa-4ccb74ce88d2","lastModifiedBy":"id=amadmin,ou=user,dc=openam,dc=forgerock,dc=org","lastModifiedDate":"2018-12-07T07:52:01.51Z","createdBy":"id=amadmin,ou=user,dc=openam,dc=forgerock,dc=org","creationDate":"2018-12-07T07:51:47.414Z"}],"resultCount":1,"pagedResultsCookie":null,"totalPagedResultsPolicy":"NONE","totalPagedResults":-1,"remainingPagedResults":0}
      

        Attachments

          Activity

            People

            Assignee:
            nick.james Nicholas James
            Reporter:
            richard.hruza Richard Hruza
            QA Assignee:
            Richard Hruza Richard Hruza
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: