DiceDB / dice

DiceDB is hyper-optimized for building and scaling truly real-time applications on modern hardware. It is a drop-in replacement for Redis with support for SQL-based reactivity.
https://dicedb.io/
Other
3.32k stars 420 forks source link

Add support for `AUTH` command #141

Closed arpitbbhayani closed 1 month ago

arpitbbhayani commented 1 month ago

Add support for the AUTH command in DiceDB similar to Redis' AUTH Command. Please refer to how AUTH is implemented in Redis.

Write unit and integration tests for the command referring to the tests written in the Redis codebase 7.2.5. For integration tests, you can refer to the tests folder. Note: they have used TCL for the test suite, and we need to port that to our way of writing integration tests using the relevant helper methods. Please refer to our tests directory.

For the command, benchmark the code and measure the time taken and memory allocs using benchmem and try to keep them to the bare minimum.

gauravsarma1992 commented 1 month ago

Redis functionality

Prior to Redis 6, authentication for a connection was enabled by passing in requirepass in the redis.conf or while starting the redis server. If the above config is set, prior to any command, the authentication has to be by running the following command:

AUTH '<password>'

After Redis 6, the concept of ACLs was introduced which allowed users to define a combination of users with multiple passwords per user. ACLs also provided the ability to restrict usage based on Commands, Channels, Keys, etc.

Some ACL functionalities from the Redis documentation can be found here :

Implementation phases

The implementation for the AUTH should be broken down into the following phases:

  1. Allow users to define Username/Password(s) combination and perform authentication on the configured input
  2. Provide authorisation actions on different objects using ACLs.
gauravsarma1992 commented 1 month ago

@arpitbbhayani @JyotinderSingh Please assign this task to me.

JyotinderSingh commented 1 month ago

@arpitbbhayani @JyotinderSingh Please assign this task to me.

Assigned

romanchechyotkin commented 1 month ago

hello, can u assign me for this task, i can see the task is unassigned to no one

hanshal101 commented 1 month ago

I can work on this !!!

gauravsarma1992 commented 1 month ago

@JyotinderSingh Looks like I will not be able to spend much time on this issue this week. You can assign the issue to someone else if it's required a little earlier. For others, there is a draft PR that you may want to take up https://github.com/DiceDB/dice/pull/179

JyotinderSingh commented 1 month ago

@JyotinderSingh Looks like I will not be able to spend much time on this issue this week. You can assign the issue to someone else if it's required a little earlier.

For others, there is a draft PR that you may want to take up https://github.com/DiceDB/dice/pull/179

You already have significant progress on the issue, Gaurav. I would recommend you stick with it. No rush to complete this, please take your time.

However, if you do want to give up this issue, let me know.

gauravsarma1992 commented 1 month ago

Thanks @JyotinderSingh , I will continue on the same and will try to have a reviewable PR by the weekend

romanchechyotkin commented 1 month ago

but u can publish PR in order to other guys continue this task

gauravsarma1992 commented 1 month ago

@JyotinderSingh can you assign it to me?

JyotinderSingh commented 1 month ago

@JyotinderSingh can you assign it to me?

Assigned

arpitbbhayani commented 1 month ago

https://github.com/DiceDB/dice/pull/179

VipinRaiP commented 4 weeks ago

@gauravsarma1992 Are you going to support ACL in the same PR?