Class MsAzurePatchFilterWorkaround

java.lang.Object
de.captaingoldfish.scim.sdk.server.patch.msazure.MsAzurePatchFilterWorkaround

public class MsAzurePatchFilterWorkaround extends Object
Since:
05.02.2023
Author:
Pascal Knueppel
  • Constructor Details

    • MsAzurePatchFilterWorkaround

      public MsAzurePatchFilterWorkaround()
  • Method Details

    • createAttributeFromPatchFilter

      public ScimObjectNode createAttributeFromPatchFilter(AttributePathRoot path)
      this method is a workaround for MsAzures expected behaviour that a value is added to a multivalued complex node if it is reference in a patch-filter but not added within the attribute itself
       {
         "schemas": [
           "urn:ietf:params:scim:api:messages:2.0:PatchOp"
         ],
         "Operations": [
           {
             "op": "add",
             "path": "emails[type eq \"work\"].value",
             "value": "max@mustermann.de"
           }
         ]
       }
       
      must be rebuilt to:
       {
         "schemas": [
           "urn:ietf:params:scim:api:messages:2.0:PatchOp"
         ],
         "Operations": [
           {
             "op": "add",
             "path": "emails[type eq \"work\"].value",
             "value": [
                {
                   "value": "max@mustermann.de"
                },
                {
                   "type": "work"
                }
             ]
           }
         ]
       }
       
      The complete rebuild is not done within this method. This method will simply create the last objectNode from the filter-expression:
        {
          "type": "work"
        }
       
      Parameters:
      path - the patch filter expression node.
      Returns:
      the