add -p option for support to open PW_OPEN folder.
This commit is contained in:
@ -5,6 +5,7 @@ from pydantic.dataclasses import dataclass
|
||||
|
||||
from mdrsclient.api.base import BaseApi
|
||||
from mdrsclient.api.utils import token_check
|
||||
from mdrsclient.exceptions import UnauthorizedException
|
||||
from mdrsclient.models import Folder, FolderSimple
|
||||
|
||||
|
||||
@ -67,6 +68,19 @@ class FolderApi(BaseApi):
|
||||
self._raise_response_error(response)
|
||||
return True
|
||||
|
||||
def auth(self, id: str, password: str) -> bool:
|
||||
# print(self.__class__.__name__ + "::" + sys._getframe().f_code.co_name)
|
||||
url = self.ENTRYPOINT + id + "/auth/"
|
||||
data = {"password": password}
|
||||
token_check(self.connection)
|
||||
response = self.connection.post(url, data=data)
|
||||
# stupid! always returned status code 200
|
||||
self._raise_response_error(response)
|
||||
data = response.json()
|
||||
if data.get("status") is not True:
|
||||
raise UnauthorizedException("Password is incorrect.")
|
||||
return True
|
||||
|
||||
def move(self, folder: FolderSimple, folder_id: str) -> bool:
|
||||
# print(self.__class__.__name__ + "::" + sys._getframe().f_code.co_name)
|
||||
url = self.ENTRYPOINT + folder.id + "/move/"
|
||||
|
Reference in New Issue
Block a user