-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from hsshss/username_auth
Username and password authentication
- Loading branch information
Showing
12 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user default on >somepassword allkeys allchannels +@all | ||
user test on >testpassword allkeys allchannels +@all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
port 6380 | ||
requirepass somepassword | ||
requirepass somepassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
port 6380 | ||
aclfile /usr/local/etc/redis/users.acl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
acceptance-tests/tests/select-db-with-username-password.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh -e | ||
|
||
export DB=2 | ||
export REDIS_PORT=6380 | ||
export REDIS_USER=test | ||
export REDISDUMPGO_AUTH=testpassword | ||
export REDISCMD="redis-cli -h redis_with_username_and_password -p $REDIS_PORT --user $REDIS_USER --pass $REDISDUMPGO_AUTH -n 2" | ||
echo $REDISCMD | ||
echo "-> Filling Redis with Mock Data..." | ||
$REDISCMD FLUSHDB | ||
/generator -output resp -type strings -n 100 | $REDISCMD --pipe | ||
DBSIZE=`$REDISCMD dbsize` | ||
|
||
echo "-> Dumping DB..." | ||
time /redis-dump-go -host redis_with_username_and_password -n 250 -port $REDIS_PORT -db $DB -user $REDIS_USER -output resp >backup | ||
|
||
echo "-> Flushing DB and restoring dump..." | ||
$REDISCMD FLUSHDB | ||
$REDISCMD --pipe <backup | ||
NEWDBSIZE=`$REDISCMD dbsize` | ||
echo "Redis has $DBSIZE entries" | ||
echo "-> Comparing DB sizes..." | ||
if [ $DBSIZE -ne $NEWDBSIZE ]; then | ||
echo "ERROR - restored DB has $NEWDBSIZE elements, expected $DBSIZE" | ||
exit 1 | ||
else | ||
echo "OK - $NEWDBSIZE elements" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters