Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/confcom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.4.3
++++++
* Fix installing OPA on Windows and in strict networking environments

1.4.2
++++++
* Update policy model to use pydantic and explicitly declare collections where order doesn't affect function. These fields will serialize in alphabetical order and comparisons will ignore order.
Expand Down
16 changes: 10 additions & 6 deletions src/confcom/azext_confcom/lib/opa.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
from azext_confcom.lib.binaries import get_binaries_dir

_opa_path = os.path.abspath(os.path.join(get_binaries_dir(), "opa"))
_expected_sha256 = "fe8e191d44fec33db2a3d0ca788b9f83f866d980c5371063620c3c6822792877"
_opa_url = {
"Linux": "https://github.com/open-policy-agent/opa/releases/download/v1.10.1/opa_linux_amd64",
"Windows": "https://github.com/open-policy-agent/opa/releases/download/v1.10.1/opa_windows_amd64.exe",
}
_expected_sha256 = {
"Linux": "fe8e191d44fec33db2a3d0ca788b9f83f866d980c5371063620c3c6822792877",
"Windows": "4c932053350eabca47681208924046fbf3ad9de922d6853fb12cddf59aef15ce",
}


def opa_get():

opa_fetch_resp = requests.get(
f"https://openpolicyagent.org/downloads/v1.10.1/opa_{platform.system().lower()}_amd64",
verify=True,
)
opa_fetch_resp = requests.get(_opa_url[platform.system()], verify=True)
opa_fetch_resp.raise_for_status()

assert hashlib.sha256(opa_fetch_resp.content).hexdigest() == _expected_sha256
assert hashlib.sha256(opa_fetch_resp.content).hexdigest() == _expected_sha256[platform.system()]

with open(_opa_path, "wb") as f:
f.write(opa_fetch_resp.content)
Expand Down
2 changes: 1 addition & 1 deletion src/confcom/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

logger.warn("Wheel is not available, disabling bdist_wheel hook")

VERSION = "1.4.2"
VERSION = "1.4.3"

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
Loading