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

PATCH operation REMOVE doesn't return error response on nonexistent value in array

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not a defect
    • OpenIDM 5.0.0
    • None
    • documentation
    • OpenIDM
      5.0.0-SNAPSHOT (revision: 1f66c8c), LDAP connector
      1.4.1.2 rev.73349ffff896b1613b2bbaaf0437248cb700032f, LDAP connector 1.4.2.0-SNAPSHOT rev.4ca635f076f41425a46b98cce1202093500689bb,
      OpenDJ 3.5.0 Build 20160711133456

    Description

      OpenIDM doesn't return expected error response, when remove patch operation is used on nonexisting value in array. OpenIDM logs contains connectors exception (see below)

      LDAP object

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '{"dn": "uid=b_1473155113,ou=people,dc=example,dc=com", "uid": "b_1473155113", "cn":"b_1473155113", "sn":"b_1473155113", "description": "Foo", "objectClass": ["person","inetOrgPerson","organizationalPerson","top"], "ldapGroups": ["cn=a_1473155113,ou=groups,dc=example,dc=com"], "mail": "mail@test.com", "telephoneNumber": "123456789", "givenName": "b_1473155113"}' --request POST "http://localhost:8080/openidm/system/ldap/account/?_action=create"
      
      {"_id":"uid=b_1473155113,ou=people,dc=example,dc=com","disabled":null,"employeeType":null,"mail":"mail@test.com","telephoneNumber":"123456789","cn":"b_1473155113","uid":"b_1473155113","description":"Foo","givenName":"b_1473155113","objectClass":["person","inetOrgPerson","organizationalPerson","top"],"ldapGroups":["cn=a_1473155113,ou=groups,dc=example,dc=com"],"sn":"b_1473155113","dn":"uid=b_1473155113,ou=people,dc=example,dc=com"}
      

      Patch remove

      curl --header "Content-Type: application/json" --header "X-OpenIDM-Password: openidm-admin" --header "X-OpenIDM-Username: openidm-admin" --data '[{"operation":"remove","field":"/ldapGroups","value":"cn=nonexisting,ou=groups,dc=example,dc=com"}]' --request PATCH "http://localhost:8080/openidm/system/ldap/account/uid=b_1473155113,ou=people,dc=example,dc=com"
      
      {"_id":"uid=b_1473155113,ou=people,dc=example,dc=com","disabled":null,"employeeType":null,"mail":"mail@test.com","telephoneNumber":"123456789","cn":"b_1473155113","uid":"b_1473155113","description":"Foo","givenName":"b_1473155113","objectClass":["person","inetOrgPerson","organizationalPerson","top"],"ldapGroups":["cn=a_1473155113,ou=groups,dc=example,dc=com"],"sn":"b_1473155113","dn":"uid=b_1473155113,ou=people,dc=example,dc=com"}
      

      OpenIDM log file with connector exception

      FINE: Exception:        Method: removeAttributeValues
      org.identityconnectors.framework.common.exceptions.ConnectorException: javax.naming.NameNotFoundException: [LDAP: error code 32 - Entry cn=nonexisting,ou=groups,dc=example,dc=com cannot be modified because no such entry exists in the serv
      er]; remaining name 'cn=nonexisting,ou=groups,dc=example,dc=com'
              at org.identityconnectors.ldap.GroupHelper.removeMemberFromGroup(GroupHelper.java:214)
              at org.identityconnectors.ldap.GroupHelper.removeLdapGroupMemberships(GroupHelper.java:108)
              at org.identityconnectors.ldap.modify.LdapUpdate.removeAttributeValues(LdapUpdate.java:258)
              at org.identityconnectors.ldap.LdapConnector.removeAttributeValues(LdapConnector.java:258)
              at org.identityconnectors.framework.impl.api.local.operations.UpdateImpl.removeAttributeValues(UpdateImpl.java:133)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:104)
              at com.sun.proxy.$Proxy30.removeAttributeValues(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      

      Attachments

        Activity

          People

            Lana Lana Frost
            michal.orlik@profiq.cz Michal Orlik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: