From ca1a83f13b7e594ff900b11e4da4e78c2f26f1ed Mon Sep 17 00:00:00 2001 From: Caleb Riggs Date: Thu, 25 Jan 2024 11:34:41 -0500 Subject: [PATCH 1/3] Removed specific version for newer python compatibility --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index deed8b1..665fb6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["wheel", 'setuptools==64.0.0'] +requires = ["wheel", 'setuptools'] [project] name = "soarsdk" version = "1.0.1" From 075d466264091e6e7c38369bff6cf2ae4269d841 Mon Sep 17 00:00:00 2001 From: Caleb Riggs Date: Thu, 25 Jan 2024 11:37:27 -0500 Subject: [PATCH 2/3] Fixed password auth --- src/soarsdk/client.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/soarsdk/client.py b/src/soarsdk/client.py index f0545ce..a3543cf 100644 --- a/src/soarsdk/client.py +++ b/src/soarsdk/client.py @@ -108,7 +108,7 @@ def connect( splunkToken (str): Splunk SOAR generated token """ if kwargs.get("username") and kwargs.get("password"): - self.session = self.password_authenticate( + self.password_authenticate( kwargs["username"], kwargs["password"] ) if kwargs.get("splunkToken"): @@ -136,12 +136,8 @@ def password_authenticate(self, username: str, password: str): username (str): username for authentication password (str): password for authentication """ - url: str = self.base_url + "browse" - response: requests.Response = self.session.get( - self.base_url, auth=(username, password), verify=False - ) - response.raise_for_status() - self._set_session_headers() + + self.session.auth = (username, password) self.test_authorization() username = None password = None From 6eb925473a804a514125362230e16ad22e043381 Mon Sep 17 00:00:00 2001 From: Caleb Riggs Date: Thu, 25 Jan 2024 11:40:46 -0500 Subject: [PATCH 3/3] Fixed token auth session None --- README.md | 2 +- src/soarsdk/client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 400493d..d91cd7f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ from soarsdk.client import PhantomClient phantom: PhantomClient = PhantomClient(username='username', password='password') # Token Authentication -phantom: PhantomClient = PhantomClient(token='token_string') +phantom: PhantomClient = PhantomClient(splunkToken='token_string') ~~~ diff --git a/src/soarsdk/client.py b/src/soarsdk/client.py index a3543cf..f4f9392 100644 --- a/src/soarsdk/client.py +++ b/src/soarsdk/client.py @@ -112,7 +112,7 @@ def connect( kwargs["username"], kwargs["password"] ) if kwargs.get("splunkToken"): - self.session = self.token_authenticate(kwargs["splunkToken"]) + self.token_authenticate(kwargs["splunkToken"]) self.test_authorization()