Revize 67723931
Přidáno uživatelem Michal Seják před téměř 4 roky(ů)
src/services/certificate_service.py | ||
---|---|---|
255 | 255 |
|
256 | 256 |
return self.certificate_repository.read_all(cert_type) |
257 | 257 |
|
258 |
def get_certificates_filter(self, target_types, target_usages, target_cn_substring, page, per_page): |
|
259 |
""" |
|
260 |
Tries to fetch a filtered list of all certificates from the certificate repository. |
|
261 |
:param target_types: certificate types (filter) |
|
262 |
:param target_usages: certificate usages (filter) |
|
263 |
:param target_cn_substring: certificate CN substring (filter) |
|
264 |
:param page: target page |
|
265 |
:param per_page: target page size |
|
266 |
:return: List of instances of the Certificate class representing filtered certificates |
|
267 |
present in the certificate repository. An empty list is returned when no certificates are found. |
|
268 |
""" |
|
269 |
return self.certificate_repository.read_all_filter(target_types, target_usages, target_cn_substring, |
|
270 |
page, per_page) |
|
271 |
|
|
258 | 272 |
def get_chain_of_trust(self, from_id: int, to_id: int = -1, exclude_root=True) -> List[Certificate]: |
259 | 273 |
""" |
260 | 274 |
Traverses the certificate hierarchy tree upwards till a certificate with the `to_id` ID is found or till a |
... | ... | |
378 | 392 |
Logger.error(f"No such certificate found 'ID = {issuer_id}'.") |
379 | 393 |
raise CertificateNotFoundException(issuer_id) |
380 | 394 |
|
395 |
return self.certificate_repository.get_all_issued_by_filter(issuer_id, target_types, target_usages, |
|
396 |
target_cn_substring, page, per_page) |
|
397 |
|
|
381 | 398 |
def set_certificate_revocation_status(self, id, status, reason="unspecified"): |
382 | 399 |
""" |
383 | 400 |
Set certificate status to 'valid' or 'revoked'. |
... | ... | |
513 | 530 |
|
514 | 531 |
return self.configuration.base_server_url + "/api/ocsp/" + str(ca_identifier) |
515 | 532 |
|
533 |
|
|
516 | 534 |
class RevocationReasonInvalidException(Exception): |
517 | 535 |
""" |
518 | 536 |
Exception that denotes that the caller was trying to revoke |
Také k dispozici: Unified diff
Re #8702 - Finished implementing filtering methods in the CertService.