Class DistributedTenantsUsersCache
- Namespace
- GroupeIsa.Neos.ClusterCommunication.Multitenant
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Represents the cache of authorized tenants for users.
public class DistributedTenantsUsersCache : ITenantUsersCache
- Inheritance
-
DistributedTenantsUsersCache
- Implements
- Inherited Members
Constructors
DistributedTenantsUsersCache(IStateStore)
Initializes a new instance of the DistributedTenantsUsersCache class.
public DistributedTenantsUsersCache(IStateStore stateStore)
Parameters
stateStore
IStateStoreThe state store.
Methods
AddOrUpdateAsync(string, string, string, IEnumerable<AuthorizedTenant>)
Adds or updates the cache for the specified user.
public Task AddOrUpdateAsync(string clusterName, string clusterVersion, string userId, IEnumerable<AuthorizedTenant> tenants)
Parameters
clusterName
stringThe cluster name.
clusterVersion
stringThe cluster version.
userId
stringThe user identifier.
tenants
IEnumerable<AuthorizedTenant>The tenant info.
Returns
RemoveAsync(params string[])
Removes the user from the cache.
public Task RemoveAsync(params string[] userIds)
Parameters
userIds
string[]The user identifiers to remove.
Returns
RemoveTenantAsync(string)
Removes the tenant from the cache.
public Task RemoveTenantAsync(string tenantId)
Parameters
tenantId
stringThe tenant identifier.
Returns
TryGetAsync(string, string, string)
Tries to get the authorized tenants for the specified user.
public Task<(IEnumerable<AuthorizedTenant>? Tenants, string Etag)> TryGetAsync(string clusterName, string clusterVersion, string userId)
Parameters
clusterName
stringThe cluster name.
clusterVersion
stringThe cluster version.
userId
stringThe user identifier.
Returns
- Task<(IEnumerable<AuthorizedTenant> Tenants, string Etag)>
The authorized tenant identifiers or
null
when user is not cached.