Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not username or not username.endswith('@'+self.hosted_domain):
username = None
else:
username = username.split('@')[0]
if self.whitelist and username not in self.whitelist:
username = None
raise gen.Return(username)
class LocalGoogleOAuthenticator(LocalAuthenticator, GoogleOAuthenticator):
"""A version that mixes in local system user creation"""
pass
class LocalGoogleAppsOAuthenticator(LocalAuthenticator, GoogleAppsOAuthenticator):
"""A version that mixes in local system user creation"""
pass
This adds the user to the whitelist, and creates a system user by
accessing a simple REST api.
"""
homedir = os.path.join('/', 'home', user.name)
os.mkdir(homedir)
os.chown(homedir, 2000, 2000)
self.log.info("Created home directory for user %s", user.name)
if user.state is None:
user.state = {}
user.state['user_id'] = 2000
self.db.commit()
class DockerOAuthenticator(DockerAuthenticator, GoogleAppsOAuthenticator):
"""A version that mixes in local system user creation from within a
docker container, and Google OAuthentication.
"""
pass