From 133997aa6675069537caf666897b4ae54b21239d Mon Sep 17 00:00:00 2001 From: Matthew Ford Date: Mon, 20 Jul 2026 17:08:33 -0700 Subject: [PATCH] Make Azure client id and client secret optional. --- keepercommander/commands/discoveryrotation.py | 6 ++++++ keepercommander/commands/pam_import/base.py | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/keepercommander/commands/discoveryrotation.py b/keepercommander/commands/discoveryrotation.py index fda7bb82f..3d5b4a6bf 100644 --- a/keepercommander/commands/discoveryrotation.py +++ b/keepercommander/commands/discoveryrotation.py @@ -2809,6 +2809,9 @@ def parse_properties(self, params, record, **kwargs): # type: (KeeperParams, va if extra_properties: self.assign_typed_fields(record, [RecordEditMixin.parse_field(x) for x in extra_properties]) + # Fields that the backend previously required but now treats as optional for pamAzureConfiguration. + AZURE_OPTIONAL_FIELDS = frozenset({'clientId', 'clientSecret'}) + def verify_required(self, record): # type: (vault.TypedRecord) -> None for field in record.fields: if field.required: @@ -2817,6 +2820,9 @@ def verify_required(self, record): # type: (vault.TypedRecord) -> None field.value = [{ 'type': 'ON_DEMAND' }] + elif (record.record_type == 'pamAzureConfiguration' + and field.label in self.AZURE_OPTIONAL_FIELDS): + pass else: self.warnings.append(f'Empty required field: "{field.get_field_name()}"') for custom in record.custom: diff --git a/keepercommander/commands/pam_import/base.py b/keepercommander/commands/pam_import/base.py index 412833c08..85cc852b4 100644 --- a/keepercommander/commands/pam_import/base.py +++ b/keepercommander/commands/pam_import/base.py @@ -143,8 +143,8 @@ def _initialize(self): # Azure environment: pamAzureConfiguration self.az_entra_id: str = "" # required, text:azureId - self.az_client_id: str = "" # required, secret:clientId - self.az_client_secret: str = "" # required, secret:clientSecret + self.az_client_id: str = "" # optional, secret:clientId + self.az_client_secret: str = "" # optional, secret:clientSecret self.az_subscription_id: str = "" # required, secret:subscriptionId self.az_tenant_id: str = "" # required, secret:tenantId self.az_resource_groups: List[str] = [] # optional, multiline:resourceGroups @@ -277,9 +277,9 @@ def __init__(self, environment_type:str, settings:dict, controller_uid:str, fold elif environment_type == "azure": val = settings.get("az_entra_id", None) # required if isinstance(val, str): self.az_entra_id = val - val = settings.get("az_client_id", None) # required + val = settings.get("az_client_id", None) # optional if isinstance(val, str): self.az_client_id = val - val = settings.get("az_client_secret", None) # required + val = settings.get("az_client_secret", None) # optional if isinstance(val, str): self.az_client_secret = val val = settings.get("az_subscription_id", None) # required if isinstance(val, str): self.az_subscription_id = val