private static AuthProvider authenticateBasic(JsonObject apimanConfig) {
        return (authInfo, resultHandler) -> {
            String storedUsername = apimanConfig.getString("username");
            String storedPassword = apimanConfig.getString("password");

            if (storedUsername == null || storedPassword == null) {
                resultHandler.handle(Future.failedFuture("Credentials not set in configuration."));
                return;
            }

            String username = authInfo.getString("username");
            String password = StringUtils.chomp(authInfo.getString("password"));

            if (storedUsername.equals(username) && storedPassword.equals(password)) {
                resultHandler.handle(Future.succeededFuture());
            } else {
                resultHandler.handle(Future.failedFuture("No such user, or password incorrect."));
            }
        };
    }
@author Marc Savy {@literal <marc@rhymewithgravy.com>}
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/api/auth/BasicAuth.java