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

Update with PATCH and PUT on internal user are not working anymore since OPENIDM-11433

    XMLWordPrintable

    Details

    • Target Version/s:
    • Story Points:
      2
    • Sprint:
      OpenIDM Sprint 6.5-9

      Description

      Update with PATCH and PUT on internal user are not working anymore since this commit done for OPENIDM-11433

      Steps for PATCH:
      1) Create internal user

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"authzRoles":[{"_ref":"internal/role/openidm-admin"}],"password":"Th3passw0rd"}' --request PUT "http://localhost:8080/openidm/internal/user/user_patch"
      {"_id":"user_patch","_rev":"0"}
      

      2) update user with PATCH:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '[{"operation":"replace","field":"authzRoles","value":[{"_ref":"internal/role/openidm-authorized"}]}]' --request PATCH "http://localhost:8080/openidm/internal/user/user_patch"
      {"code":500,"reason":"Internal Server Error","message":"org.forgerock.json.resource.InternalServerErrorException: Internal Server Error"}
      

      and in the console:

      [218] Sep 24, 2018 12:11:15.563 PM org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3 lambda$handleRequestWithLogging$8
      WARNING: Resource exception: 500 Internal Server Error: "org.forgerock.json.resource.InternalServerErrorException: Internal Server Error"
      org.forgerock.json.resource.InternalServerErrorException: org.forgerock.json.resource.InternalServerErrorException: Internal Server Error
      	at org.forgerock.openidm.internal.InternalObjectSet.patchResourceById(InternalObjectSet.java:1221)
      	at org.forgerock.openidm.internal.InternalObjectSet.lambda$patchInstance$16(InternalObjectSet.java:419)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.internal.InternalObjectSet.patchInstance(InternalObjectSet.java:418)
      	at org.forgerock.json.resource.InterfaceCollectionInstance.handlePatch(InterfaceCollectionInstance.java:48)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:85)
      	at org.forgerock.json.resource.Resources$CollectionInstanceIdContextFilter.filterPatch(Resources.java:516)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.FilterChain.handlePatch(FilterChain.java:244)
      	at org.forgerock.json.resource.Router.handlePatch(Router.java:293)
      	at org.forgerock.openidm.internal.impl.InternalObjectSetRequestHandler.handlePatch(InternalObjectSetRequestHandler.java:93)
      

      And steps for PUT:
      1) Create internal user

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "If-None-Match: *" --header "Content-Type: application/json" --data '{"authzRoles":[{"_ref":"internal/role/openidm-admin"}],"password":"Th3passw0rd"}' --request PUT "http://localhost:8080/openidm/internal/user/put_without_rev"
      {"_id":"put_without_rev","_rev":"0"}
      

      2) update internal user with PUT

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"authzRoles":[{"_ref":"internal/role/openidm-authorized"}],"password":"Th3passw0rd"}' --request PUT "http://localhost:8080/openidm/internal/user/put_without_rev"
      Response Status Code: 500
      

        Attachments

          Activity

            People

            Assignee:
            whitney.hunter Whitney Hunter [X] (Inactive)
            Reporter:
            laurent.bristiel Laurent Bristiel [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: