Skip to content
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

User XML configuration persistence #380

Merged
merged 15 commits into from
Apr 18, 2019

Conversation

rlebre
Copy link
Member

@rlebre rlebre commented Mar 26, 2019

Improvements in the User servlets:

  1. Delete user is now in accordance with REST, i.e. receiving parameter as PathParam
  2. Users added by webservice are now persisted in the users.xml file

Small improvement: .gitnore now contains MacOS files and folders

rlebre added 4 commits March 24, 2019 20:22
Login and Logout Servlets do not throw useless exceptions
PUT REST service replaced with proper POST method to add users
add users are now persisted in the xml file
@Enet4 Enet4 changed the title Imp/user xml persitence User XML configuration persistence Mar 26, 2019
Copy link
Collaborator

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of those classes where a refactoring like the one in #284 would have been beneficial. In the mean time, I am not opposed to adding this fix (I do consider this to be a bug).

}

@Override
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public web API change. Is it really important that we change the method? Couldn't PUT be adapted to also enable updating existing users?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the doPost assumes the creation of a new element; since doPut assumes the edition/replacement of a new element; since, according to literature, the previous format was not in compliance. I believe this is the best way to do it.
https://spring.io/understanding/REST

Copy link
Collaborator

@Enet4 Enet4 Mar 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, we can think of this the other way around: if this implementation PUT does not support updating a user's properties, that can be improved. As much as we'd like to have a "pure" RESTful interface, we do not mandate such a design in Dicoogle. This part of the API was designed like this, and changing it is something we should not be accustomed to, since it has to be changed in client-sided code. As far as this one's concerned, the "resource" is a service.

rlebre added 3 commits March 26, 2019 13:23
updated return statement getDefaults()
implemented hashing in default user to be in line with the other methods
bugfix when users.xml wasn't created, the dicoogle dicoogle didn't work
removed unused import
Copy link
Collaborator

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few more issues.

@rlebre rlebre requested a review from Enet4 March 27, 2019 11:19
@rlebre rlebre requested a review from Enet4 April 2, 2019 17:15
Copy link
Collaborator

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than these issues, we still need to sort this one out. This is not a severe change, considering that we're not using it in the web application yet, but it's a change we ought to keep recorded.

@bastiao Do you agree with changing PUT /user to POST /user for creating new users?

@bastiao
Copy link
Member

bastiao commented Apr 16, 2019

Agreed! We can modify it for POST.
It sounds good to have this PR.

@Enet4 Enet4 merged commit dcdec85 into bioinformatics-ua:dev Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants