Conversation
|
Hmm. The app can both read (HTTP verb GET) and delete (HTTP verb DELETE) to the deprovision endpoint: This is what that should do: https://github.com/OpenConext/OpenConext-user-lifecycle/blob/7ac0445cb17cbb791d4fbd95491d9ecf049eae2c/docs/deprovision-information.md#required-api-endpoints This does not look like a the correct solution because the middleware function that is being called now does not distinguish between GET and DELETE: |
There was a problem hiding this comment.
See previous comment. It looks like the MW deprovision API does not adhere to the API that lifecycle expects (a GET only returns the user's info, it does not deprovision the user)
There was a problem hiding this comment.
Lifecycle: GET /deprovision/<collabPersonId>
> Middleware GET deprovision/<collabPersonId> 🔴 Does not exist.
DELETE /deprovision/<collabPersonId>
> DELETE deprovision/<collabPersonId> ✔️
DELETE /deprovision/<collabPersonId>/dry-run
> DELETE deprovision/<collabPersonId>/dry-run ✔️
Without taking the new GET from Peter into consideration, Pieter is right:
The GET deprovision/<collabPersonId> does not exist in middleware. User lifecycle implements in in code & documentation, but it does not work. So, if this is needed, we should add the new GET route to middleware, and return the data.
Usually, GET should not perform mutations, especially in the this context where DELETE is also used.
In summary, I think we should follow the lifecycle specifications.
@phavekes what's the reason for this PR? Is there another component besides user lifecycle that calls the deprovision endpoints on Middleware?
...
On the other hand, why is the GET even needed, if the DRY RUN returns the same data? (But then the dry run should just return no data)Another tweak:
The DELETE deprovision/<collabPersonId>/dry-run route in middleware should only accept DELETE requests. It currently accepts all http verbs.
To match other Openconext components, the deprovision API should also accept GET requetst