mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 00:46:03 +01:00
#3633: Redis: Support Authentication
This commit is contained in:
parent
9bde3bc634
commit
13b5605260
@ -270,6 +270,12 @@ public:
|
||||
|
||||
static Command discard();
|
||||
/// Creates and returns a DISCARD command.
|
||||
|
||||
static Command auth(const std::string& password);
|
||||
/// Creates and returns an AUTH command with the given password.
|
||||
|
||||
static Command auth(const std::string& username, const std::string& password);
|
||||
/// Creates and returns an AUTH command with the given password.
|
||||
};
|
||||
|
||||
|
||||
|
@ -735,4 +735,22 @@ Command Command::discard()
|
||||
}
|
||||
|
||||
|
||||
Command Command::auth(const std::string& password)
|
||||
{
|
||||
Command cmd("AUTH");
|
||||
cmd << password;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
Command Command::auth(const std::string& username, const std::string& password)
|
||||
{
|
||||
Command cmd("AUTH");
|
||||
cmd << username << password;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Redis
|
||||
|
Loading…
x
Reference in New Issue
Block a user