Skip to content

Commit

Permalink
Adds support for Redis username, sentinel username and password fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Dubson committed Oct 6, 2022
1 parent d100e81 commit da61480
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Type: `redis`
Disable Property: `org.springframework.cloud.bindings.boot.redis.enable`

| Property | Value |
| ------------------------------------ | ------------------------- |
|--------------------------------------|---------------------------|
| `spring.redis.client-name` | `{client-name}` |
| `spring.redis.cluster.max-redirects` | `{cluster.max-redirects}` |
| `spring.redis.cluster.nodes` | `{cluster.nodes}` |
Expand All @@ -242,8 +242,11 @@ Disable Property: `org.springframework.cloud.bindings.boot.redis.enable`
| `spring.redis.port` | `{port}` |
| `spring.redis.sentinel.master` | `{sentinel.master}` |
| `spring.redis.sentinel.nodes` | `{sentinel.nodes}` |
| `spring.redis.sentinel.password` | `{sentinel.password}` |
| `spring.redis.sentinel.username` | `{sentinel.username}` |
| `spring.redis.ssl` | `{ssl}` |
| `spring.redis.url` | `{url}` |
| `spring.redis.username` | `{username}` |

### SAP Hana
Type: `hana`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ public void process(Environment environment, Bindings bindings, Map<String, Obje
map.from("database").to("spring.redis.database");
map.from("host").to("spring.redis.host");
map.from("password").to("spring.redis.password");
map.from("username").to("spring.redis.username");
map.from("port").to("spring.redis.port");
map.from("sentinel.master").to("spring.redis.sentinel.master");
map.from("sentinel.nodes").to("spring.redis.sentinel.nodes");
map.from("sentinel.password").to("spring.redis.sentinel.password");
map.from("sentinel.username").to("spring.redis.sentinel.username");
map.from("ssl").to("spring.redis.ssl");
map.from("url").to("spring.redis.url");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ final class RedisBindingsPropertiesProcessorTest {
.withEntry("database", "test-database")
.withEntry("host", "test-host")
.withEntry("password", "test-password")
.withEntry("username", "test-username")
.withEntry("port", "test-port")
.withEntry("sentinel.master", "test-sentinel-master")
.withEntry("sentinel.nodes", "test-sentinel-nodes")
.withEntry("sentinel.password", "test-sentinel-password")
.withEntry("sentinel.username", "test-sentinel-username")
.withEntry("ssl", "test-ssl")
.withEntry("url", "test-url")
)
Expand All @@ -65,9 +68,12 @@ void test() {
.containsEntry("spring.redis.database", "test-database")
.containsEntry("spring.redis.host", "test-host")
.containsEntry("spring.redis.password", "test-password")
.containsEntry("spring.redis.username", "test-username")
.containsEntry("spring.redis.port", "test-port")
.containsEntry("spring.redis.sentinel.master", "test-sentinel-master")
.containsEntry("spring.redis.sentinel.nodes", "test-sentinel-nodes")
.containsEntry("spring.redis.sentinel.password", "test-sentinel-password")
.containsEntry("spring.redis.sentinel.username", "test-sentinel-username")
.containsEntry("spring.redis.ssl", "test-ssl")
.containsEntry("spring.redis.url", "test-url");
}
Expand Down

0 comments on commit da61480

Please sign in to comment.