Class RedisUserRepository<A extends Identity,B extends User<A>>

java.lang.Object
io.inverno.mod.security.authentication.user.RedisUserRepository<A,B>
Type Parameters:
A - the identity type
B - the user type
All Implemented Interfaces:
CredentialsResolver<B>, UserRepository<A,B>

public class RedisUserRepository<A extends Identity,B extends User<A>> extends Object implements UserRepository<A,B>

A UserRepository implementation that stores users in a Redis data store.

Users are stored as string entries serialized as JSON, the user key is of the form: keyPrefix ":USER:" username. Groups are stored as set entries, the group key is of the form: keyPrefix ":GROUP:" group.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • RedisUserRepository

      public RedisUserRepository(RedisClient<String,String> redisClient, com.fasterxml.jackson.databind.ObjectMapper mapper)

      Creates a Redis user repository with the specified Redis client and mapper.

      Parameters:
      redisClient - a Redis client
      mapper - an object mapper
    • RedisUserRepository

      public RedisUserRepository(RedisClient<String,String> redisClient, com.fasterxml.jackson.databind.ObjectMapper mapper, PasswordPolicy<B,?> passwordPolicy)

      Creates a Redis user repository with the specified Redis client, mapper and password policy.

      Parameters:
      redisClient - a Redis client
      mapper - an object mapper
      passwordPolicy - a password policy
    • RedisUserRepository

      public RedisUserRepository(RedisClient<String,String> redisClient, com.fasterxml.jackson.databind.ObjectMapper mapper, Password.Encoder<?,?> passwordEncoder)

      Creates a Redis user repository with the specified Redis client mapper and password encoder.

      Parameters:
      redisClient - a Redis client
      mapper - an object mapper
      passwordEncoder - a password encoder
    • RedisUserRepository

      public RedisUserRepository(RedisClient<String,String> redisClient, com.fasterxml.jackson.databind.ObjectMapper mapper, Password.Encoder<?,?> passwordEncoder, PasswordPolicy<B,?> passwordPolicy)

      Creates a Redis user repository with the specified Redis client, mapper, password encoder and password policy.

      Parameters:
      redisClient - a Redis client
      mapper - an object mapper
      passwordEncoder - a password encoder
      passwordPolicy - a password policy
  • Method Details