package io.vertx.ext.auth.htdigest.impl;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.auth.AuthProvider;
import io.vertx.ext.auth.User;
public class HtdigestUser implements User {
private String username;
private String realm;
public HtdigestUser(String username, String realm) {
this.username = username;
this.realm = realm;
}
@Override
public User isAuthorized(String authority, Handler<AsyncResult<Boolean>> resultHandler) {
resultHandler.handle(Future.succeededFuture(false));
return this;
}
@Override
public User clearCache() {
return this;
}
@Override
public JsonObject principal() {
return new JsonObject()
.put("username", username)
.put("realm", realm);
}
@Override
public void setAuthProvider(AuthProvider authProvider) {
}
}