Class TrustCacheUtils
java.lang.Object
io.confluent.security.auth.store.data.TrustCacheUtils
Utility class for processing Trust Cache.
This class cannot be instantiated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<io.confluent.security.trustservice.store.data.IdentityPool> findIdentityPools(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, String providerId) Find all identity pools associated with the given providerIdstatic Collection<String> Find all identity providers associated with the given organization idstatic IdentityPoolValuegetIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, IdentityPoolKey identityPoolKey) Get identity pool value associated with the given key from Trust Cachestatic IdentityProviderValuegetIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, IdentityProviderKey key) Get identity provider associated with the given key from Trust Cachestatic JwtIssuerValuegetJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key) Get jwt issuer value associated with the given key from Trust Cachestatic IdentityPoolValueremoveIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, IdentityPoolKey key) Remove identity pool with the given key from Trust Cache, this will also affect providerToPoolsMappingstatic IdentityProviderValueremoveIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, Map<String, Set<String>> orgToProvidersMapping, IdentityProviderKey key) Remove identity provider with the given key from Trust Cache, this will also affect orgToProviderMappingsstatic JwtIssuerValueremoveJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key) Remove jwt issuer record with the given key from Trust Cachestatic IdentityPoolValueupdateIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, IdentityPoolKey key, IdentityPoolValue value) Update identity pools in Trust Cache, this will also affect the providerToPoolsMappingstatic IdentityProviderValueupdateIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, Map<String, Set<String>> orgToProvidersMapping, IdentityProviderKey key, IdentityProviderValue value) Update identity providers in Trust Cache, this will also affect the orgToProviderMappingsstatic JwtIssuerValueupdateJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key, JwtIssuerValue value) Update jwt issuers in Trust Cache
-
Method Details
-
getIdentityProvider
public static IdentityProviderValue getIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, IdentityProviderKey key) Get identity provider associated with the given key from Trust Cache- Parameters:
identityProviders- existing identity providers in Trust Cachekey- identity provider key- Returns:
- identity provider value associated with the given key if key exist, or null if no record in identityProviders
-
updateIdentityProvider
public static IdentityProviderValue updateIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, Map<String, Set<String>> orgToProvidersMapping, IdentityProviderKey key, IdentityProviderValue value) Update identity providers in Trust Cache, this will also affect the orgToProviderMappings- Parameters:
identityProviders- existing identity providers in Trust CacheorgToProvidersMapping- existing org provider mapping in Trust Cachekey- identity provider key that will be updated to the cachevalue- identity provider value that will be updated to the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
removeIdentityProvider
public static IdentityProviderValue removeIdentityProvider(Map<String, io.confluent.security.trustservice.store.data.IdentityProvider> identityProviders, Map<String, Set<String>> orgToProvidersMapping, IdentityProviderKey key) Remove identity provider with the given key from Trust Cache, this will also affect orgToProviderMappings- Parameters:
identityProviders- existing identity providers in Trust CacheorgToProvidersMapping- existing org provider mapping in Trust Cachekey- identity provider key that will be removed from the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
getIdentityPool
public static IdentityPoolValue getIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, IdentityPoolKey identityPoolKey) Get identity pool value associated with the given key from Trust Cache- Parameters:
identityPools- existing identity pools in Trust CacheidentityPoolKey- identity pool key- Returns:
- identity pool value associated with the given key if key exist, or null if no record in identityPools
-
updateIdentityPool
public static IdentityPoolValue updateIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, IdentityPoolKey key, IdentityPoolValue value) Update identity pools in Trust Cache, this will also affect the providerToPoolsMapping- Parameters:
identityPools- existing identity pools in Trust CacheproviderToPoolsMapping- existing provider pool mapping in Trust Cachekey- identity pool key that will be updated to the cachevalue- identity pool value that will be updated to the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
removeIdentityPool
public static IdentityPoolValue removeIdentityPool(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, IdentityPoolKey key) Remove identity pool with the given key from Trust Cache, this will also affect providerToPoolsMapping- Parameters:
identityPools- existing identity pools in Trust CacheproviderToPoolsMapping- existing provider pool mapping in Trust Cachekey- identity pool key that will be removed from the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
getJwtIssuer
public static JwtIssuerValue getJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key) Get jwt issuer value associated with the given key from Trust Cache- Parameters:
jsonWebKeys- existing jsonWebKeys in Trust Cachekey- jwt issuer key- Returns:
- jwt issuer value associated with the given key if key exist, or null if no record in existing jsonWebKeys
-
updateJwtIssuer
public static JwtIssuerValue updateJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key, JwtIssuerValue value) Update jwt issuers in Trust Cache- Parameters:
jsonWebKeys- existing jsonWebKeys in Trust Cachekey- jwt issuer key that will be updated to the cachevalue- jwt issuer value that will be updated to the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
removeJwtIssuer
public static JwtIssuerValue removeJwtIssuer(Map<String, org.jose4j.jwk.JsonWebKeySet> jsonWebKeys, JwtIssuerKey key) Remove jwt issuer record with the given key from Trust Cache- Parameters:
jsonWebKeys- existing jsonWebKeys in Trust Cachekey- jwt issuer key that will be removed from the cache- Returns:
- the previous value associated with key, or null if there was no mapping for key
-
findIdentityPools
public static Collection<io.confluent.security.trustservice.store.data.IdentityPool> findIdentityPools(Map<String, io.confluent.security.trustservice.store.data.IdentityPool> identityPools, Map<String, Set<String>> providerToPoolsMapping, String providerId) Find all identity pools associated with the given providerId- Parameters:
identityPools- identity pools in Trust CacheproviderToPoolsMapping- provider pools mapping in Trust CacheproviderId- provider Id- Returns:
- collection of Identity Pool associated with the given provider id
-
findIdentityProviderIds
public static Collection<String> findIdentityProviderIds(Map<String, Set<String>> orgToProvidersMapping, String organizationId) Find all identity providers associated with the given organization id- Parameters:
orgToProvidersMapping- organization providers mapping in Trust CacheorganizationId- organization Id- Returns:
- collection of Identity Provider Ids associated with the given organization id
-