CAL-861 improve rest security filter