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

Replace deprecated release actions #775

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cae84a9
Bump certifi from 2024.2.2 to 2024.6.2 (#754)
dependabot[bot] Jun 6, 2024
b2af7f3
Bump ruff from 0.4.5 to 0.4.8 (#756)
dependabot[bot] Jun 6, 2024
d227948
Bump requests from 2.32.2 to 2.32.3 (#753)
dependabot[bot] Jun 6, 2024
cfa3e4f
Bump pytest from 8.2.1 to 8.2.2 (#763)
dependabot[bot] Jun 11, 2024
fa1be1b
Bump pylint from 3.2.2 to 3.2.3 (#764)
dependabot[bot] Jun 11, 2024
fb20886
Bump cryptography from 42.0.7 to 42.0.8 (#762)
dependabot[bot] Jun 11, 2024
48dea8f
admin API should listen on all interfaces (#705)
xiwenc Jun 11, 2024
3f28d91
Merge pull request #776 from mendix/master
jeohist Jul 10, 2024
91d72fb
MET-2698 - Changing the startup order for user-metering sidecar (#784)
rus-kh Aug 15, 2024
e80ec3a
Replace deprecated release actions
jeohist Jul 10, 2024
d150183
Update to Python 3.10.14, update CDN location
jeohist Jul 12, 2024
1ec1d79
Bump ruff from 0.4.8 to 0.5.7
dependabot[bot] Aug 12, 2024
79119c8
Bump certifi from 2024.6.2 to 2024.7.4
dependabot[bot] Jul 8, 2024
349d91c
Bump pylint from 3.2.3 to 3.2.6
dependabot[bot] Jul 22, 2024
1cf9ce8
Bump urllib3 from 2.2.1 to 2.2.2
dependabot[bot] Jun 17, 2024
7a333c4
Bump `dd-java-agent` from 1.27.0 to 1.37.0
jeohist Jul 12, 2024
059dd09
Update Java dependencies
jeohist Jul 12, 2024
4656498
Remove pyOpenSSL
jeohist Mar 25, 2024
7f7ae85
Bump pip and pip-tools
jeohist Jul 12, 2024
4197fa9
Upgrade fluent-bit to 3.1.2
jeohist Jul 13, 2024
9d829ad
Disable New Relic / Splunk tests
jeohist Aug 15, 2024
0a1cd29
Disable New Relic / Splunk tests
jeohist Aug 15, 2024
bf7907e
Merge pull request #786 from mendix/disable_tests
ekremsekerci Aug 15, 2024
ccd74fe
Merge branch 'develop' into pipeline_unclogging
jeohist Aug 15, 2024
0d1a248
Merge branch 'develop' into pipeline_unclogging
jeohist Sep 12, 2024
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
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
4 changes: 2 additions & 2 deletions dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ dependencies:
version: 4.37.0
trace-agent:
artifact: datadog/dd-java-agent-{{ version }}.jar
version: 1.27.0
version: 1.37.0
dynatrace:
agent:
artifact: "{{ url }}/e/{{ environment }}/api/v1/deployment/installer/agent/unix/paas/latest?include=java&bitness=64&Api-Token={{ token }}"
managed: false
fluentbit:
artifact: fluentbit/fluent-bit-{{ version }}-cflinuxfs4.tar.gz
version: 1.9.2
version: 3.1.2
java:
keyutil:
artifact: java-keyutil/keyutil-{{ version }}.jar
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ idna==3.7
pytest==8.2.2
pytest-timer==1.0.0
pytest-timeout==2.3.1
pylint==3.2.3
pyopenssl==24.0.0
pytest-timestamper==0.0.10
pylint==3.2.6
randomname==0.2.1
requests-mock==1.12.1
ruff==0.4.8
ruff==0.5.7
parameterized==0.9.0
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ omegaconf==2.3.0
psycopg2-binary==2.9.9
pyyaml==6.0.1
requests==2.32.3
urllib3==2.2.1
urllib3==2.2.2
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
75 changes: 48 additions & 27 deletions tests/unit/test_runtime_configuration.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import base64
import json
import os
from datetime import datetime, timedelta
from socket import gethostname
from unittest import TestCase, mock

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

from buildpack import util
from buildpack.core import runtime, security
from lib.m2ee.version import MXVersion
from OpenSSL import crypto


class M2EEMock:
Expand Down Expand Up @@ -87,34 +93,49 @@ def test_custom_runtime_setting_is_set(self):
)


def _create_self_signed_cert():
# 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")

# Create a P12 container
p12 = crypto.PKCS12()
p12.set_certificate(cert)

return p12.export()
class TestClientCertificateConfiguration(TestCase):
def _create_self_signed_cert(): # pylint: disable=no-method-argument
# 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())

# Serialize private key and certificate to a PKCS12 container
p12 = pkcs12.serialize_key_and_certificates(
name=b"selfsigned",
key=private_key,
cert=cert,
cas=None,
encryption_algorithm=serialization.NoEncryption()
)

class TestClientCertificateConfiguration(TestCase):
return p12

CERTIFICATE_ENV = {
"CLIENT_CERTIFICATES": json.dumps(
Expand Down
Loading