String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
App app = dao.read(new App(appid).getId());
if (app != null) {
app.resetSecret();
app.update();
return Response.ok(app.credentialsMap()).build();
}
return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
}
};
}