spring-projects / spring-projects/spring-session

Spring Session Redis Integration with GCP IAM

Open
#3,116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Expected Behavior
Spring Session Redis / Spring Data with Redis to support Google Cloud (GCP) IAM authentication.

Spring Session / Spring Data with redis needs RedisConnectionFactory bean to be injected.
Google Redis Memstore has IAM authentication supported.
RedisConnectionFactory to support the password authentication with GCP IAM
Current Behavior
Not able to find any reference to support the password with GCP IAM

The code is pasted below,
GCP IAM sample as per GCP recommendation is https://cloud.google.com/memorystore/docs/cluster/client-library-connection#lettuce_2
Please refer the line below redisClusterConfiguration.setPassword(char[] seq);
Without this line it doesn't work as redis expected password but the question is how to set the pwd which is generated from GCP IAM.
public RedisConnectionFactory redisConnectionFactory() {
String discoveryEndPointURL = buildDiscoveryEndPointURL();
RedisClusterConfiguration redisClusterConfiguration = new RedisClusterConfiguration(Collections.singletonList(discoveryEndPointURL));
redisClusterConfiguration.setPassword(char[] seq);
LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisClusterConfiguration);
lettuceConnectionFactory.afterPropertiesSet();
return lettuceConnectionFactory;
}

Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the RedisConnectionFactory configuration shown in the issue, especially RedisClusterConfiguration.setPassword and LettuceConnectionFactory. Compare it with the linked GCP Memorystore Lettuce example to determine the integration boundary. Done means Spring Session Redis can use GCP IAM-generated authentication credentials with the supported Redis connection setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, java, redis, spring
Domain
authentication, backend, databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.