Skip to content

Commit 9956210

Browse files
committed
use constants, flip back to info for debugging setup
1 parent d460bdc commit 9956210

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/edu/harvard/iq/dataverse/api/ApiBlockingFilter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public class ApiBlockingFilter implements ContainerRequestFilter {
4343

4444
private static final Map<String, String> POLICY_ERROR_MESSAGES = new HashMap<>();
4545
static {
46-
POLICY_ERROR_MESSAGES.put("drop", "Endpoint blocked. Access denied.");
47-
POLICY_ERROR_MESSAGES.put("localhost-only", "Endpoint restricted to localhost access only.");
48-
POLICY_ERROR_MESSAGES.put("unblock-key", "Endpoint requires an unblock key for access.");
46+
POLICY_ERROR_MESSAGES.put(DROP, "Endpoint blocked. Access denied.");
47+
POLICY_ERROR_MESSAGES.put(LOCALHOST_ONLY, "Endpoint restricted to localhost access only.");
48+
POLICY_ERROR_MESSAGES.put(UNBLOCK_KEY, "Endpoint requires an unblock key for access.");
4949
}
5050

5151
@Inject
@@ -112,10 +112,10 @@ public void filter(ContainerRequestContext requestContext) throws IOException {
112112
}
113113

114114
String fullPath = (classPath + "/" + methodPath).replaceAll("//", "/");
115-
logger.fine("Full path is " + fullPath);
115+
logger.info("Full path is " + fullPath);
116116

117117
if (isBlocked(policy, fullPath, requestContext)) {
118-
logger.fine("Blocked " + fullPath);
118+
logger.info("Blocked " + fullPath);
119119
requestContext.abortWith(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(errorJson)
120120
.type(jakarta.ws.rs.core.MediaType.APPLICATION_JSON).build());
121121
return;

0 commit comments

Comments
 (0)