8000 Mypy conformance for FabricAdmin and CertificateAuthority by jtrejoespinoza-grid · Pull Request #39920 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Mypy conformance for FabricAdmin and CertificateAuthority #39920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
23 changes: 12 additions & 11 deletions src/controller/python/chip/CertificateAuthority.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _Handle(cls):
def logger(cls):
return logging.getLogger('CertificateAuthority')

def __init__(self, chipStack: ChipStack.ChipStack, caIndex: int, persistentStorage: PersistentStorage = None):
def __init__(self, chipStack: ChipStack.ChipStack, caIndex: int, persistentStorage: Optional[PersistentStorage] = None):
''' Initializes the CertificateAuthority. This will set-up the associated C++ OperationalCredentialsAdapter
as well.

Expand Down Expand Up @@ -200,14 +200,6 @@ def adminList(self) -> list[FabricAdmin.FabricAdmin]:
def maximizeCertChains(self) -> bool:
return self._maximizeCertChains

@property
def alwaysOmitIcac(self) -> bool:
return self._alwaysOmitIcac

@property
def certificateValidityPeriodSec(self) -> int:
return self._certificateValidityPeriodSec

@maximizeCertChains.setter
def maximizeCertChains(self, enabled: bool):
self._chipStack.Call(
Expand All @@ -216,6 +208,10 @@ def maximizeCertChains(self, enabled: bool):

self._maximizeCertChains = enabled

@property
def alwaysOmitIcac(self) -> bool:
return self._alwaysOmitIcac

@alwaysOmitIcac.setter
def alwaysOmitIcac(self, enabled: bool):
self._chipStack.Call(
Expand All @@ -224,6 +220,10 @@ def alwaysOmitIcac(self, enabled: bool):

self._alwaysOmitIcac = enabled

@property
def certificateValidityPeriodSec(self) -> int:
return self._certificateValidityPeriodSec

@certificateValidityPeriodSec.setter
def certificateValidityPeriodSec(self, validity: int):
if validity < 0:
Expand All @@ -250,13 +250,14 @@ def _Handle(cls):
def logger(cls):
return logging.getLogger('CertificateAuthorityManager')

def __init__(self, chipStack: ChipStack.ChipStack, persistentStorage: PersistentStorage = None):
def __init__(self, chipStack: ChipStack.ChipStack, persistentStorage: Optional[PersistentStorage] = None):
''' Initializes the manager.

chipStack: Reference to a chip.ChipStack object that is used to initialize
CertificateAuthority instances.

persistentStorage: If provided, over-rides the default instance in the provided chipStack
persistentStorage: An optional reference to persistentStorage, if provided,
over-rides the default instance in the provided chipStack
when initializing CertificateAuthority instances.
'''
self._chipStack = chipStack
Expand Down
2 changes: 1 addition & 1 deletion src/controller/python/chip/FabricAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, certificateAuthority: CertificateAuthority.CertificateAuthori
self._activeControllers: List[ChipDeviceCtrl.ChipDeviceController] = []

def NewController(self, nodeId: Optional[int] = None, paaTrustStorePath: str = "",
useTestCommissioner: bool = False, catTags: List[int] = [], keypair: p256keypair.P256Keypair = None,
useTestCommissioner: bool = False, catTags: List[int] = [], keypair: Optional[p256keypair.P256Keypair] = None,
dacRevocationSetPath: str = ""):
''' Create a new chip.ChipDeviceCtrl.ChipDeviceController instance on this fabric.

Expand Down
Loading
0