Class SecretKeyCache
- Namespace
- FoundationaLLM.AuthorizationEngine.Services
- Assembly
- FoundationaLLM.AuthorizationEngine.dll
In-memory cache for secret keys.
public class SecretKeyCache
- Inheritance
-
SecretKeyCache
- Inherited Members
- Extension Methods
Remarks
Initializes a new instance of the SecretKeyCache class.
Constructors
SecretKeyCache(SecretKeyStore, IConfiguration, ILogger)
In-memory cache for secret keys.
public SecretKeyCache(SecretKeyStore secretKeyStore, IConfiguration configuration, ILogger logger)
Parameters
secretKeyStore
SecretKeyStoreThe SecretKeyStore containing the data to initialize the cache.
configuration
IConfigurationThe application configuration values.
logger
ILoggerThe ILogger used for logging.
Remarks
Initializes a new instance of the SecretKeyCache class.
Methods
AddOrUpdatePersistedSecretKey(PersistedSecretKey)
Adds or updates a secret key in the cache.
public void AddOrUpdatePersistedSecretKey(PersistedSecretKey persistedSecretKey)
Parameters
persistedSecretKey
PersistedSecretKeyThe PersistedSecretKey to add or update in the cache.
GetKeys(string)
Gets the secret key associated with the specified context and key identifier.
public List<PersistedSecretKey> GetKeys(string contextId)
Parameters
contextId
stringThe context to which the secret keys belong.
Returns
RemovePersistedSecretKey(PersistedSecretKey)
Adds or updates a secret key in the cache.
public void RemovePersistedSecretKey(PersistedSecretKey persistedSecretKey)
Parameters
persistedSecretKey
PersistedSecretKeyThe PersistedSecretKey to add or update in the cache.
TryGetKey(string, string, out PersistedSecretKey)
Gets the secret key associated with the specified context and key identifier.
public bool TryGetKey(string contextId, string keyId, out PersistedSecretKey key)
Parameters
contextId
stringThe context to which the secret key belongs.
keyId
stringThe identifier of the secret key.
key
PersistedSecretKeyThe PersistedSecretKey that is looked for.