예제 #1
0
파일: okta.py 프로젝트: hsheth2/datahub
 def _map_okta_users(self, okta_users: Iterable[User]) -> Iterable[CorpUserSnapshot]:
     for okta_user in okta_users:
         corp_user_urn = self._map_okta_user_profile_to_urn(okta_user.profile)
         if corp_user_urn is None:
             error_str = f"Failed to extract DataHub Username from Okta User: Invalid regex pattern provided or missing profile attribute for User with login {okta_user.profile.login}. Skipping..."
             logger.error(error_str)
             self.report.report_failure("okta_user_mapping", error_str)
             continue
         corp_user_snapshot = CorpUserSnapshot(
             urn=corp_user_urn,
             aspects=[],
         )
         corp_user_info = self._map_okta_user_profile(okta_user.profile)
         corp_user_snapshot.aspects.append(corp_user_info)
         yield corp_user_snapshot
예제 #2
0
 def _map_azure_ad_users(self, azure_ad_users):
     for user in azure_ad_users:
         corp_user_urn, error_str = self._map_identity_to_urn(
             self._map_azure_ad_user_to_urn, user, "azure_ad_user_mapping",
             "user")
         if error_str is not None:
             continue
         if not self.config.users_pattern.allowed(corp_user_urn):
             self.report.report_filtered(f"{corp_user_urn}.*")
             continue
         corp_user_snapshot = CorpUserSnapshot(
             urn=corp_user_urn,
             aspects=[],
         )
         corp_user_info = self._map_azure_ad_user_to_corp_user(user)
         corp_user_snapshot.aspects.append(corp_user_info)
         yield corp_user_snapshot
예제 #3
0
파일: azure_ad.py 프로젝트: erley/datahub
 def _map_azure_ad_users(self, azure_ad_users):
     for user in azure_ad_users:
         corp_user_urn = self._map_azure_ad_user_to_urn(user)
         if not corp_user_urn:
             error_str = "Failed to extract DataHub Username from Azure AD User {}. Skipping...".format(
                 user.get("displayName")
             )
             logger.error(error_str)
             self.report.report_failure("azure_ad_user_mapping", error_str)
             continue
         corp_user_snapshot = CorpUserSnapshot(
             urn=corp_user_urn,
             aspects=[],
         )
         corp_user_info = self._map_azure_ad_user_to_corp_user(user)
         corp_user_snapshot.aspects.append(corp_user_info)
         yield corp_user_snapshot