Skip to content
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
2 changes: 1 addition & 1 deletion microservices/gatewayJobScheduler/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _get_certificate_for_host(host, namespace, cert_snis, certs):

for sni in cert_snis:
if host in sni['name']:
cert_id = sni['certificate']
cert_id = sni['certificate']['id']
logger.debug("%s - Found custom cert with SNI match for %s - %s" % (namespace, host, cert_id))
cert = next((cert for cert in certs if cert['id'] == cert_id), None)
if cert is None:
Expand Down
12 changes: 9 additions & 3 deletions microservices/gatewayJobScheduler/tests/test_get_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def test_get_certificate_custom_domain_found():
"name": "test.custom.gov.bc.ca",
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
"created_at": 1731713874,
"certificate": cert_id,
"certificate": {
"id": cert_id
},
"tags": ["ns.test-ns"]
}]

Expand All @@ -47,7 +49,9 @@ def test_get_certificate_custom_domain_sni_not_found():
namespace = "test-ns"
cert_snis = [{
"name": "other.custom.gov.bc.ca",
"certificate": "some-cert-id"
"certificate": {
"id": "some-cert-id"
}
}]
certs = []

Expand All @@ -63,7 +67,9 @@ def test_get_certificate_missing_cert():

cert_snis = [{
"name": host,
"certificate": cert_id
"certificate": {
"id": cert_id
}
}]
certs = [] # Empty certs list, so cert won't be found

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def test_happy_transform_data_by_ns_with_custom_domain():
"name": "test.custom.gov.bc.ca",
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
"created_at": 1731713874,
"certificate": "41d14845-669f-4dcd-aff2-926fb32a4b25",
"certificate": {
"id": "41d14845-669f-4dcd-aff2-926fb32a4b25"
},
"tags": [
"ns.ns1"
]
Expand Down Expand Up @@ -184,7 +186,9 @@ def test_missing_cert_transform_data_by_ns_with_custom_domain(caplog):
"name": "other.custom.gov.bc.ca",
"id": "79009c9e-0f4d-40b5-9707-bf2fe9f50502",
"created_at": 1731713874,
"certificate": "41d14845-669f-4dcd-aff2-926fb32a4b25",
"certificate": {
"id": "41d14845-669f-4dcd-aff2-926fb32a4b25"
},
"tags": [
"ns.ns1"
]
Expand Down
Loading