Skip to content

Commit 756225b

Browse files
author
Dmitriy Dubson
committed
Adds support for Redis username, sentinel username and password fields
GH issue #84
1 parent d100e81 commit 756225b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Type: `redis`
232232
Disable Property: `org.springframework.cloud.bindings.boot.redis.enable`
233233

234234
| Property | Value |
235-
| ------------------------------------ | ------------------------- |
235+
|--------------------------------------|---------------------------|
236236
| `spring.redis.client-name` | `{client-name}` |
237237
| `spring.redis.cluster.max-redirects` | `{cluster.max-redirects}` |
238238
| `spring.redis.cluster.nodes` | `{cluster.nodes}` |
@@ -242,8 +242,11 @@ Disable Property: `org.springframework.cloud.bindings.boot.redis.enable`
242242
| `spring.redis.port` | `{port}` |
243243
| `spring.redis.sentinel.master` | `{sentinel.master}` |
244244
| `spring.redis.sentinel.nodes` | `{sentinel.nodes}` |
245+
| `spring.redis.sentinel.password` | `{sentinel.password}` |
246+
| `spring.redis.sentinel.username` | `{sentinel.username}` |
245247
| `spring.redis.ssl` | `{ssl}` |
246248
| `spring.redis.url` | `{url}` |
249+
| `spring.redis.username` | `{username}` |
247250

248251
### SAP Hana
249252
Type: `hana`

src/main/java/org/springframework/cloud/bindings/boot/RedisBindingsPropertiesProcessor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ public void process(Environment environment, Bindings bindings, Map<String, Obje
5252
map.from("port").to("spring.redis.port");
5353
map.from("sentinel.master").to("spring.redis.sentinel.master");
5454
map.from("sentinel.nodes").to("spring.redis.sentinel.nodes");
55+
map.from("sentinel.password").to("spring.redis.sentinel.password");
56+
map.from("sentinel.username").to("spring.redis.sentinel.username");
5557
map.from("ssl").to("spring.redis.ssl");
5658
map.from("url").to("spring.redis.url");
59+
map.from("username").to("spring.redis.username");
5760
});
5861
}
5962

src/test/java/org/springframework/cloud/bindings/boot/RedisBindingsPropertiesProcessorTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ final class RedisBindingsPropertiesProcessorTest {
4545
.withEntry("port", "test-port")
4646
.withEntry("sentinel.master", "test-sentinel-master")
4747
.withEntry("sentinel.nodes", "test-sentinel-nodes")
48+
.withEntry("sentinel.password", "test-sentinel-password")
49+
.withEntry("sentinel.username", "test-sentinel-username")
4850
.withEntry("ssl", "test-ssl")
4951
.withEntry("url", "test-url")
52+
.withEntry("username", "test-username")
5053
)
5154
);
5255

@@ -68,8 +71,11 @@ void test() {
6871
.containsEntry("spring.redis.port", "test-port")
6972
.containsEntry("spring.redis.sentinel.master", "test-sentinel-master")
7073
.containsEntry("spring.redis.sentinel.nodes", "test-sentinel-nodes")
74+
.containsEntry("spring.redis.sentinel.password", "test-sentinel-password")
75+
.containsEntry("spring.redis.sentinel.username", "test-sentinel-username")
7176
.containsEntry("spring.redis.ssl", "test-ssl")
72-
.containsEntry("spring.redis.url", "test-url");
77+
.containsEntry("spring.redis.url", "test-url")
78+
.containsEntry("spring.redis.username", "test-username");
7379
}
7480

7581
@Test

0 commit comments

Comments
 (0)