Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2024-09-19 #803

Merged
merged 11 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ install_requirements: install_piptools requirements

.PHONY: requirements
requirements: install_piptools
pip-compile --resolver=backtracking requirements*.in -o requirements-all.txt
pip-compile --resolver=backtracking requirements.in
pip-compile --strip-extras --resolver=backtracking requirements*.in -o requirements-all.txt
pip-compile --strip-extras --resolver=backtracking requirements.in

.PHONY: write_version
write_version:
Expand Down
8 changes: 6 additions & 2 deletions buildpack/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ def is_version_supported(version):

def is_version_maintained(version):
# LTS / MTS versions: https://docs.mendix.com/releasenotes/studio-pro/lts-mts
if version.major == 7 and version.minor == 23:
return True
if version.major == 8 and version.minor == 18:
return True
if version.major == 9 and version.minor == 24:
return True
if version.major == 10 and version.minor == 6:
return True
if version.major == 10 and version.minor == 12:
return True
if version.major == 10 and version.minor == 18:
return True
if version.major == 10 and version.minor == 21:
return True
return False


Expand Down
2 changes: 1 addition & 1 deletion buildpack/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def _upsert_config(config, key, value, overwrite=False, append=False):
if not append and overwrite:
config[key] = value
else:
if append and type(config[key]) == type(value):
if append and type(config[key]) is type(value):
if isinstance(value, list):
config[key].extend(value)
elif isinstance(value, (dict, set)):
Expand Down
76 changes: 0 additions & 76 deletions me-central-1-bundle.pem

This file was deleted.

76 changes: 0 additions & 76 deletions net-additions.diff

This file was deleted.

9 changes: 4 additions & 5 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
click==8.1.7
idna==3.7
pytest==8.2.2
idna==3.8
pytest==8.3.3
pytest-timer==1.0.0
pytest-timeout==2.3.1
pylint==3.2.3
pyopenssl==24.0.0
pylint==3.2.7
randomname==0.2.1
requests-mock==1.12.1
ruff==0.4.8
ruff==0.6.4
parameterized==0.9.0
8 changes: 4 additions & 4 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
backoff==2.2.1
certifi==2024.7.4
cryptography==42.0.8
certifi==2024.8.30
cryptography==43.0.1
distro==1.9.0
httplib2==0.22.0
jinja2==3.1.4
omegaconf==2.3.0
psycopg2-binary==2.9.9
pyyaml==6.0.1
pyyaml==6.0.2
requests==2.32.3
urllib3==2.2.1
urllib3==2.2.3
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
# pip-compile --strip-extras requirements.in
#
antlr4-python3-runtime==4.9.3
# via omegaconf
backoff==2.2.1
# via -r requirements.in
certifi==2024.7.4
certifi==2024.8.30
# via
# -r requirements.in
# requests
cffi==1.14.4
# via cryptography
charset-normalizer==2.0.3
# via requests
cryptography==42.0.8
cryptography==43.0.1
# via -r requirements.in
distro==1.9.0
# via -r requirements.in
Expand All @@ -36,13 +36,13 @@ pycparser==2.20
# via cffi
pyparsing==2.4.7
# via httplib2
pyyaml==6.0.1
pyyaml==6.0.2
# via
# -r requirements.in
# omegaconf
requests==2.32.3
# via -r requirements.in
urllib3==2.2.2
urllib3==2.2.3
# via
# -r requirements.in
# requests
60 changes: 38 additions & 22 deletions tests/integration/test_certificate_authorities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import base64
from datetime import datetime, timedelta
from socket import gethostname

from OpenSSL import crypto
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID

from tests.integration import basetest

Expand All @@ -15,28 +19,40 @@ def setUp(self):
self.certificate = self._create_self_signed_cert()

def _create_self_signed_cert(self):
# Generate a private key
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
)

# Create a self-signed certificate
subject = issuer = x509.Name([
x509.NameAttribute(NameOID.COUNTRY_NAME, "NL"),
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, "Rotterdam"),
x509.NameAttribute(NameOID.LOCALITY_NAME, "Rotterdam"),
x509.NameAttribute(NameOID.ORGANIZATION_NAME, "Mendix"),
x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, "Mendix"),
x509.NameAttribute(NameOID.COMMON_NAME, gethostname()),
])
cert = x509.CertificateBuilder().subject_name(
subject
).issuer_name(
issuer
).public_key(
private_key.public_key()
).serial_number(
1000
).not_valid_before(
datetime.utcnow()
).not_valid_after(
datetime.utcnow() + timedelta(days=365*10)
).add_extension(
x509.BasicConstraints(ca=True, path_length=None), critical=True,
).sign(private_key, hashes.SHA256())

cert_pem = cert.public_bytes(serialization.Encoding.PEM)

# Create a key pair
k = crypto.PKey()
k.generate_key(crypto.TYPE_RSA, 1024)

# Create a self-signed cert
cert = crypto.X509()
cert.get_subject().C = "NL"
cert.get_subject().ST = "Rotterdam"
cert.get_subject().L = "Rotterdam"
cert.get_subject().O = "Mendix" # noqa: E741
cert.get_subject().OU = "Mendix"
cert.get_subject().CN = gethostname()
cert.set_serial_number(1000)
cert.gmtime_adj_notBefore(0)
cert.gmtime_adj_notAfter(10 * 365 * 24 * 60 * 60)
cert.set_issuer(cert.get_subject())
cert.set_pubkey(k)
cert.sign(k, "sha1")

# Return a .PEM certificate
return crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
return cert_pem

def test_certificate_authorities(self):
self.stage_container(
Expand Down
7 changes: 4 additions & 3 deletions tests/unit/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ def test_mx7_supported(self):


class TestCaseMxMaintained(TestCase):
def test_mx7_maintained(self):
assert runtime.is_version_maintained(MXVersion("7.23.1"))

def test_mx7_not_maintained(self):
assert not runtime.is_version_maintained(MXVersion("7.23.1"))
assert not runtime.is_version_maintained(MXVersion("7.16"))

def test_mx8_maintained(self):
Expand All @@ -49,6 +47,9 @@ def test_mx9_not_maintained(self):

def test_mx10_maintained(self):
assert runtime.is_version_maintained(MXVersion("10.6.1"))
assert runtime.is_version_maintained(MXVersion("10.12.1"))
assert runtime.is_version_maintained(MXVersion("10.18.1"))
assert runtime.is_version_maintained(MXVersion("10.21.1"))

def test_mx10_not_maintained(self):
assert not runtime.is_version_maintained(MXVersion("10.5.1"))
Loading
Loading