Skip to content
Snippets Groups Projects
Commit 3bc51509 authored by Carl Waldbieser's avatar Carl Waldbieser
Browse files

Removed `build/` and `dist/`; updated `.gitignore`.

There are folders required for producing distributions/wheels to upload to
PyPI, but these probably don't belong in version control.
parent b2f1cc63
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,6 @@
*.log
*.pyc
__pycache__/
build/
dist/
import os
from jupyterhub.handlers import BaseHandler
from jupyterhub.auth import Authenticator
from jupyterhub.auth import LocalAuthenticator
from jupyterhub.utils import url_path_join
from tornado import gen, web
from traitlets import Unicode
class RemoteUserLoginHandler(BaseHandler):
def get(self):
header_name = self.authenticator.header_name
remote_user = self.request.headers.get(header_name, "")
if remote_user == "":
raise web.HTTPError(401)
else:
user = self.user_from_username(remote_user)
self.set_login_cookie(user)
self.redirect(url_path_join(self.hub.server.base_url, 'home'))
class RemoteUserAuthenticator(Authenticator):
"""
Accept the authenticated user name from the REMOTE_USER HTTP header.
"""
header_name = Unicode(
default_value='REMOTE_USER',
config=True,
help="""HTTP header to inspect for the authenticated username.""")
def get_handlers(self, app):
return [
(r'/login', RemoteUserLoginHandler),
]
@gen.coroutine
def authenticate(self, *args):
raise NotImplementedError()
class RemoteUserLocalAuthenticator(LocalAuthenticator):
"""
Accept the authenticated user name from the REMOTE_USER HTTP header.
Derived from LocalAuthenticator for use of features such as adding
local accounts through the admin interface.
"""
header_name = Unicode(
default_value='REMOTE_USER',
config=True,
help="""HTTP header to inspect for the authenticated username.""")
def get_handlers(self, app):
return [
(r'/login', RemoteUserLoginHandler),
]
@gen.coroutine
def authenticate(self, *args):
raise NotImplementedError()
File deleted
......@@ -4,7 +4,7 @@
version_info = (
0,
0,
1,
2,
#'dev', # comment-out this line for a release
)
__version__ = '.'.join(map(str, version_info[:3]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment