Repository: goauthentik/authentik

Issue:
Posssible issue with LDAP after 2023.6.0 upgrade?
### Discussed in https://github.com/goauthentik/authentik/discussions/6185

<div type='discussions-op-text'>

<sup>Originally posted by **AndrewBucklin** July  7, 2023</sup>
After upgrading to 2023.6.0, the LDAP sync appears to be syncing 5 users at a time and creating a ton of entries in the Sync Status window. Is this normal? This list continues to grow, but here's what it looks like right now:

> Sync status
> 
> ldap_sync:default:users:72ee93db-39d0-406e-8058-b814a0930744
> 
> Last sync: 7/7/2023, 4:48:41 PM
> Synced 5 objects.
> ldap_sync:default:users:1e498568-f2c3-4212-b090-dbc1fcde940a
> 
> Last sync: 7/7/2023, 4:48:12 PM
> Synced 5 objects.
> ldap_sync:default:users:e62eb0d7-d3c3-46b8-8a74-36544951df0c
> 
> Last sync: 7/7/2023, 4:48:52 PM
> Synced 5 objects.
> ldap_sync:default:membership
> 
> Last sync: 7/7/2023, 4:34:08 PM
> Synced 5736 objects.
> ldap_sync:default:users:5786c286-be82-4e13-a206-fd38b792d59c
> 
> Last sync: 7/7/2023, 4:50:11 PM
> Synced 5 objects.
> ldap_sync:default:users:8c4601fa-c3a4-4fbd-a49c-e74bf7f9a280
> 
> Last sync: 7/7/2023, 4:50:22 PM
> Synced 5 objects.
> ldap_sync:default:users:1f9f4657-0053-4bb7-82f0-f89f163c2ec3
> 
> Last sync: 7/7/2023, 4:47:36 PM
> Synced 5 objects.
> ldap_sync:default:users:0411e4c4-b427-413e-9870-469643827f87
> 
> Last sync: 7/7/2023, 4:50:52 PM
> Synced 5 objects.
> ldap_sync:default:users:0561cadd-2f8e-4432-befb-fe100ff779bf
> 
> Last sync: 7/7/2023, 4:51:02 PM
> Synced 5 objects.
> ldap_sync:default:users:a0965cd3-306f-48d2-887b-88a0559fe627
> 
> Last sync: 7/7/2023, 4:48:50 PM
> Synced 5 objects.
> ldap_sync:default:users:27357591-647d-4765-9256-127c5b03a11a
> 
> Last sync: 7/7/2023, 4:49:56 PM
> Synced 5 objects.
> ldap_sync:default:users:2e7429e0-3b5f-4fa7-8df9-e270c85697ec
> 
> Last sync: 7/7/2023, 4:50:17 PM
> Synced 5 objects.
> ldap_sync:default:group
> 
> Last sync: 7/7/2023, 4:34:03 PM
> Synced 98 objects.
> ldap_sync:default:users:7bbad8c6-1612-460c-ae2e-ff93cda66de9
> 
> Last sync: 7/7/2023, 4:49:36 PM
> Synced 5 objects.
> ldap_sync:default:users:8e981fc1-1976-411b-93c0-5d005300ab74
> 
> Last sync: 7/7/2023, 4:49:31 PM
> Synced 5 objects.
> ldap_sync:default:user
> 
> Last sync: 7/7/2023, 2:56:18 PM
> Synced 156 objects.

</div>


Discussion:

Resolving patch:
diff --git a/authentik/sources/ldap/sync/base.py b/authentik/sources/ldap/sync/base.py
--- a/authentik/sources/ldap/sync/base.py
+++ b/authentik/sources/ldap/sync/base.py
@@ -9,6 +9,7 @@
 
 from authentik.core.exceptions import PropertyMappingExpressionException
 from authentik.events.models import Event, EventAction
+from authentik.lib.config import CONFIG
 from authentik.lib.merge import MERGE_LIST_UNIQUE
 from authentik.sources.ldap.auth import LDAP_DISTINGUISHED_NAME
 from authentik.sources.ldap.models import LDAPPropertyMapping, LDAPSource
@@ -92,7 +93,7 @@ def search_paginator(
         types_only=False,
         get_operational_attributes=False,
         controls=None,
-        paged_size=5,
+        paged_size=int(CONFIG.y("ldap.page_size", 50)),
         paged_criticality=False,
     ):
         """Search in pages, returns each page"""


Test patch: