summaryrefslogtreecommitdiff
path: root/src/mailman/rest/adapters.py
Commit message (Collapse)AuthorAgeFilesLines
* * New REST resource http://.../members/find can be POSTed to in order to findBarry Warsaw2011-08-131-127/+0
| | | | | | member records. Arguments are `subscriber` (email address to search for - required), `fqdn_listname` (optional), and `role` (i.e. MemberRole - optional). (LP: #799612)
* Allow users to subscribe to mailing lists through the REST API.Barry Warsaw2011-04-241-16/+27
| | | | | | | | * ISubscriptionService.join(): address -> subscriber. This is not backward compatible with the previous API! * Add get_user_by_id() to the IUserManager interface. It was already implemented, but the interface was missing the definition. * MissingUserError: new exception, purely for the REST API.
* Give IMembers a unique member id. We have to do this in order to give them aBarry Warsaw2011-04-221-0/+13
| | | | | | | | | | | | | | | | | | | | | | | path at the root of the resource tree (i.e. /members/X) and because when members can be subscribed by their IUser record (for preferred address), their canonical location cannot contain the address they are subscribed with. When their preferred address changes (without otherwise touching their membership), this address will change and that's not good for a canonical location. Other changes: * Added IMember.member_id attribute * Added ISubscriptionService.get_member() so member records can be retrieve by member id. * We can now get individual members by id via the REST API. * Extend the UniqueIDFactory so that it can take a 'context' (defaulting to None). The context is only used in the testing infrastructure so that separate files can be used for user ids and member ids. Otherwise, we'd have gaps in those sequences. * When *not* in testing mode, ensure that UIDs cannot be reused by keeping a table of all UIDs ever handed out. We *should* never get collisions, but this ensures it. * Clean up mailman.sql
* encrypt_password(): New convenience function for ensuring that a password isBarry Warsaw2011-04-081-7/+5
| | | | | | | | | | | | | | | both encrypted according to a scheme, and a bytes object. add_member(): Use encrypt_password(). cli_members: Give the user a default, user-friendly password. Of course, this will be encrypted so it can't be retrieved, but it can be reset. Passwords are stored as bytes objects, not unicode now. ConfigLayer: Set the default test password scheme to cleartext. General test repair.
* Happy New Year.Barry Warsaw2011-01-011-1/+1
|
* Because it was just to damn confusing, rename IAddress.address toBarry Warsaw2011-01-011-1/+1
| | | | | | IAddress.email and IAddress.original_address to IAddress.original_email. From now on we'll use "address" to talk about the IAddress object and "email" to talk about the textual email address.
* Fix the obvious errors identified by pyflakes. Skip false positives (mostlyBarry Warsaw2010-10-081-1/+1
| | | | | due to _() interpolation) and a few other problems that did not have immediately obvious fixes.
* Refactor the list configuration code via the REST interface, and flesh it outBarry Warsaw2010-08-231-1/+1
| | | | considerably.
* * Fix the bin/test -e/--stderr option to work with the currentBarry Warsaw2010-06-181-6/+3
| | | | | | | | | | | | | zope.testrunner. Actually, divorce it from the latter and handle the sys.argv sequence ourselves. * Added IMailingList.get_roster() which returns the named roster (from a MemberRole enum). * The start of an IMailingList doctest. This needs much more detail. * Move the subscribe() function from membership.txt into the mailman.testing.helpers. * Added new REST interface for getting all the members of a roster for a specific mailing list: .../lists/<list>/roster/<role>. Note that <role> is the plural form of the MemberRole enum.
* Refactoring the REST support by removing unnecessary stuff and moving otherBarry Warsaw2010-02-251-10/+4
| | | | | | stuff around. We no longer need APIValueError or IResolvePathNames. Also, refactor the creation of the REST server so that it could be used with other WSGI frameworks.
* Complete the conversion to restish. All the tests pass and we're now actuallyBarry Warsaw2010-02-241-33/+8
| | | | | | RESTful. We have to use httplib2 to get DELETE and PUT. This is a prototype and could still use much cleanup.
* Happy New Year.Barry Warsaw2010-01-011-1/+1
|
* More tests.Barry Warsaw2009-12-281-7/+10
|
* * Leave a mailing list via the REST API.Barry Warsaw2009-12-281-2/+11
| | | | | | * delete_member(): If the address is not associated with a member, raise NotAMemberError. * NotAMemberError -> interfaces/member.py
* * Add REST interface for joining a mailing list.Barry Warsaw2009-12-281-1/+35
| | | | | | * add_member() now returns the newly created IMember. * Reorganized several exceptions and exposed them to the REST API. * Added NoSuchListError.
* Add REST API for subscription services.Barry Warsaw2009-12-271-0/+30
|
* * Make IDomainManager a utility, since the config object is global.Barry Warsaw2009-12-081-12/+5
| | | | | | | | * Give IMailingList a .domain attribute which looks up the IDomain for its .host_name. This cleans up a lot of code. * Add a test for the 'confirm' email command. * Suppress blank lines in email command responses. * Make the IDomainCollection a utility.
* Our first writable REST API! You can now create new domains through theBarry Warsaw2009-07-201-0/+7
| | | | | | | | | webserver. Fix the https/http urls. Add the adapter for HTTPCharsets so POSTs work properly. Nice little cargo cult from lazr.restful.
* Wow. Put domains into the database.Barry Warsaw2009-07-161-11/+17
| | | | | | | | Add an IDomainManager and a global domain manager which can be gotten by adapting the global config object. Add an IDomainCollection interface for exposing the domain manager onto the API.
* Clean a few more lints.Barry Warsaw2009-07-101-1/+2
| | | | | | | | | | | | | | Add get_mailing_lists() which is used just for the web interface. Because of a bug in lazr.restful, this cannot be a generator. Similar change in IDomainSet. Instrument IListManager to be vended through the api. The REST server must be run in a separate process since SQLite does not like objects created in one thread to be used in another thread. Note that this breaks the domain.txt test, but domains really need to be in the database anyway.
* Implement returning multiple domains, a single specific domain, and raising aBarry Warsaw2009-06-291-1/+10
| | | | 404 if the named domain is missing.
* More REST server updates.Barry Warsaw2009-06-291-0/+47
* Get rid of in-Python adapter registration in favor of ZCML. Eventually, I'd like to get rid of the ZCML. * Set the view_permission to None, but it's still not right. * Add IDomainSet and an adapter from Configuration to IDomainSet.