Skip to content

Commit

Permalink
vdk-jupyter: add oauth2 authentication implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniivanov committed Aug 22, 2023
1 parent 9b02cd1 commit be12c5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass

from traitlets import Unicode
from traitlets.config import Configurable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from vdk.plugin.control_api_auth.auth_config import InMemAuthConfiguration
from vdk.plugin.control_api_auth.base_auth import BaseAuth
from vdk_jupyterlab_extension.handlers import OAuth2Handler
from vdk_jupyterlab_extension.oauth2 import SingletonInMemAuthConfiguration


def test_fix_redirect_uri():
Expand Down Expand Up @@ -81,13 +80,13 @@ def test_get_without_code(oauth2_handler):

auth_url = urlparse(mock_finish.call_args[0][0])
assert auth_url.netloc == "example.com"
assert auth_url.path == "auth"
assert auth_url.path == "/auth"
assert auth_url.scheme == "https"

query_params = parse_qs(auth_url.query)
assert query_params.get("response_type") == "code"
assert query_params.get("client_id") == "sample_client_id"
assert query_params.get("code_challenge") is not None
assert query_params.get("response_type") == ["code"]
assert query_params.get("client_id") == ["sample_client_id"]
assert query_params.get("code_challenge")


@httpretty.activate
Expand Down

0 comments on commit be12c5f

Please sign in to comment.