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
secretKeyStoreSecretKeyStoreThe SecretKeyStore containing the data to initialize the cache.
configurationIConfigurationThe application configuration values.
loggerILoggerThe 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
persistedSecretKeyPersistedSecretKeyThe 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
contextIdstringThe 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
persistedSecretKeyPersistedSecretKeyThe 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
contextIdstringThe context to which the secret key belongs.
keyIdstringThe identifier of the secret key.
keyPersistedSecretKeyThe PersistedSecretKey that is looked for.