I have to design REST services for security sensitive resources that require dual control. What is an elegant way to design the REST services that implement dual control?
Dual Control
With dual control I mean that a change only becomes effective if multiple people (e.g. 2) were involved in the change.
For example, I have resource called userProfile. It defines all things a user is allowed to do. If someone wants to change such a profile, it can propose a change to it. This change then has to be verified. The result of this verification is either "Approve" or "Reject". Once a change has been approved it becomes effective.
Design
I currently have a userProfile resource and a userProfileChangeProposal resource.
creating a proposal to create a userprofile happens through
POST /userprofiles
This returns the ID of the userprofile. It can now be verified using that {id}
PUT /userprofiles/{id}/changeproposal
Deleting or updating the userprofile requires a proposal again, so:
DELETE /userprofiles/{id}
PUT /userprofiles/{id}
These changes can be verified again via: (there can only be 1 proposal at the same time for a userprofile)
PUT /userprofiles/{id}/changeproposal
Issues
The thing I'm struggling with is that the rest operations seem to operate on the userprofile resource, but in fact they dont. A delete doesn't directly delete the resource. It creates a proposal to delete it. Also, this approach doesn't allow direct deletion of a userprofile.
On the other hand, if all changes occur through change proposals, then all create/delete/update actions are just
CREATE /userprofilechangeproposal
I havent seen anything on the internet regarding dual control design. The closest was that someone first creates an ORDER resource and only after the order has been approved the actual CAR is created.
Anyone has any best practices?