LDAPCache

class gafaelfawr.cache.LDAPCache(content)

Bases: PerUserCache, Generic[S]

A cache of LDAP data.

Parameters:

content (type[TypeVar(S)]) – The type of object being stored.

Methods Summary

get(username)

Retrieve data from the cache.

initialize()

Initialize the cache.

invalidate(username)

Invalidate any cached data for a user.

store(username, data)

Store data in the cache.

Methods Documentation

get(username)

Retrieve data from the cache.

Parameters:

username (str) – Username for which to retrieve data.

Returns:

The cached data or None if there is no data in the cache.

Return type:

Any or None

initialize()

Initialize the cache.

Return type:

None

invalidate(username)

Invalidate any cached data for a user.

Parameters:

username (str) – Username for which to invalidate the cache.

Return type:

None

store(username, data)

Store data in the cache.

Should only be called with the lock held.

Parameters:
  • username (str) – Username for which to store data.

  • data (TypeVar(S)) – Data to store.

Return type:

None