Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-4012

getPolicyByName searches policy by serviceName, policyName simply by traverse all policies in RangerServicePoliciesCache instead of DB

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0, 2.4.0
    • Ranger

    Description

      getPolicyByName searches policy by serviceName, policyName simply by traverse all policies in RangerServicePoliciesCache. 

      We need to call the DB to fetch policy instead of calling RangerServicePoliciesCache

       

      However, It takes more time to search for policies from the cache when there are millions of policies

      As well as The above REST API sometimes gives stable data due to the deleted element is present in the Cache 

       

      In PublicAPIsv2 we add the API's which are available in ServiceREST as an API and the getPolicyByName is not available as an API in ServiceREST.
      getPolicyByName ---> (/api/service/{servicename}/policy/{policyname}) in PublicAPIsv2
      I guess we should add the below  API in ServiceREST also for the same.
      getPolicyByName ---> (/policies/service/{serviceName}/policy/{policyName}) in ServiceREST
       
       
      

       

      Attachments

        1. 0001-RANGER-4012-RANGER-4012-getPolicyByName-searches-pol.patch
          16 kB
          Ramachandran Krishnan
        2. getPolicyFromDB.png
          568 kB
          Ramachandran Krishnan
        3. Screenshot 2022-12-12 at 5.09.25 PM.png
          299 kB
          Ramachandran Krishnan
        4. Screenshot 2022-12-12 at 5.13.06 PM.png
          425 kB
          Ramachandran Krishnan

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ramackri Ramachandran Krishnan
            ramackri Ramachandran Krishnan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment