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

Docs - Add policy description with required content for validateProperty on path to "*"

    Details

      Description

      https://ea.forgerock.com/docs/idm/objects-guide/policies-over-REST.html shows examples for validateProperty when the request is made directly to a specific user. There is special content required though when making a policy validation by REST to a resource url with "*".

      The content must contain the object details (since they wont be read) as well as the properties which are being evaluated.

      For example:
      Custom conditional policy:

      "password" : {
          ...
          "conditionalPolicies" : [
              {
                  "condition" : {
                      "type" : "text/javascript",
                      "source" : "(fullObject.description === 'test1')"
                  },
                  "dependencies" : [ "description" ],
                  "policies" : [
                      {
                          "policyId" : "at-least-X-capitals",
                          "params" : {
                              "numCaps" : 1
                          }
                      }
                  ]
              }
          ]
      

      The request to validate policy with _action=validateProperty to a "*" resource path should look like the following (both object and properties may contain additional fields, this is just a minimal example that satisfied the above conditional policy):

      curl \
      --header "X-OpenIDM-Username: openidm-admin" \
      --header "X-OpenIDM-Password: openidm-admin" \
      --header "Accept-API-Version: resource=1.0" \
      --header "Content-Type: application/json" \
      --request POST \
      --data '{
        "object": {
          "description": "test1"
        },
        "properties": {
          "password": "passw0rd"
        }
      }' \
      "http://localhost:8080/openidm/policy/managed/user/*?_action=validateProperty"
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                curtis.masuda Curtis Masuda
                Reporter:
                katie.gonzalez Katie Gonzalez
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: