fix: Use a CappedMemoryCache instead of an array to cache stuff in user_ldap

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-04-07 16:26:02 +02:00
parent 18dddbc3b5
commit 0887810eb9
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -16,6 +16,7 @@ use OCA\User_LDAP\Exceptions\NoMoreResults;
use OCA\User_LDAP\Mapping\AbstractMapping;
use OCA\User_LDAP\User\Manager;
use OCA\User_LDAP\User\OfflineUser;
use OCP\Cache\CappedMemoryCache;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\HintException;
use OCP\IAppConfig;
@ -49,7 +50,7 @@ class Access extends LDAPUtility {
protected $groupMapper;
private string $lastCookie = '';
private array $intermediates = [];
private CappedMemoryCache $intermediates;
public function __construct(
ILDAPWrapper $ldap,
@ -63,6 +64,7 @@ class Access extends LDAPUtility {
) {
parent::__construct($ldap);
$this->userManager->setLdapAccess($this);
$this->intermediates = new CappedMemoryCache();
}
/**