Skip to content

Commit

Permalink
implement password_required check in LegacyIdentityProvider
Browse files Browse the repository at this point in the history
previous implementation was on ServerApp
  • Loading branch information
minrk committed May 16, 2022
1 parent 2a73e60 commit 530b96b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions jupyter_server/auth/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,4 +692,11 @@ def validate_security(
app: ServerApp,
ssl_options: dict | None = None,
) -> None:
if self.password_required and (not self.hashed_password):
self.log.critical(
_i18n("Jupyter servers are configured to only be run with a password.")
)
self.log.critical(_i18n("Hint: run the following command to set a password"))
self.log.critical(_i18n("\t$ python -m jupyter_server.auth password"))
sys.exit(1)
return self.login_handler_class.validate_security(app, ssl_options)
1 change: 0 additions & 1 deletion tests/auth/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from tornado.httpclient import HTTPClientError
from tornado.httputil import parse_cookie, url_concat

from jupyter_server.serverapp import ServerApp
from jupyter_server.utils import url_path_join


Expand Down

0 comments on commit 530b96b

Please sign in to comment.