Closed mdilts closed 4 years ago
Arg! You are so right, thanks for catching this!
This was caused by my work on #29
Specifically these lines:
I need to be checking for the presence of an active value attribute; what is happening here is I'm depending on it being "truthy" but "false" is not truthy, so the check short circuits when supplying a value of false.
This needs to be updated to check for the presence of the value key, not the "truthiness" of it's value. Maybe something like this using has_key?
def valid_patch_operation?(operation)
operation["op"] == "replace" &&
operation["value"] &&
operation["value"].has_key?("active")
end
The PATCH endpoint is unable to deprovision someone using:
[{"op": "replace", "value": { "active": false }}]
This operation is returned as an invalid PATCH request. Setting “active” to true will reprovision a person successfully.
To repro: