Remove AlwaysAccept customauth plugin.

This commit is contained in:
Nicola Soranzo
2015-03-01 22:23:54 -05:00
committed by John Chilton
parent 7951d0ced5
commit 3c0221ee5e
2 changed files with 0 additions and 57 deletions
@@ -1,49 +0,0 @@
'''
Created on 16/07/2014
@author: Andrew Robinson
'''
import traceback, re, string
import galaxy.customauth.base
class AlwaysAccept(galaxy.customauth.base.CustomAuthProvider):
'''A simple authenticator that just accepts user (doesn't care about their password)'''
def authenticate(self, username, password, options, debug=False):
'''
Check the username and password are correct.
NOTE: Used within auto-registration to check its ok to register this user
@param username: the users email address
@param password: the plain text passord they typed
@param options: dictionary of options provided by admin in customauth xml config file
@param debug: boolean, False indicating admin wants debugging information printed
@return: boolean, True: accept user, False: reject user and None: reject user and don't try any other providers
'''
if debug:
print ("User: %s, ALWAYSACCEPT: True (%s)" % (username, _stripUsername(username)))
return (True, _stripUsername(username))
def authenticateUser(self, user, password, options, debug=False):
'''
Same as authenticate, except User object is provided instead of username.
NOTE: used on normal login to check authentication and update user details if required.
@param username: the users email address
@param password: the plain text passord they typed
@param options: dictionary of options provided by admin in customauth xml config file
@param debug: boolean, False indicating admin wants debugging information printed
@return: boolean, True: accept user, False: reject user and None: reject user and don't try any other providers
'''
if debug:
print ("User: %s, ALWAYSACCEPT: True" % (user.email))
return True
def _stripUsername(username):
pattern = re.compile('[^a-zA-Z0-9\-]+')
return pattern.sub("-", username)
@@ -1,8 +0,0 @@
[Core]
Name = AlwaysAccept
Module = alwaysaccept
[Documentation]
Author = Andrew Robinson
Version = 0.1
Description = Custom Authentication Provider that is used for whitelisting usernames (i.e. accept any password)