Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix #552
  • Loading branch information
kwwall committed Jul 3, 2020
commit e543e41e1518a3bc47e9b54956c3353c9f8c0100
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

package org.owasp.esapi.logging.appender;

import java.util.function.Supplier;
// Uncomment and use once ESAPI supports Java 8 as the minimal baseline.
// import java.util.function.Supplier;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
Expand All @@ -27,7 +28,8 @@
* Supplier which can provide a String representing the client-side connection
* information.
*/
public class ClientInfoSupplier implements Supplier<String> {
public class ClientInfoSupplier // implements Supplier<String>
{
/** Default Last Host string if the Authenticated user is null.*/
private static final String DEFAULT_LAST_HOST = "#UNKNOWN_HOST#";
/** Session Attribute containing the ESAPI Session id. */
Expand All @@ -47,7 +49,7 @@ public class ClientInfoSupplier implements Supplier<String> {
/** Whether to log the user info from this instance. */
private boolean logClientInfo = true;

@Override
// @Override -- Uncomment when we switch to Java 8 as minimal baseline.
public String get() {
String clientInfo = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

package org.owasp.esapi.logging.appender;

import java.util.function.Supplier;
// Uncomment and use once ESAPI supports Java 8 as the minimal baseline.
// import java.util.function.Supplier;

import org.owasp.esapi.Logger;
import org.owasp.esapi.Logger.EventType;
Expand All @@ -25,7 +26,8 @@
* an EventType for logging
*
*/
public class EventTypeLogSupplier implements Supplier<String> {
public class EventTypeLogSupplier // implements Supplier<String>
{
/** EventType reference to supply log representation of. */
private final EventType eventType;

Expand All @@ -38,7 +40,7 @@ public EventTypeLogSupplier(EventType evtyp) {
this.eventType = evtyp == null ? Logger.EVENT_UNSPECIFIED : evtyp;
}

@Override
// @Override -- Uncomment when we switch to Java 8 as minimal baseline.
public String get() {
return eventType.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

package org.owasp.esapi.logging.appender;

import java.util.function.Supplier;
// Uncomment and use once ESAPI supports Java 8 as the minimal baseline.
// import java.util.function.Supplier;

import javax.servlet.http.HttpServletRequest;

Expand All @@ -25,7 +26,8 @@
* Supplier which can provide a String representing the server-side connection
* information.
*/
public class ServerInfoSupplier implements Supplier<String> {
public class ServerInfoSupplier // implements Supplier<String>
{
/** Whether to log the server connection info. */
private boolean logServerIP = true;
/** Whether to log the application name. */
Expand All @@ -45,7 +47,7 @@ public ServerInfoSupplier(String logName) {
this.logName = logName;
}

@Override
// @Override -- Uncomment when we switch to Java 8 as minimal baseline.
public String get() {
// log server, port, app name, module name -- server:80/app/module
StringBuilder appInfo = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

package org.owasp.esapi.logging.appender;

import java.util.function.Supplier;
// Uncomment and use once ESAPI supports Java 8 as the minimal baseline.
// import java.util.function.Supplier;

import org.owasp.esapi.ESAPI;
import org.owasp.esapi.User;
Expand All @@ -24,14 +25,15 @@
* Supplier which can provide a String representing the client-side connection
* information.
*/
public class UserInfoSupplier implements Supplier<String> {
public class UserInfoSupplier // implements Supplier<String>
{
/** Default UserName string if the Authenticated user is null.*/
private static final String DEFAULT_USERNAME = "#ANONYMOUS#";

/** Whether to log the user info from this instance. */
private boolean logUserInfo = true;

@Override
// @Override -- Uncomment when we switch to Java 8 as minimal baseline.
public String get() {
// log user information - username:session@ipaddr
User user = ESAPI.authenticator().getCurrentUser();
Expand Down