Skip to content

Commit 277825f

Browse files
Add insecure option to requests (#96)
* Add insecure option to requests Signed-off-by: Marius Bertram <marius@brtrm.de>
1 parent 8c1f7cc commit 277825f

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pre-commit
2-
black
2+
black==23.3.0
33
isort
44
flake8
55
mypy==0.961

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
17+
- Ensure insecure is passed to provider class (0.1.2)
1718
- patch fix for blob upload Windows, closes issue [93](https://github.com/oras-project/oras-py/issues/93) (0.1.19)
1819
- patch fix for empty manifest config on Windows, closes issue [90](https://github.com/oras-project/oras-py/issues/90) (0.1.18)
1920
- patch fix to correct session url pattern, closes issue [78](https://github.com/oras-project/oras-py/issues/78) (0.1.17)

oras/provider.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def __init__(self, hostname: Optional[str] = None, insecure: bool = False):
4747
self.token: Optional[str] = None
4848
self._auths: dict = {}
4949
self._basic_auth = None
50+
self._insecure = insecure
51+
52+
if insecure:
53+
requests.packages.urllib3.disable_warnings() # type: ignore
5054

5155
def logout(self, hostname: str):
5256
"""
@@ -842,6 +846,7 @@ def do_request(
842846
json=json,
843847
headers=headers,
844848
stream=stream,
849+
verify=not self._insecure,
845850
)
846851

847852
# A 401 response is a request for authentication

oras/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright The ORAS Authors."
33
__license__ = "Apache-2.0"
44

5-
__version__ = "0.1.19"
5+
__version__ = "0.1.2"
66
AUTHOR = "Vanessa Sochat"
77
EMAIL = "vsoch@users.noreply.github.com"
88
NAME = "oras"

0 commit comments

Comments
 (0)