Skip to content

Commit de4244c

Browse files
allow async authorization (#109)
* allow async authorization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7423ddd commit de4244c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jupyter_server_terminals/handlers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ async def get(self, *args: t.Any, **kwargs: t.Any) -> None:
4848
if self.authorizer is None:
4949
# Warn if an authorizer is unavailable.
5050
warn_disabled_authorization() # type:ignore[unreachable]
51-
elif not self.authorizer.is_authorized(self, user, "execute", self.auth_resource):
51+
elif not await ensure_async(
52+
self.authorizer.is_authorized(self, user, "execute", self.auth_resource)
53+
):
5254
raise web.HTTPError(403)
5355

5456
if args[0] not in self.term_manager.terminals: # type:ignore[attr-defined]

0 commit comments

Comments
 (0)