Skip to content

Commit

Permalink
Merge pull request #347 from minrk/403-on-fail
Browse files Browse the repository at this point in the history
403 on failed auth for EventStream
  • Loading branch information
consideRatio authored Mar 29, 2024
2 parents 518c9c8 + bbfd41c commit 79784e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions nbgitpuller/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def __init__(self, *args, **kwargs):
if 'git_lock' not in self.settings:
self.settings['git_lock'] = locks.Lock()

def get_login_url(self):
# raise on failed auth, not redirect
# can't redirect EventStream to login
# same as Jupyter's APIHandler
raise web.HTTPError(403)

@property
def git_lock(self):
return self.settings['git_lock']
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_clone_auth(jupyterdir, jupyter_server):
}
r = request_api(params)
# no token, redirect to login
assert r.code == 302
assert r.code == 403


def test_clone_targetpath(jupyterdir, jupyter_server):
Expand Down

0 comments on commit 79784e0

Please sign in to comment.