Skip to content

Commit 9b5c265

Browse files
authored
Merge pull request #182 from intelowlproject/develop
4.4.0
2 parents 99e6b1a + 2e46fd3 commit 9b5c265

File tree

8 files changed

+17
-7
lines changed

8 files changed

+17
-7
lines changed

.github/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [4.4.0](https://github.com/intelowlproject/pyintelowl/releases/tag/4.4.0)
4+
- this version supports the usage of a proxy while connecting to IntelOwl via Python code.
5+
36
## [4.3.0](https://github.com/intelowlproject/pyintelowl/releases/tag/4.3.0)
47
- this version supports the new Playbooks feature released with IntelOwl v4.1.0
58

.github/workflows/pythonpublish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
pip install setuptools wheel twine
2020
- name: Build and publish
2121
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
TWINE_USERNAME: __token__
23+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2424
run: |
2525
python setup.py sdist bdist_wheel
2626
twine upload dist/*

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Commands:
6262

6363
```python
6464
from pyintelowl import IntelOwl
65-
obj = IntelOwl("<your_api_key>", "<your_intelowl_instance_url>", "optional<path_to_pem_file>")
65+
obj = IntelOwl("<your_api_key>", "<your_intelowl_instance_url>", "optional<path_to_pem_file>", "optional<proxies>")
6666
```
6767

6868
For more comprehensive documentation, please see https://pyintelowl.readthedocs.io/.

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import os
1414
import sys
1515

16-
VERSION = "4.3.0"
16+
VERSION = "4.4.0"
1717
GITHUB_URL = "https://github.com/intelowlproject/pyintelowl"
1818

1919
sys.path.append(os.path.abspath("../"))

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Usage as SDK/library
7070
"<your_api_key>",
7171
"<your_intelowl_instance_url>",
7272
"optional<path_to_pem_file>"
73+
"optional<proxies>"
7374
)
7475
"""
7576

pyintelowl/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def cli(ctx: ClickContext, debug: bool):
2727
cert = False
2828
elif cert in ["None", "True"]:
2929
cert = True
30-
ctx.obj = IntelOwl(api_key, url, cert, logger, cli=True)
30+
ctx.obj = IntelOwl(api_key, url, cert, {}, logger, cli=True)
3131

3232

3333
# Compile all groups and commands

pyintelowl/pyintelowl.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ def __init__(
2424
token: str,
2525
instance_url: str,
2626
certificate: str = None,
27+
proxies: dict = None,
2728
logger: logging.Logger = None,
2829
cli: bool = False,
2930
):
3031
self.token = token
3132
self.instance = instance_url
3233
self.certificate = certificate
33-
self.cli = cli
3434
if logger:
3535
self.logger = logger
3636
else:
3737
self.logger = logging.getLogger(__name__)
38+
if proxies and not isinstance(proxies, dict):
39+
raise TypeError("proxies param must be a dictionary")
40+
self.proxies = proxies
41+
self.cli = cli
3842

3943
@property
4044
def session(self) -> requests.Session:
@@ -45,6 +49,8 @@ def session(self) -> requests.Session:
4549
session = requests.Session()
4650
if self.certificate is not True:
4751
session.verify = self.certificate
52+
if self.proxies:
53+
session.proxies = self.proxies
4854
session.headers.update(
4955
{
5056
"Authorization": f"Token {self.token}",

pyintelowl/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.3.0"
1+
__version__ = "4.4.0"

0 commit comments

Comments
 (0)