question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `Credentials Provider`-like mechanism with Redis clients

See original GitHub issue

Description

It would be nice to be able to use Credentials Provider-like mechanism (or something similar), available with DB data sources, with Redis clients/connections as well. This way, one could retrieve Redis password from some other source and then use it, without setting it in quarkus.redis.hosts configuration property.

Alternative?

Is there any way to configure Redis password programmatically and make a RedisClient used like this

    @Inject
    RedisClient redisClient;

pick it up?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
machi1990commented, Feb 17, 2022

Is there any documentation or example about this? Thanks

We do not have an example (we should have one).

To get you going, the host provider may look like

@ApplicationScoped
@Named("hosts-provider")
public class ExampleRedisHostProvider implements RedisHostsProvider {
    @Override
    public Set<URI> getHosts() {
        // do stuff to get the host
        String host = "redis://localhost:6379/3"
        return Collections.singleton(URI.create(host));
    }
}

and in your application.properties

quarkus.redis.hosts-provider-name=hosts-provider
1reaction
gsmetcommented, Apr 6, 2021

I think the easiest way would be to implement it in Quarkus with the credential provider contract we already have. I don’t think that would be that hard.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis security | Redis
Internally, Redis uses all the well-known practices for writing secure code to prevent buffer overflows, format bugs, and other memory corruption issues.
Read more >
Best practices: Redis clients and Amazon ElastiCache for Redis
In this post, we cover best practices for interacting with Amazon ElastiCache for Redis resources with commonly used open-source Redis ...
Read more >
Persistence (using Redis) type - IBM
Use the Persistence (using Redis) type to create configurations that contain credentials for connecting to a REmote DIctionary Server (Redis) database that ...
Read more >
Connecting to Heroku Data for Redis
To connect from an external system or client, retrieve the Redis connection string using either of the following methods:.
Read more >
Redis with Java | Redis Documentation Center
The following sections demonstrate the use of two Java client libraries for Redis: Lettuce and Jedis. Additional Java clients for Redis can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found