Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-11240

Backport OPENIDM-10758: openidm.read() returns different content if called from managed.json action or a custom endpoint

    Details

      Description

      When calling openidm.read() against a relationship, via a managed.json action, the following content is returned:

      Apr 24, 2018 10:54:23 AM org.forgerock.openidm.script.scope.FunctionFactory$1$3 call
      INFO: fullRelationship : {  }
      

      But when making the same call via a custom endpoint, the following is returned:

      Apr 24, 2018 10:54:30 AM org.forgerock.openidm.script.scope.FunctionFactory$1$3 call
      INFO: fullRelationship : { "_ref": "managed/user/f7711e40-5899-4c6f-8297-918e62579f80", "_refProperties": { "temporalConstraints": [  ], "_grantType": "", "_id": "b86f1109-44df-4787-b59b-c20677bd26f7", "_rev": "000000007dfb9cdc" }, "preferences": { "updates": false, "marketing": false }, "mail": "test@test.com", "sn": "testUser", "givenName": "testUser", "userName": "testUser", "accountStatus": "active", "lastChanged": { "date": "2018-04-24T09:54:05.850Z" }, "effectiveRoles": [ { "_ref": "managed/role/3c437246-599c-4536-bd7d-e73bd4bd16c9" } ], "effectiveAssignments": [  ], "_rev": "000000008f62a463", "_id": "f7711e40-5899-4c6f-8297-918e62579f80" }
      

      To re-produce:

      • Unzip OpenIDM 5.5.0
      • Copy the attached custom.js and customEndpoint.js to ../openidm/script
      • Copy the attached endpoint-custom.json to ../openidm/conf
      • Add the following to managed.json under the roles definition:
                  "actions" : {
                      "getmembers":{
                        "type":"text/javascript",
                        "source":"require('script/custom').getMembers(object);"
                      }
                  },
      
      • Start OpenIDM
      • Create a testUser, a testRole and associate them together as a provisioning role
      • Perform the following REST requests:
      GET http://localhost:8080/openidm/endpoint/custom?roleId=[role _id value]
      
      POST http://localhost:8080/openidm/managed/role/[role _id value]?_action=getmembers
      
      • Review openidm0.log.0

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mark.offutt Mark Offutt [X] (Inactive)
                Reporter:
                mark.offutt Mark Offutt [X] (Inactive)
                QA Assignee:
                Jakub Janoska [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: