[Mailman-Developers] Proposed incompatible changes to the REST API

Barry Warsaw barry at list.org
Tue Aug 26 23:59:36 CEST 2014


I'm considering making two small incompatible changes to the JSON
representation of list requests in the REST API.  Here's what you currently
get (from rest/docs/moderation.rst) for a held subscription request:

    >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests/1')
    address: anne at example.com
    delivery_mode: regular
    display_name: Anne Person
    http_etag: "..."
    language: en
    password: password
    request_id: 1
    type: subscription
    when: 2005-08-01T07:49:23

I want to change the 'address' key to 'email' and remove the 'password' key,
e.g.:

    >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests/1')
    delivery_mode: regular
    display_name: Anne Person
    email: anne at example.com
    http_etag: "..."
    language: en
    request_id: 1
    type: subscription
    when: 2005-08-01T07:49:23

Unsubscription requests would just rename 'address' to 'email' (there is no
'password' key).  E.g. from:

    >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests/2')
    address: bart at example.com
    http_etag: "..."
    request_id: 2
    type: unsubscription

to:

    >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests/2')
    email: bart at example.com
    http_etag: "..."
    request_id: 2
    type: unsubscription

I could (mostly) keep backward compatibility by just adding the 'email' key
and keeping the 'address' key for now.  The 'password' key is trickier because
a subscription request's password is internally and randomly generated anyway,
and I am going to remove this.  I could keep 'password' with either the empty
string or some random garbage.

I'd like to just get rid of these and break compatibility, but if it would
cause pain to Postorius or other tools, I can deprecate the old names and
remove them in the future.

Let me know what you think.

Cheers,
-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20140826/4eeb07a7/attachment.sig>


More information about the Mailman-Developers mailing list