Revize 151e7604
Přidáno uživatelem Jan Pašek před asi 4 roky(ů)
src/services/certificate_service.py | ||
---|---|---|
1 | 1 |
from typing import List |
2 | 2 |
|
3 |
from injector import inject |
|
4 |
|
|
3 | 5 |
from src.constants import ROOT_CA_ID, INTERMEDIATE_CA_ID, CA_ID, CERTIFICATE_ID |
4 | 6 |
from src.dao.certificate_repository import CertificateRepository |
5 | 7 |
from src.model.certificate import Certificate |
... | ... | |
15 | 17 |
|
16 | 18 |
class CertificateService: |
17 | 19 |
|
20 |
@inject |
|
18 | 21 |
def __init__(self, cryptography_service: CryptographyService, certificate_repository: CertificateRepository): |
19 | 22 |
self.cryptography_service = cryptography_service |
20 | 23 |
self.certificate_repository = certificate_repository |
src/services/key_service.py | ||
---|---|---|
1 |
from injector import inject |
|
2 |
|
|
1 | 3 |
from src.dao.private_key_repository import PrivateKeyRepository |
2 | 4 |
from src.model.private_key import PrivateKey |
3 | 5 |
from src.services.cryptography import CryptographyService |
... | ... | |
5 | 7 |
|
6 | 8 |
class KeyService: |
7 | 9 |
|
10 |
@inject |
|
8 | 11 |
def __init__(self, cryptography_service: CryptographyService, private_key_repository: PrivateKeyRepository): |
9 | 12 |
self.cryptography_service = cryptography_service |
10 | 13 |
self.private_key_repository = private_key_repository |
Také k dispozici: Unified diff
Re #8569 Prepared services for dependency injection