Class TrustCacheUtils

java.lang.Object
io.confluent.security.auth.store.data.TrustCacheUtils

public class TrustCacheUtils extends Object
Utility class for processing Trust Cache. This class cannot be instantiated.
  • 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 Cache
      key - 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 Cache
      orgToProvidersMapping - existing org provider mapping in Trust Cache
      key - identity provider key that will be updated to the cache
      value - 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 Cache
      orgToProvidersMapping - existing org provider mapping in Trust Cache
      key - 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 Cache
      identityPoolKey - 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 Cache
      providerToPoolsMapping - existing provider pool mapping in Trust Cache
      key - identity pool key that will be updated to the cache
      value - 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 Cache
      providerToPoolsMapping - existing provider pool mapping in Trust Cache
      key - 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 Cache
      key - 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 Cache
      key - jwt issuer key that will be updated to the cache
      value - 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 Cache
      key - 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 Cache
      providerToPoolsMapping - provider pools mapping in Trust Cache
      providerId - 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 Cache
      organizationId - organization Id
      Returns:
      collection of Identity Provider Ids associated with the given organization id