Provide a reserved url for clearing out the uid table

Bug #1420083 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
High
Barry Warsaw

Bug Description

While testing the authenticating REST proxy, it is necessary to clear out the uid table. In normal operation, we never delete rows from this table, to ensure that uids are never duplicated. However, when a user is deleted in the proxy test suite, its uid entry is never cleaned up.

This thread discusses several options: http://thread.gmane.org/gmane.mail.mailman.devel/19733

Yet another option would be to expose

<api>/reserved/uids/orphans

and if you DELETE that resource, all uids not associated with users will be removed from the table.

It's a bit crufty in that I think we may be abusing the DELETE method (since <api>/reserved/uids/orphans will still exist after the successful operation), but since this is a testing-only method, I think it's fine.

Not sure we need to implement GET, or subresources, but we could if it turns out we need that for testing purposes.

Also, DELETEing .../orphans means that the ill effects of accidentally calling this on a real server are minimized. At worst, uids could be reused, but that's unlikely given our use of uuid4().

Tags: mailman3
Revision history for this message
Andrew Stuart (andrew-stuart) wrote :

Sounds good to me. All the ideas put forward here and in the thread provide a way to clean up the database and that's the most important thing. I like this one because it is straightforward.

With this solution, I could just run it In testing teardown after deleting my test users and all would be cleaned up, without risk of deleting anything but the orphaned UIDs and without needing to write specific code to work out which UIDs need deletion. So I think this is a good way to go.

Revision history for this message
Barry Warsaw (barry) wrote :

We'll go with DELETE <api>/reserved/uids/orphans

Changed in mailman:
status: Triaged → In Progress
Revision history for this message
Barry Warsaw (barry) wrote :

Note that I will not make any API stability guarantees for anything under /reserved and its only function will be for non-production support (e.g. testing systems).

Barry Warsaw (barry)
Changed in mailman:
status: In Progress → Fix Committed
assignee: nobody → Barry Warsaw (barry)
Barry Warsaw (barry)
Changed in mailman:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.