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 app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ def MFA_API_URI(self) -> str: # noqa: N802
return "https://api.multifactor.dev"
return "https://api.multifactor.ru"

@computed_field # type: ignore
@cached_property
def is_global_catalog(self) -> bool:
"""Check if this is Global Catalog server."""
return self.PORT in (self.GLOBAL_LDAP_PORT, self.GLOBAL_LDAP_TLS_PORT)

@computed_field # type: ignore
@cached_property
def KRB5_CONFIG_SERVER(self) -> HttpUrl: # noqa: N802
Expand Down
9 changes: 8 additions & 1 deletion app/ldap_protocol/ldap_requests/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,16 @@ async def get_result(
result_code=LDAPCodes.INSUFFICIENT_ACCESS_RIGHTS,
)
return
base_directories = await get_base_directories(ctx.session)
if (
ctx.settings.is_global_catalog
and not self.base_object
and base_directories
):
self.base_object = base_directories[0].path_dn

query = self._build_query(
await get_base_directories(ctx.session),
base_directories,
user,
ctx.access_manager,
)
Expand Down