Compare commits

...

7 Commits
2.3.1 ... 2.x

Author SHA1 Message Date
Yuvi Panda
220eb87bce Merge pull request #3984 from meeseeksmachine/auto-backport-of-pr-3936-on-2.x
Backport PR #3936 on branch 2.x (admin: Hub is responsible for username validation)
2022-07-29 10:43:28 -07:00
Erik Sundell
f9e9150abc Merge pull request #3993 from minrk/2.x
backport nbclassic fixes to 2.x
2022-07-29 15:32:13 +02:00
Min RK
8074469ad7 Backport PR #3977: unpin nbclassic
0.4.3 is out, see if it fixes things

Signed-off-by: Min RK <benjaminrk@gmail.com>
2022-07-29 15:11:00 +02:00
Min RK
46d2455aff Backport PR #3971: nbclassic extension name has been renamed
ref: https://github.com/jupyter/nbclassic/pull/96/files diff-baf53b9a1d8f038c7de824e4928d10356271b26bacf19ffccba98454e685438eL109-R110

our patches to the jinja env need updating to find the new env. Until then, nbclassic 0.4.x will not get the template patches (the 'control panel' link)

Signed-off-by: Min RK <benjaminrk@gmail.com>
2022-07-29 15:09:08 +02:00
YuviPanda
72e4119e1a Commit built js 2022-07-18 19:18:38 -05:00
Erik Sundell
faa1754645 Backport PR #3936: admin: Hub is responsible for username validation 2022-07-19 00:13:54 +00:00
Erik Sundell
318f739ba9 Bump to 2.3.2.dev 2022-06-06 16:26:41 +02:00
10 changed files with 36 additions and 25 deletions

View File

@@ -9,6 +9,10 @@ cryptography
html5lib # needed for beautifulsoup
jupyterlab >=3
mock
# nbclassic provides the '/tree/' handler, which we use in tests
# it is a transitive dependency via jupyterlab,
# but depend on it directly
nbclassic
pre-commit
pytest>=3.3
pytest-asyncio; python_version < "3.7"

View File

@@ -6,7 +6,7 @@ info:
description: The REST API for JupyterHub
license:
name: BSD-3-Clause
version: 2.3.1
version: 2.3.2.dev
servers:
- url: /hub/api
security:

View File

@@ -60,7 +60,10 @@ const AddUser = (props) => {
placeholder="usernames separated by line"
data-testid="user-textarea"
onBlur={(e) => {
let split_users = e.target.value.split("\n");
let split_users = e.target.value
.split("\n")
.map((u) => u.trim())
.filter((u) => u.length > 0);
setUsers(split_users);
}}
></textarea>
@@ -88,17 +91,7 @@ const AddUser = (props) => {
data-testid="submit"
className="btn btn-primary"
onClick={() => {
let filtered_users = users.filter(
(e) =>
e.length > 2 &&
/[!@#$%^&*(),.?":{}|<>]/g.test(e) == false
);
if (filtered_users.length < users.length) {
setUsers(filtered_users);
failRegexEvent();
}
addUsers(filtered_users, admin)
addUsers(users, admin)
.then((data) =>
data.status < 300
? updateUsers(0, limit)

View File

@@ -70,12 +70,12 @@ test("Removes users when they fail Regex", async () => {
let textarea = screen.getByTestId("user-textarea");
let submit = screen.getByTestId("submit");
fireEvent.blur(textarea, { target: { value: "foo\nbar\n!!*&*" } });
fireEvent.blur(textarea, { target: { value: "foo \n bar\na@b.co\n \n\n" } });
await act(async () => {
fireEvent.click(submit);
});
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar"], false);
expect(callbackSpy).toHaveBeenCalledWith(["foo", "bar", "a@b.co"], false);
});
test("Correctly submits admin", async () => {

View File

@@ -59,7 +59,7 @@ const CreateGroup = (props) => {
value={groupName}
placeholder="group name..."
onChange={(e) => {
setGroupName(e.target.value);
setGroupName(e.target.value.trim());
}}
></input>
</div>

View File

@@ -2,7 +2,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# version_info updated by running `tbump`
version_info = (2, 3, 1, "", "")
version_info = (2, 3, 2, "", "dev")
# pep 440 version: no dot before beta/rc, but before .dev
# 0.1.0rc1

View File

@@ -755,10 +755,12 @@ class SingleUserNotebookAppMixin(Configurable):
if 'jinja2_env' in settings:
# default jinja env (should we do this on jupyter-server, or only notebook?)
jinja_envs.append(settings['jinja2_env'])
if 'notebook_jinja2_env' in settings:
# when running with jupyter-server, classic notebook (nbclassic server extension)
for ext_name in ("notebook", "nbclassic"):
env_name = f"{ext_name}_jinja2_env"
if env_name in settings:
# when running with jupyter-server, classic notebook (nbclassic server extension or notebook v7)
# gets its own jinja env, which needs the same patch
jinja_envs.append(settings['notebook_jinja2_env'])
jinja_envs.append(settings[env_name])
# patch jinja env loading to get modified template, only for base page.html
def get_page(name):

View File

@@ -199,10 +199,22 @@ def test_singleuser_app_class(JUPYTERHUB_SINGLEUSER_APP):
import jupyter_server # noqa
except ImportError:
have_server = False
expect_error = "jupyter_server" in JUPYTERHUB_SINGLEUSER_APP
else:
have_server = True
expect_error = False
try:
import notebook.notebookapp # noqa
except ImportError:
have_notebook = False
else:
have_notebook = True
if JUPYTERHUB_SINGLEUSER_APP.startswith("notebook."):
expect_error = not have_notebook
elif JUPYTERHUB_SINGLEUSER_APP.startswith("jupyter_server."):
expect_error = not have_server
else:
# not specified, will try both
expect_error = not (have_server or have_notebook)
if expect_error:
ctx = pytest.raises(CalledProcessError)

View File

@@ -15,7 +15,7 @@ target_version = [
github_url = "https://github.com/jupyterhub/jupyterhub"
[tool.tbump.version]
current = "2.3.1"
current = "2.3.2.dev"
# Example of a semver regexp.
# Make sure this matches current_version before

File diff suppressed because one or more lines are too long