Merge pull request #27 from Mordil/remove-authorize

Remove `authorize` convenience command method
This commit is contained in:
Nathan Harris
2019-03-27 23:08:16 -07:00
committed by GitHub
2 changed files with 2 additions and 12 deletions
@@ -25,17 +25,6 @@ extension RedisClient {
.mapFromRESP()
}
/// Request for authentication in a password-protected Redis server.
///
/// [https://redis.io/commands/auth](https://redis.io/commands/auth)
/// - Parameter password: The password being used to access the Redis server.
/// - Returns: An `EventLoopFuture` that resolves when the connection has been authorized, or fails with a `RedisError`.
@inlinable
public func authorize(with password: String) -> EventLoopFuture<Void> {
return send(command: "AUTH", with: [password])
.map { _ in return () }
}
/// Select the Redis logical database having the specified zero-based numeric index.
/// - Note: New connections always use the database `0`.
///
+2 -1
View File
@@ -161,7 +161,8 @@ extension RedisConnection {
guard let pw = password else {
return eventLoopGroup.next().makeSucceededFuture(client)
}
return client.authorize(with: pw)
return client.send(command: "AUTH", with: [pw])
.map { _ in return client }
}
}