Example #1
0
 def _map_azure_ad_groups(self, azure_ad_groups):
     for azure_ad_group in azure_ad_groups:
         corp_group_urn = self._map_azure_ad_group_to_urn(azure_ad_group)
         if not corp_group_urn:
             error_str = (
                 "Failed to extract DataHub Group Name from Azure Group for group named {}. "
                 "Skipping...".format(azure_ad_group.get("displayName")))
             logger.error(error_str)
             self.report.report_failure("azure_ad_group_mapping", error_str)
             continue
         group_name = self._extract_regex_match_from_dict_value(
             azure_ad_group,
             self.config.azure_ad_response_to_groupname_attr,
             self.config.azure_ad_response_to_groupname_regex,
         )
         if not self.config.groups_pattern.allowed(group_name):
             self.report.report_filtered(f"{corp_group_urn}")
             continue
         self.selected_azure_ad_groups.append(azure_ad_group)
         corp_group_snapshot = CorpGroupSnapshot(
             urn=corp_group_urn,
             aspects=[],
         )
         corp_group_info = self._map_azure_ad_group_to_corp_group(
             azure_ad_group)
         corp_group_snapshot.aspects.append(corp_group_info)
         yield corp_group_snapshot
Example #2
0
 def _map_azure_ad_groups(self, azure_ad_groups):
     for azure_ad_group in azure_ad_groups:
         corp_group_urn, error_str = self._map_identity_to_urn(
             self._map_azure_ad_group_to_urn,
             azure_ad_group,
             "azure_ad_group_mapping",
             "group",
         )
         if error_str is not None:
             continue
         group_name = self._extract_regex_match_from_dict_value(
             azure_ad_group,
             self.config.azure_ad_response_to_groupname_attr,
             self.config.azure_ad_response_to_groupname_regex,
         )
         if not self.config.groups_pattern.allowed(group_name):
             self.report.report_filtered(f"{corp_group_urn}")
             continue
         self.selected_azure_ad_groups.append(azure_ad_group)
         corp_group_snapshot = CorpGroupSnapshot(
             urn=corp_group_urn,
             aspects=[],
         )
         corp_group_info = self._map_azure_ad_group_to_corp_group(
             azure_ad_group)
         corp_group_snapshot.aspects.append(corp_group_info)
         yield corp_group_snapshot
Example #3
0
 def _map_okta_groups(
         self, okta_groups: Iterable[Group]) -> Iterable[CorpGroupSnapshot]:
     for okta_group in okta_groups:
         corp_group_urn = self._map_okta_group_profile_to_urn(
             okta_group.profile)
         if corp_group_urn is None:
             error_str = f"Failed to extract DataHub Group Name from Okta Group: Invalid regex pattern provided or missing profile attribute for group named {okta_group.profile.name}. Skipping..."
             logger.error(error_str)
             self.report.report_failure("okta_group_mapping", error_str)
             continue
         corp_group_snapshot = CorpGroupSnapshot(
             urn=corp_group_urn,
             aspects=[],
         )
         corp_group_info = self._map_okta_group_profile(okta_group.profile)
         corp_group_snapshot.aspects.append(corp_group_info)
         yield corp_group_snapshot
Example #4
0
 def _map_azure_ad_groups(self, azure_ad_groups):
     for azure_ad_group in azure_ad_groups:
         corp_group_urn = self._map_azure_ad_group_to_urn(azure_ad_group)
         if not corp_group_urn:
             error_str = "Failed to extract DataHub Group Name from Azure Group for group named {}. Skipping...".format(
                 azure_ad_group.get("displayName")
             )
             logger.error(error_str)
             self.report.report_failure("azure_ad_group_mapping", error_str)
             continue
         corp_group_snapshot = CorpGroupSnapshot(
             urn=corp_group_urn,
             aspects=[],
         )
         corp_group_info = self._map_azure_ad_group_to_corp_group(azure_ad_group)
         corp_group_snapshot.aspects.append(corp_group_info)
         yield corp_group_snapshot