2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5b1e3075b055/ Changeset: 5b1e3075b055 Branch: next-stable User: dannon Date: 2014-05-23 17:49:39 Summary: Force user api to validate creation of new users, raising RequestParameterInvalid on failure to do so. Affected #: 1 file
diff -r cbd0a239259b694afadfc62bdde820eef0c30b4f -r 5b1e3075b05526b98529099d328501e9633a95f2 lib/galaxy/webapps/galaxy/api/users.py --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -3,10 +3,14 @@ """ import logging from paste.httpexceptions import HTTPBadRequest, HTTPNotImplemented -from galaxy import util, web + +from galaxy import util, web, exceptions +from galaxy.security.validate_user_input import validate_email +from galaxy.security.validate_user_input import validate_password +from galaxy.security.validate_user_input import validate_publicname from galaxy.web.base.controller import BaseAPIController, UsesTagsMixin +from galaxy.web.base.controller import CreatesApiKeysMixin from galaxy.web.base.controller import CreatesUsersMixin -from galaxy.web.base.controller import CreatesApiKeysMixin
log = logging.getLogger( __name__ )
@@ -98,7 +102,13 @@ username = payload[ 'username' ] email = payload[ 'email' ] password = payload[ 'password' ] - user = self.create_user( trans=trans, email=email, username=username, password=password ) + message = "\n".join( [ validate_email( trans, email ), + validate_password( trans, password, password ), + validate_publicname( trans, username ) ] ).rstrip() + if message: + raise exceptions.RequestParameterInvalidException( message ) + else: + user = self.create_user( trans=trans, email=email, username=username, password=password ) else: raise HTTPNotImplemented() item = user.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id,
https://bitbucket.org/galaxy/galaxy-central/commits/39217230c382/ Changeset: 39217230c382 User: dannon Date: 2014-05-23 17:49:50 Summary: Merge nextstable. Affected #: 1 file
diff -r 89bdb65761f631921d3a21cfd2335103715de5bb -r 39217230c38250daa36e2a9554cdcd52c01542ef lib/galaxy/webapps/galaxy/api/users.py --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -3,10 +3,14 @@ """ import logging from paste.httpexceptions import HTTPBadRequest, HTTPNotImplemented -from galaxy import util, web + +from galaxy import util, web, exceptions +from galaxy.security.validate_user_input import validate_email +from galaxy.security.validate_user_input import validate_password +from galaxy.security.validate_user_input import validate_publicname from galaxy.web.base.controller import BaseAPIController, UsesTagsMixin +from galaxy.web.base.controller import CreatesApiKeysMixin from galaxy.web.base.controller import CreatesUsersMixin -from galaxy.web.base.controller import CreatesApiKeysMixin
log = logging.getLogger( __name__ )
@@ -98,7 +102,13 @@ username = payload[ 'username' ] email = payload[ 'email' ] password = payload[ 'password' ] - user = self.create_user( trans=trans, email=email, username=username, password=password ) + message = "\n".join( [ validate_email( trans, email ), + validate_password( trans, password, password ), + validate_publicname( trans, username ) ] ).rstrip() + if message: + raise exceptions.RequestParameterInvalidException( message ) + else: + user = self.create_user( trans=trans, email=email, username=username, password=password ) else: raise HTTPNotImplemented() item = user.to_dict( view='element', value_mapper={ 'id': trans.security.encode_id,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
galaxy-commits@lists.galaxyproject.org