This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Support for client-side validation in mailman-cli.


I have implemented client-side validation in the proof of concept module. Using an invalid email address will throw error:

> var MC = require('./cli.js')
> var client = new MC({'endpoint':'http://localhost:8001/3.0'})
> client.lists().auth().listId('').members('').get(function(err,data){
... if (err)
... {
..... console.log(err);
..... }
... else {
..... console.log(data);
..... }
... });
Error: actionId does not match /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/

In the above error actionId refers to the member email which is used INVALID here. This let us do validation on the client side only, no need to get 404 from the server. These type of error messages are more clear than a 404 error in such situations.
Note : I am not saying always prefer client validations and do not expect error messages from the server. Both have their different domain.

Note : The following /lists/ endpoint will be requested above which is not a valid endpoint as far as mailman.client is considered. It is used above for illustration purposes.


I have implemented it here by using a path validator function. The path validation information is contained in the _options ( state object ) and it's here : .

Similary, listId supplied can be validated but I have not implmented support for it in my current prototype.