Exemplo n.º 1
0
 def _map_okta_group_profile(self, profile: GroupProfile) -> CorpGroupInfoClass:
     return CorpGroupInfoClass(
         displayName=self._map_okta_group_profile_to_group_name(profile),
         description=profile.description,
         members=[],
         groups=[],
         admins=[],
     )
Exemplo n.º 2
0
 def _map_azure_ad_group_to_corp_group(self, group):
     return CorpGroupInfoClass(
         displayName=self._map_azure_ad_group_to_group_name(group),
         description=group.get("description"),
         email=group.get("mail"),
         members=[],
         groups=[],
         admins=[],
     )
Exemplo n.º 3
0
    def build_corp_group_mce(self,
                             attrs: dict) -> Optional[MetadataChangeEvent]:
        """Creates a MetadataChangeEvent for LDAP groups."""
        cn = attrs.get("cn")
        if cn:
            full_name = cn[0].decode()
            owners = parse_from_attrs(attrs, "owner")
            members = parse_from_attrs(attrs, "uniqueMember")
            email = attrs["mail"][0].decode() if "mail" in attrs else full_name

            return MetadataChangeEvent(proposedSnapshot=CorpGroupSnapshotClass(
                urn=f"urn:li:corpGroup:{full_name}",
                aspects=[
                    CorpGroupInfoClass(
                        email=email,
                        admins=owners,
                        members=members,
                        groups=[],
                    )
                ],
            ))
        return None