mirror of
https://github.com/swift-server/RediStack.git
synced 2026-06-02 07:37:33 +00:00
Merge pull request #27 from Mordil/remove-authorize
Remove `authorize` convenience command method
This commit is contained in:
@@ -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`.
|
||||
///
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user