Skip to content

Commit

Permalink
Merge pull request #59 from uju-in/NO-JIRA-redis-security-config
Browse files Browse the repository at this point in the history
[NO-JIRA] 레디스 보안 설정 추가
  • Loading branch information
Yiseull authored Feb 25, 2024
2 parents e695369 + 6afc787 commit b93b9fc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
Expand All @@ -18,9 +19,14 @@ public class RedisConfig {
@Value("${spring.data.redis.port}")
private int port;

@Value("${spring.data.redis.password}")
private String password;

@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(host, port);
final RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(host, port);
configuration.setPassword(password);
return new LettuceConnectionFactory(configuration);
}

@Bean
Expand Down

0 comments on commit b93b9fc

Please sign in to comment.