Class MsAzurePatchValueSubAttributeRebuilder

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

public class MsAzurePatchValueSubAttributeRebuilder extends Object
This class is a workaround handler in order to handle the broken patch requests of Microsoft Azure. Azure sends illegal patch requests that look like this:
 {
         "op": "Add",
         "path": "roles",
         "value": [
             {
                 "value": "{\"id\":\"827f0d2e-be15-4d8f-a8e3-f8697239c112\",
                            \"value\":\"DocumentMgmt-Admin\",
                            \"displayName\":\"DocumentMgmt Admin\"}"
             },
             {
                 "value": "{\"id\":\"8ae06bd4-35bb-4fcd-977e-14e074ad1192\",
                            \"value\":\"Admin\",
                            \"displayName\":\"Admin\"}"
             }
         ]
     }
 
The problem in this request is the nested value-attribute that should not be there. Instead, the request should look like this:
    {
         "op": "Add",
         "path": "roles",
         "value": [

             "{\"id\":\"827f0d2e-be15-4d8f-a8e3-f7697239c112\",
               \"value\":\"DocumentMgmt-BuyerAdmin\",
               \"displayName\":\"DocumentMgmt BuyerAdmin\"}",

             "{\"id\":\"8ae06bd4-35bb-4fcd-977e-12e074ad1192\",
               \"value\":\"Buyer-Admin\",
               \"displayName\":\"Buyer Admin\"}"
         ]
     }
 
Since:
07.10.2023
Author:
Pascal Knueppel
  • Constructor Details

    • MsAzurePatchValueSubAttributeRebuilder

      public MsAzurePatchValueSubAttributeRebuilder(PatchOp patchOp, List<String> patchValues)
  • Method Details

    • fixValues

      public List<String> fixValues()
      this method will try to resolve a PatchRequest as described in the class-documentation to its correct state
      Parameters:
      patchValues - the values sent in the PatchRequest
      Returns:
      the fixed values from the PatchRequest