APIv3/src/main/java/net/frozenorb/apiv3/route/GETWhoAmI.java
2016-06-16 10:29:33 -04:00

21 lines
583 B
Java

package net.frozenorb.apiv3.route;
import com.google.common.collect.ImmutableMap;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
import net.frozenorb.apiv3.APIv3;
import net.frozenorb.apiv3.actor.Actor;
public final class GETWhoAmI implements Handler<RoutingContext> {
public void handle(RoutingContext ctx) {
Actor actor = ctx.get("actor");
APIv3.respondJson(ctx, ImmutableMap.of(
"name", actor.getName(),
"type", actor.getType(),
"authorized", actor.isAuthorized()
));
}
}