Skip to content

Commit

Permalink
NXDRIVE-2901: Authorization Error for OAuth --PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofanindya committed Feb 29, 2024
1 parent ecf8820 commit 45c86c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions nxdrive/auth/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class OAuthentication(Authentication):
def __init__(self, *args: Any, dao: "BaseDAO" = None, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)

self.verification_needed = get_verify()

Check warning on line 21 in nxdrive/auth/oauth2.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/auth/oauth2.py#L21

Added line #L21 was not covered by tests
self._dao = dao
subclient_kwargs = kwargs.get("subclient_kwargs")
subclient_kwargs = {} if subclient_kwargs is None else subclient_kwargs
subclient_kwargs["verify"] = get_verify()
subclient_kwargs = kwargs.get("subclient_kwargs", {})
subclient_kwargs["verify"] = self.verification_needed

Check warning on line 24 in nxdrive/auth/oauth2.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/auth/oauth2.py#L23-L24

Added lines #L23 - L24 were not covered by tests
self.auth = OAuth2(
self.url,
client_id=Options.oauth2_client_id,
Expand Down
2 changes: 1 addition & 1 deletion nxdrive/direct_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, manager: "Manager", folder: Path, /) -> None:

self._event_handler: Optional[DriveFSEventHandler] = None
self._metrics = {"edit_files": 0}
self._observer: Observer = None
self._observer: Optional[Any] = None
self.local = LocalClient(self._folder)
self._upload_queue: Queue = Queue()
self.is_already_locked = False
Expand Down
6 changes: 3 additions & 3 deletions nxdrive/engine/watcher/local_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from queue import Queue
from threading import Lock
from time import mktime, sleep
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple

from watchdog.events import FileSystemEvent, PatternMatchingEventHandler
from watchdog.observers import Observer
Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(self, engine: "Engine", dao: "EngineDAO", /) -> None:
}

self._event_handler: Optional[DriveFSEventHandler] = None
self._observer: Optional[Observer] = None
self._observer: Optional[Any] = None

Check warning on line 93 in nxdrive/engine/watcher/local_watcher.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/engine/watcher/local_watcher.py#L93

Added line #L93 was not covered by tests
self._delete_events: Dict[str, Tuple[int, DocPair]] = {}
self._folder_scan_events: Dict[Path, Tuple[float, DocPair]] = {}

Expand Down Expand Up @@ -613,7 +613,7 @@ def _scan_recursive(self, info: FileInfo, /, *, recursive: bool = True) -> None:
self._scan_recursive(child_info)

@tooltip("Setup watchdog")
def _setup_watchdog(self) -> None:
def _setup_watchdog(self):
base: Path = self.local.base_folder
log.info(f"Watching FS modification on {base!r}")

Expand Down

0 comments on commit 45c86c6

Please sign in to comment.