getConfiguration(@Context HttpServletRequest
// from the scopes it asks for, so a client can tell which apps can work before
// it calls them. only whether each app can work is sent, never the scopes, and
// only to a user signed in to the platform
- if (user != null && user.isLoggedIn() && !user.isAnonymous()) {
+ if (user != null && user.isLoggedIn()) {
myConfiguration.put("connectorAccess", ConnectorScopeAccess.getConnectorAccess());
}
// themes
@@ -375,8 +373,8 @@ public Response fetchCsrf(@Context HttpServletRequest request, @Context HttpServ
* {@code @Consumes}/{@code @Produces} content types.
*
* Resources whose simple class name starts with {@code "Admin"} are only
- * included when the calling user is logged in and an admin. Anonymous and
- * non-admin users get the rest of the catalog without those entries.
+ * included when the calling user is logged in and an admin. Other callers get
+ * the rest of the catalog without those entries.
*
* @param request the incoming HTTP request (used only to prefix the
* application context path on each path so callers see real
@@ -388,8 +386,8 @@ public Response fetchCsrf(@Context HttpServletRequest request, @Context HttpServ
@Path("/endpoints")
@Produces("application/json")
public Response listEndpoints(@Context HttpServletRequest request, @Context Application application) {
- // admin gating: anonymous users and non-admin logged-in users do not
- // see endpoints from resources whose simple class name starts with
+ // admin gating: callers who are not a logged-in admin do not see
+ // endpoints from resources whose simple class name starts with
// "Admin" (e.g. AdminUserAuthorizationResource).
boolean includeAdminResources = false;
try {
diff --git a/src/prerna/semoss/web/services/local/NameServer.java b/src/prerna/semoss/web/services/local/NameServer.java
index 1ebcfee0..ebe8a281 100644
--- a/src/prerna/semoss/web/services/local/NameServer.java
+++ b/src/prerna/semoss/web/services/local/NameServer.java
@@ -1289,7 +1289,7 @@ public Response agentRunStreaming(MultivaluedMap form, @Context
}
HttpSession session = request.getSession(false);
User user = session == null ? null : (User) session.getAttribute(Constants.SESSION_USER);
- if (user == null || user.isAnonymous()) {
+ if (user == null) {
Map errorRet = new HashMap<>();
errorRet.put("errorMessage", "Agent run streaming requires an authenticated user");
return WebUtility.getResponseNoCache(errorRet, 401);
diff --git a/src/prerna/semoss/web/services/local/ResourceUtility.java b/src/prerna/semoss/web/services/local/ResourceUtility.java
index 5b962b86..234dc9a7 100644
--- a/src/prerna/semoss/web/services/local/ResourceUtility.java
+++ b/src/prerna/semoss/web/services/local/ResourceUtility.java
@@ -170,8 +170,8 @@ public interface AdminCall {
/**
* Runs a call for the signed in user and turns its outcome into the response:
- * 200 with its result, 401 for a missing or anonymous session, 403 for a user who
- * may not do it, 400 for a bad request and 500 for anything else. Errors carry
+ * 200 with its result, 401 for a missing session, 403 for a user who may not do
+ * it, 400 for a bad request and 500 for anything else. Errors carry
* {@link Constants#ERROR_MESSAGE}, and unexpected ones
* {@link Constants#TECH_ERROR_MESSAGE} too. Every outcome is logged with the
* endpoint, such as {@code POST /Monolith/api/auth/group/addGroupMember}, the
@@ -185,25 +185,6 @@ public interface AdminCall {
* @return the response
*/
public static Response respond(HttpServletRequest request, String action, UserCall call) {
- return respond(request, action, false, call);
- }
-
- /**
- * {@link #respond} for a call that only reads, which an anonymous session, such
- * as a visitor to a public app, may make too. A call that changes anything uses
- * {@link #respond}, which answers anonymous sessions with 401.
- *
- * @param request the request, whose session holds the user
- * @param action what the call does, for the logs, such as
- * {@code "read their permission on project 123"}
- * @param call the call
- * @return the response
- */
- public static Response respondAllowingAnonymous(HttpServletRequest request, String action, UserCall call) {
- return respond(request, action, true, call);
- }
-
- private static Response respond(HttpServletRequest request, String action, boolean allowAnonymous, UserCall call) {
String endpoint = request.getMethod() + " " + request.getRequestURI();
User user;
try {
@@ -212,10 +193,6 @@ private static Response respond(HttpServletRequest request, String action, boole
classLogger.warn("[{}] A request without a signed in user tried to {}", endpoint, action);
return errorResponse("User session is invalid", 401);
}
- if (user.isAnonymous() && !allowAnonymous) {
- classLogger.warn("[{}] An anonymous user tried to {}", endpoint, action);
- return errorResponse("User session is invalid", 401);
- }
String userName = User.getSingleLogginName(user);
try {
diff --git a/src/prerna/semoss/web/services/local/UserResource.java b/src/prerna/semoss/web/services/local/UserResource.java
index 68cbea5b..3ddae2b9 100644
--- a/src/prerna/semoss/web/services/local/UserResource.java
+++ b/src/prerna/semoss/web/services/local/UserResource.java
@@ -72,7 +72,6 @@
import prerna.auth.SyncUserAssetsThread;
import prerna.auth.User;
import prerna.auth.external.ExternalAuthorizationHelper;
-import prerna.auth.utils.AbstractSecurityUtils;
import prerna.auth.utils.SecurityAPIUserUtils;
import prerna.auth.utils.SecurityAdminUtils;
import prerna.auth.utils.SecurityExternalConnectorsUtils;
@@ -328,7 +327,6 @@ public static void addAccessToken(AccessToken token, HttpServletRequest request,
SecurityUserUtils.loadUserMetadata(token);
semossUser.setAccessToken(token);
- semossUser.setAnonymous(false);
session.setAttribute(Constants.SESSION_USER, semossUser);
WebUtility.loggingContextLoginEvent(session);
@@ -1379,7 +1377,7 @@ public Response loginNative(@Context HttpServletRequest request, @Context HttpSe
User user = null;
if (session != null) {
user = (User) session.getAttribute(Constants.SESSION_USER);
- if (!AbstractSecurityUtils.anonymousUsersEnabled() && user != null && user.getLogins().isEmpty()) {
+ if (user != null && user.getLogins().isEmpty()) {
session.invalidate();
}
}
@@ -1395,7 +1393,7 @@ public Response loginNative(@Context HttpServletRequest request, @Context HttpSe
HttpSession session = request.getSession(false);
if (session != null) {
User user = (User) session.getAttribute(Constants.SESSION_USER);
- if (!AbstractSecurityUtils.anonymousUsersEnabled() && user != null && user.getLogins().isEmpty()) {
+ if (user != null && user.getLogins().isEmpty()) {
session.invalidate();
}
}
@@ -1460,7 +1458,7 @@ public Response loginLDAP(@Context HttpServletRequest request, @Context HttpServ
HttpSession session = request.getSession(false);
if (session != null) {
User user = (User) session.getAttribute(Constants.SESSION_USER);
- if (!AbstractSecurityUtils.anonymousUsersEnabled() && user != null && user.getLogins().isEmpty()) {
+ if (user != null && user.getLogins().isEmpty()) {
session.invalidate();
}
}
@@ -1475,7 +1473,7 @@ public Response loginLDAP(@Context HttpServletRequest request, @Context HttpServ
HttpSession session = request.getSession(false);
if (session != null) {
User user = (User) session.getAttribute(Constants.SESSION_USER);
- if (!AbstractSecurityUtils.anonymousUsersEnabled() && user != null && user.getLogins().isEmpty()) {
+ if (user != null && user.getLogins().isEmpty()) {
session.invalidate();
}
}
@@ -1535,7 +1533,7 @@ public Response changeADPassword(@Context HttpServletRequest request, @Context H
HttpSession session = request.getSession(false);
if (session != null) {
User user = (User) session.getAttribute(Constants.SESSION_USER);
- if (!AbstractSecurityUtils.anonymousUsersEnabled() && user != null && user.getLogins().isEmpty()) {
+ if (user != null && user.getLogins().isEmpty()) {
session.invalidate();
}
}
diff --git a/src/prerna/semoss/web/services/local/auth/EngineAuthorizationResource.java b/src/prerna/semoss/web/services/local/auth/EngineAuthorizationResource.java
index b7d23208..c2dfd899 100644
--- a/src/prerna/semoss/web/services/local/auth/EngineAuthorizationResource.java
+++ b/src/prerna/semoss/web/services/local/auth/EngineAuthorizationResource.java
@@ -92,7 +92,7 @@ public Response getEngines(@Context HttpServletRequest request, @QueryParam("eng
List engines = WebUtility.inputSanitizer(engineFilter);
List types = WebUtility.inputSanitizer(engineTypes);
List keys = WebUtility.inputSanitizer(metaKeys);
- return ResourceUtility.respondAllowingAnonymous(request, "list the engines they can access", user -> {
+ return ResourceUtility.respond(request, "list the engines they can access", user -> {
MyEnginesReactor reactor = new MyEnginesReactor();
reactor.In();
Insight temp = new Insight();
@@ -164,7 +164,7 @@ public Response getEngines(@Context HttpServletRequest request, @QueryParam("eng
@Produces("application/json")
@Path("getEngines")
public Response getEnginesPOST(@Context HttpServletRequest request) {
- return ResourceUtility.respondAllowingAnonymous(request, "list the engines they can access", user -> {
+ return ResourceUtility.respond(request, "list the engines they can access", user -> {
MyEnginesReactor reactor = new MyEnginesReactor();
reactor.In();
Insight temp = new Insight();
@@ -257,7 +257,7 @@ public Response getUserEnginePermission(@Context HttpServletRequest request,
@QueryParam("engineId") String engineId) {
String engine = WebUtility.inputSanitizer(engineId);
String action = "read their permission on engine " + engine;
- return ResourceUtility.respondAllowingAnonymous(request, action, user -> {
+ return ResourceUtility.respond(request, action, user -> {
String permission = SecurityEngineUtils.getActualUserEnginePermission(user, engine);
if (permission == null) {
// are you discoverable?
@@ -294,7 +294,7 @@ public Response getEngineUsers(@Context HttpServletRequest request, @QueryParam(
String term = WebUtility.inputSQLSanitizer(searchTerm);
String level = WebUtility.inputSanitizer(permission);
String searchParam = term != null ? term : member;
- return ResourceUtility.respondAllowingAnonymous(request, "list the users of engine " + engine, user -> {
+ return ResourceUtility.respond(request, "list the users of engine " + engine, user -> {
List