-
Notifications
You must be signed in to change notification settings - Fork 2
Add GET method to deprovision route #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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: Stepup-Middleware/src/Surfnet/StepupMiddleware/ApiBundle/Controller/DeprovisionController.php Lines 35 to 54 in 7230660
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johanib What do you think of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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