Skip to content
Merged
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
6 changes: 6 additions & 0 deletions keepercommander/commands/discoveryrotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions keepercommander/commands/pam_import/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading