mirror of https://github.com/MISP/PyMISP
parent
cb5f68a932
commit
09f55f5167
|
@ -207,7 +207,18 @@ class PyMISP:
|
|||
self._current_user: MISPUser
|
||||
self._current_role: MISPRole
|
||||
self._current_user_settings: List[MISPUserSetting]
|
||||
self._current_user, self._current_role, self._current_user_settings = self.get_user(pythonify=True, expanded=True)
|
||||
user_infos = self.get_user(pythonify=True, expanded=True)
|
||||
if isinstance(user_infos, dict):
|
||||
# There was an error during the get_user call
|
||||
if e := user_infos.get('errors'):
|
||||
raise PyMISPError(f'Unable to get the user settings: {e}')
|
||||
raise PyMISPError(f'Unexpected error when initializing the connection: {user_infos}')
|
||||
elif len(user_infos) == 3:
|
||||
self._current_user, self._current_role, self._current_user_settings = user_infos
|
||||
else:
|
||||
raise PyMISPError(f'Unexpected error when initializing the connection: {user_infos}')
|
||||
except PyMISPError as e:
|
||||
raise e
|
||||
except Exception as e:
|
||||
raise PyMISPError(f'Unable to connect to MISP ({self.root_url}). Please make sure the API key and the URL are correct (http/https is required): {e}')
|
||||
|
||||
|
@ -2253,7 +2264,7 @@ class PyMISP:
|
|||
|
||||
:param user: user to get; `me` means the owner of the API key doing the query
|
||||
:param pythonify: Returns a PyMISP Object instead of the plain json output
|
||||
:param expanded: Also returns a MISPRole and a MISPUserSetting
|
||||
:param expanded: Also returns a MISPRole and a MISPUserSetting. Only taken in account if pythonify is True.
|
||||
"""
|
||||
user_id = get_uuid_or_id_from_abstract_misp(user)
|
||||
r = self._prepare_request('GET', f'users/view/{user_id}')
|
||||
|
|
|
@ -53,11 +53,11 @@ pydeep2 = {version = "^0.5.1", optional = true}
|
|||
lief = {version = "^0.13.2", optional = true}
|
||||
beautifulsoup4 = {version = "^4.12.2", optional = true}
|
||||
validators = {version = "^0.22.0", optional = true}
|
||||
sphinx-autodoc-typehints = {version = "^1.24.0", optional = true}
|
||||
sphinx-autodoc-typehints = {version = "^1.24.1", optional = true}
|
||||
recommonmark = {version = "^0.7.1", optional = true}
|
||||
reportlab = {version = "^4.0.6", optional = true}
|
||||
pyfaup = {version = "^1.2", optional = true}
|
||||
publicsuffixlist = {version = "^0.10.0.20231022", optional = true}
|
||||
publicsuffixlist = {version = "^0.10.0.20231104", optional = true}
|
||||
urllib3 = {extras = ["brotli"], version = "*", optional = true}
|
||||
Sphinx = [
|
||||
{version = "<7.2", python = "<3.9", optional = true},
|
||||
|
@ -81,10 +81,10 @@ ipython = [
|
|||
{version = "<8.13.0", python = "<3.9"},
|
||||
{version = "^8.13.0", python = ">=3.9"}
|
||||
]
|
||||
jupyterlab = "^4.0.7"
|
||||
jupyterlab = "^4.0.8"
|
||||
types-requests = "^2.31.0.10"
|
||||
types-python-dateutil = "^2.8.19.14"
|
||||
types-redis = "^4.6.0.7"
|
||||
types-redis = "^4.6.0.9"
|
||||
types-Flask = "^1.1.6"
|
||||
pytest-cov = "^4.1.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue