in folsom/src/main/java/com/spotify/folsom/client/binary/PlaintextAuthenticateRequest.java [73:92]
protected void handle(final BinaryResponse replies, final HostAndPort server) throws IOException {
ResponsePacket reply = handleSingleReply(replies);
if (OpCode.getKind(reply.opcode) != OpCode.SASL_AUTH) {
throw new IOException("Unmatched response");
}
MemcacheStatus status = reply.status;
if (status == UNKNOWN_COMMAND) {
// Unknown command implies no authorization needed.
succeed(OK);
} else if (status == OK || status == UNAUTHORIZED) {
succeed(status);
} else {
final IOException exception =
new IOException(
String.format("Invalid status %s, expected OK or UNAUTHORIZED.", status.toString()));
fail(exception, server);
}
}