Revize 5cd65ab4
Přidáno uživatelem Michal Seják před téměř 4 roky(ů)
src/controllers/crl_ocsp_controller.py | ||
---|---|---|
4 | 4 |
|
5 | 5 |
from src.exceptions.certificate_not_found_exception import CertificateNotFoundException |
6 | 6 |
from src.exceptions.private_key_not_found_exception import PrivateKeyNotFoundException |
7 |
from src.services.crl.crl_service import CrlService
|
|
7 |
from src.services.crl_ocsp.crl_ocsp_service import CrlOcspService
|
|
8 | 8 |
from src.controllers.return_codes import * |
9 | 9 |
|
10 | 10 |
E_WRONG_PARAMETERS = {"success": False, "data": "Invalid request, wrong parameters."} |
... | ... | |
14 | 14 |
class CrlOcspController: |
15 | 15 |
|
16 | 16 |
@inject |
17 |
def __init__(self, crl_service: CrlService): |
|
17 |
def __init__(self, crl_service: CrlOcspService):
|
|
18 | 18 |
self.crl_service = crl_service |
19 | 19 |
|
20 | 20 |
def get_crl(self, ca_id: str): |
... | ... | |
32 | 32 |
# generate the CRL |
33 | 33 |
try: |
34 | 34 |
crl = self.crl_service.generate_crl_response(identifier) |
35 |
except (CertificateNotFoundException, PrivateKeyNotFoundException):
|
|
35 |
except CertificateNotFoundException:
|
|
36 | 36 |
return E_NO_CERTIFICATES_FOUND, C_NOT_FOUND |
37 | 37 |
|
38 | 38 |
return Response(crl, mimetype="application/x-x509-ca-cert", |
... | ... | |
64 | 64 |
|
65 | 65 |
try: |
66 | 66 |
ocsp_response = self.crl_service.generate_ocsp_response(ca_id, der_ocsp_request) |
67 |
except CertificateNotFoundException or PrivateKeyNotFoundException:
|
|
67 |
except CertificateNotFoundException: |
|
68 | 68 |
return E_NO_CERTIFICATES_FOUND, C_NOT_FOUND |
69 | 69 |
|
70 | 70 |
return Response(ocsp_response, mimetype="application/ocsp-response") |
Také k dispozici: Unified diff
Re #8577 - Minor refactoring (crl -> crl_ocsp).