Class MsAzureWorkaroundHandler


  • public final class MsAzureWorkaroundHandler
    extends Object
    This class is a workaround handler in order to handle the broken patch requests of Microsoft Azure. Azure sends illegal patch-remove requests that looks as follows:
     PATCH /scim/Groups/2752513
     {
         "schemas": [
             "urn:ietf:params:scim:api:messages:2.0:PatchOp"
         ],
         "Operations": [
             {
                 "op": "Remove",
                 "path": "members",
                 "value": [
                     {
                         "value": "2392066"
                     }
                 ]
             }
         ]
     }
     
    the value in the request must not be present. Instead the request should look like this:
     PATCH /scim/Groups/2752513
     {
         "schemas": [
             "urn:ietf:params:scim:api:messages:2.0:PatchOp"
         ],
         "Operations": [
             {
                 "op": "Remove",
                 "path": "members[value eq \"2392066\"]"
             }
         ]
     }
     
    This class will try its best to fix the bad request and turn it into a valid request
    Since:
    07.06.2021
    Author:
    Pascal Knueppel
    • Constructor Detail

      • MsAzureWorkaroundHandler

        public MsAzureWorkaroundHandler​(PatchOp patchOp,
                                        String path,
                                        List<String> values)
    • Method Detail

      • fixPath

        public String fixPath()
        tries to build a valid path operation from the illegal Azure request. If a new path is created it will also clear the values list in order to bypass the validation successfully
        Returns:
        the original path if the request not illegal or the path could not be fixed or a new fixed path