36 lines
616 B
Python
36 lines
616 B
Python
# coding: utf-8
|
|
|
|
import asyncio
|
|
|
|
from phi.ldap.async_model import (
|
|
Hackers,
|
|
Robots,
|
|
Congregations,
|
|
User,
|
|
Service,
|
|
build_heritage,
|
|
iter_children,
|
|
)
|
|
from phi.ldap.async_client import AsyncClient
|
|
|
|
|
|
async def dlv(h):
|
|
return [el async for el in build_heritage(h, User)]
|
|
|
|
|
|
cl = AsyncClient(
|
|
"ldap://localhost",
|
|
port=389,
|
|
encryption=True,
|
|
validate=True,
|
|
ca_cert="openldap/cert.pem",
|
|
username="root",
|
|
password="root",
|
|
base_dn="dc=unit,dc=macaomilano,dc=org",
|
|
attribute_id="cn",
|
|
)
|
|
h = Hackers(cl)
|
|
r = Robots(cl)
|
|
g = Congregations(cl)
|
|
# asyncio.run(dlv(h))
|