Closed Bug 1072184 Opened 11 years ago Closed 11 years ago

Handle DELETE /account, /session and /registration

Categories

(Hello (Loop) :: Server, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alexis+bugs, Assigned: tarek)

Details

(Whiteboard: [qa+] [loop-server 0.13])

Attachments

(1 file)

Make sure there is more than one hawk session associated with the user. If not answer with 403 Forbidden. We can also return the method to use instead: DELETE /account.
Whiteboard: [qa+]
Assignee: nobody → rhubscher
Status: NEW → ASSIGNED
Summary: Add a way to destroy a hawk session (DELETE /session) → Destroy the hawk session on DELETE /registration
Now that SimplePushURLs are linked directly to the Hawk Session, it makes sense to remove both on DELETE /registration
Attachment #8500994 - Flags: review?(alexis+bugs)
Adding a note here while doing the triage: It's possible this is not doing the right thing here: it's deleting the hawkid of anonymous users (so they don't exist anymore). Currently, this API allows user to unregister a simple push url, marking them as offline.
Comment on attachment 8500994 [details] [review] Link to Github PR — #220. Yep, that's not how we want to do things for now: let's keep it possible to just unregister, which is what the current DELETE on /registration does (which is different from the DELETE /session).
Attachment #8500994 - Flags: review?(alexis+bugs) → review-
Then we should probably remove the mandatory parameter in POST /registration because asking POST /registration with a fake simplePushURL and the asking for DELETE /registration will basically do the same thing.
Nope, that's different: when you register, you need to pass a way to contact you back, and then you can say this is not valid anymore (using delete). Effectively, that would do the same thing but they're conceptually different: post /registration registers you with a way to get back to you and delete /registration removes the way to contact you (e.g. you're offline).
I don't understand why you couldn't connect as an offline participant. Also in that case we don't handle this correctly because then we should answer the link-clicker that the user is not present. Are we supposed to handle the presence of a user on the server side? Mark — Does current client implementation relies on this when going offline?
Flags: needinfo?(standard8)
If that makes sense to register as an offline participant, then we could allow that behavior. We're not supposed to handle all the presence of the users on the server side, but here that actually makes sense to have it for free, hence why we're doing it like that.
Ok so after further discussion here is what we are planning to implement: - POST /registration will now have simplePushURLs optional - POST /registration with simplePushURLs will override the session simplePushURLs - DELETE /registration will remove simplePushURLs for the user putting him as offline without removing it ability to get back online. - DELETE /session will remove the connected user session and drop its simplePushUrls - DELETE /session on a unconnected user will raise a 403 - DELETE /account will remove a user and everything that it linked to it (call-urls/sessions) Basically an unconnected user will have to use DELETE /account instead of DELETE /session because a drop of its session will not let him get its user data.
Seems reasonable, please ensure the documentation gets updated for this. It might also be worth a general section explaining the differences as per comment 8.
Flags: needinfo?(standard8)
Assignee: rhubscher → tarek
Summary: Destroy the hawk session on DELETE /registration → Handle DELETE /account, /session and /registration
Whiteboard: [qa+] → [qa+] [loop-server 0.13]
Attachment #8500994 - Flags: review- → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: