Univention Bugzilla – Attachment 5318 Details for
Bug 31861
UMC-Server: authentication API should be more generic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
auth.patch
auth.patch (text/plain), 5.58 KB, created by
Florian Best
on 2013-07-11 08:55:12 CEST
(
hide
)
Description:
auth.patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2013-07-11 08:55:12 CEST
Size:
5.58 KB
patch
obsolete
>Index: univention-management-console/src/univention/management/console/protocol/server.py >=================================================================== >--- univention-management-console/src/univention/management/console/protocol/server.py (Revision 41838) >+++ univention-management-console/src/univention/management/console/protocol/server.py (Arbeitskopie) >@@ -213,7 +213,11 @@ > elif msg.command == 'AUTH': > state.authResponse = Response( msg ) > try: >- state.authenticate( msg.body[ 'username' ], msg.body[ 'password' ], msg.body.get( 'new_password' ) ) >+ state.authenticate(**dict(auth_type=msg.body.get('auth_type'), >+ username=msg.body['username'], >+ password=msg.body['password'], >+ new_password=msg.body.get('new_password')) >+ ) > except ( TypeError, KeyError ), e: > state.authResponse.status = BAD_REQUEST_INVALID_OPTS > state.authResponse.message = 'insufficient authentification information' >@@ -500,6 +504,7 @@ > > def _connection( self, socket ): > '''Signal callback: Invoked on incoming connections.''' >+ > socket, addr = socket.accept() > socket.setblocking( 0 ) > if addr: >Index: univention-management-console/src/univention/management/console/protocol/client.py >=================================================================== >--- univention-management-console/src/univention/management/console/protocol/client.py (Revision 41838) >+++ univention-management-console/src/univention/management/console/protocol/client.py (Arbeitskopie) >@@ -340,12 +340,13 @@ > else: > self.signal_emit( 'error', UnknownRequestError() ) > >- def authenticate( self, username, password, new_password=None ): >+ def authenticate( self, username, password, **kwargs ): > """Authenticate against the UMC server""" > authRequest = Request ('AUTH' ) >+ >+ authRequest.body.update(kwargs) > authRequest.body['username'] = username > authRequest.body['password'] = password >- authRequest.body['new_password'] = new_password > > self.request( authRequest ) > >Index: univention-management-console/src/univention/management/console/protocol/session.py >=================================================================== >--- univention-management-console/src/univention/management/console/protocol/session.py (Revision 41838) >+++ univention-management-console/src/univention/management/console/protocol/session.py (Arbeitskopie) >@@ -99,10 +99,10 @@ > def _authenticated( self, success ): > self.signal_emit( 'authenticated', success, self ) > >- def authenticate( self, username, password, new_password=None ): >+ def authenticate( self, username, password, **kwargs ): > """Initiates an authentication process""" > self.username = username >- self.__auth.authenticate( username, password, new_password ) >+ self.__auth.authenticate( username, password, **kwargs ) > > def credentials( self ): > """Returns the credentials""" >Index: univention-management-console/src/univention/management/console/auth.py >=================================================================== >--- univention-management-console/src/univention/management/console/auth.py (Revision 41838) >+++ univention-management-console/src/univention/management/console/auth.py (Arbeitskopie) >@@ -247,7 +247,7 @@ > self.signal_new( 'authenticated' ) > self.__credentials = None > >- def _create_modules( self, username, password ): >+ def _create_modules( self, username, password, **kwargs ): > global _all_modules > self._modules = [] > for mod in _all_modules: >@@ -256,11 +256,13 @@ > instance.signal_connect( 'password_changed', self._password_changed ) > self._modules.append( instance ) > self._modules.reverse() >- >- def authenticate( self, username, password, new_password=None ): >- self._create_modules( username, password ) >+ >+ def authenticate( self, username, password, **kwargs ): >+ if kwargs.get('auth_type') == "saml": >+ AUTH.warn('__starting SAML Authenticate __') >+ self._create_modules( username, password, **kwargs ) > self._current = self._modules.pop() >- self.__new_password = new_password >+ self.__new_password = kwargs.get('new_password') > self._current.authenticate() > self.__credentials = ( username, password ) > >Index: univention-management-console-frontend/univention-management-console-web-server >=================================================================== >--- univention-management-console-frontend/univention-management-console-web-server (Revision 41838) >+++ univention-management-console-frontend/univention-management-console-web-server (Arbeitskopie) >@@ -133,7 +133,7 @@ > self._auth_response = umcp.Response( request ) > self._auth_response.body['sessionid'] = request.body.get('sessionid','') > self._auth_response_queue = response_queue >- self.client.authenticate( request.body[ 'username' ], request.body[ 'password' ], request.body[ 'new_password' ] ) >+ self.client.authenticate( **request.body ) > > def _response(self, response): > """Queue response from UMC server.""" >@@ -553,14 +553,14 @@ > body = cherrypy.request.body.read() > > json = self.load_json(body) >- > CORE.info('CPRoot/command: request: command=%s' % cherrypy.request.path_info ) > > # create new UMCP request > req = umcp.Request( 'AUTH' ) >- req.body[ 'username' ] = json[ 'options' ].get('username','') >- req.body[ 'password' ] = json[ 'options' ].get('password','') >- req.body[ 'new_password' ] = json[ 'options' ].get('new_password') >+ json['options'].setdefault('password', '') >+ json['options'].setdefault('username', '') >+ json['options'].setdefault('new_password', '') >+ req.body.update(json['options']) > > # create new response queue > response_queue = Queue.Queue()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31861
:
5300
| 5318