Revize 61fb67b4
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
src/controllers/certificates_controller.py | ||
---|---|---|
287 | 287 |
return {"success": True, "data": trust_chain[-1].pem_data}, C_SUCCESS |
288 | 288 |
|
289 | 289 |
def get_certificate_trust_chain_by_id(self, id): |
290 |
"""get certificate's trust chain by ID
|
|
290 |
"""get certificate's trust chain by ID (including root certificate)
|
|
291 | 291 |
|
292 | 292 |
Get certificate trust chain in PEM format by ID |
293 | 293 |
|
... | ... | |
310 | 310 |
if cert.parent_id is None: |
311 | 311 |
return E_NO_CERTIFICATES_FOUND, C_NO_DATA |
312 | 312 |
|
313 |
trust_chain = self.certificate_service.get_chain_of_trust(cert.parent_id) |
|
313 |
trust_chain = self.certificate_service.get_chain_of_trust(cert.parent_id, exclude_root=False)
|
|
314 | 314 |
|
315 | 315 |
ret = [] |
316 | 316 |
for intermediate in trust_chain: |
tests/integration_tests/rest_api/certificates_test.py | ||
---|---|---|
537 | 537 |
|
538 | 538 |
def test_chain_of_trust(server): |
539 | 539 |
expected = [] |
540 |
for i in range(6, 2, -1):
|
|
540 |
for i in range(6, 1, -1):
|
|
541 | 541 |
ret = server.get(f"/api/certificates/{i}") |
542 | 542 |
|
543 | 543 |
assert ret.status_code == 200 |
Také k dispozici: Unified diff
Re #8709 - included root certificate into the trust chain