pull/4432/head
Phillip Webb 9 years ago
parent aa8d0dd072
commit 332c6911cf

@ -36,6 +36,14 @@ public class DocsMvcEndpoint extends WebMvcConfigurerAdapter implements MvcEndpo
private String path = "/docs"; private String path = "/docs";
/**
* Enable the endpoint.
*/
private boolean enabled = true;
/**
* Mark if the endpoint exposes sensitive information.
*/
private boolean sensitive; private boolean sensitive;
private final ManagementServletContext managementServletContext; private final ManagementServletContext managementServletContext;
@ -78,8 +86,12 @@ public class DocsMvcEndpoint extends WebMvcConfigurerAdapter implements MvcEndpo
return this.path; return this.path;
} }
public void setSensitive(boolean sensitive) { public boolean isEnabled() {
this.sensitive = sensitive; return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
} }
@Override @Override
@ -87,6 +99,10 @@ public class DocsMvcEndpoint extends WebMvcConfigurerAdapter implements MvcEndpo
return this.sensitive; return this.sensitive;
} }
public void setSensitive(boolean sensitive) {
this.sensitive = sensitive;
}
@Override @Override
public Class<? extends Endpoint<?>> getEndpointType() { public Class<? extends Endpoint<?>> getEndpointType() {
return null; return null;

@ -37,8 +37,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
* @since 1.3.0 * @since 1.3.0
*/ */
@ConfigurationProperties("endpoints.actuator") @ConfigurationProperties("endpoints.actuator")
public class HalJsonMvcEndpoint extends WebMvcConfigurerAdapter public class HalJsonMvcEndpoint extends WebMvcConfigurerAdapter implements MvcEndpoint {
implements MvcEndpoint {
/** /**
* Endpoint URL path. * Endpoint URL path.
@ -48,14 +47,14 @@ public class HalJsonMvcEndpoint extends WebMvcConfigurerAdapter
private String path; private String path;
/** /**
* Enable security on the endpoint. * Enable the endpoint.
*/ */
private boolean sensitive = false; private boolean enabled = true;
/** /**
* Enable the endpoint. * Mark if the endpoint exposes sensitive information.
*/ */
private boolean enabled = true; private boolean sensitive = false;
private final ManagementServletContext managementServletContext; private final ManagementServletContext managementServletContext;
@ -86,6 +85,14 @@ public class HalJsonMvcEndpoint extends WebMvcConfigurerAdapter
return this.path; return this.path;
} }
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override @Override
public boolean isSensitive() { public boolean isSensitive() {
return this.sensitive; return this.sensitive;
@ -95,14 +102,6 @@ public class HalJsonMvcEndpoint extends WebMvcConfigurerAdapter
this.sensitive = sensitive; this.sensitive = sensitive;
} }
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override @Override
public Class<? extends Endpoint<?>> getEndpointType() { public Class<? extends Endpoint<?>> getEndpointType() {
return null; return null;

@ -58,14 +58,14 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
private String path = "/jolokia";; private String path = "/jolokia";;
/** /**
* Enable security on the endpoint. * Enable the endpoint.
*/ */
private boolean sensitive = true; private boolean enabled = true;
/** /**
* Enable the endpoint. * Mark if the endpoint exposes sensitive information.
*/ */
private boolean enabled = true; private boolean sensitive = true;
private final ServletWrappingController controller = new ServletWrappingController(); private final ServletWrappingController controller = new ServletWrappingController();
@ -103,21 +103,21 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
} }
@Override @Override
public String getPath() { public boolean isSensitive() {
return this.path; return this.sensitive;
} }
public void setPath(String path) { public void setSensitive(boolean sensitive) {
this.path = path; this.sensitive = sensitive;
} }
@Override @Override
public boolean isSensitive() { public String getPath() {
return this.sensitive; return this.path;
} }
public void setSensitive(boolean sensitive) { public void setPath(String path) {
this.sensitive = sensitive; this.path = path;
} }
@Override @Override

@ -60,14 +60,14 @@ public class LogFileMvcEndpoint implements MvcEndpoint, EnvironmentAware {
private String path = "/logfile"; private String path = "/logfile";
/** /**
* Enable security on the endpoint. * Enable the endpoint.
*/ */
private boolean sensitive = true; private boolean enabled = true;
/** /**
* Enable the endpoint. * Mark if the endpoint exposes sensitive information.
*/ */
private boolean enabled = true; private boolean sensitive = true;
private Environment environment; private Environment environment;
@ -85,6 +85,14 @@ public class LogFileMvcEndpoint implements MvcEndpoint, EnvironmentAware {
this.path = path; this.path = path;
} }
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override @Override
public boolean isSensitive() { public boolean isSensitive() {
return this.sensitive; return this.sensitive;
@ -94,14 +102,6 @@ public class LogFileMvcEndpoint implements MvcEndpoint, EnvironmentAware {
this.sensitive = sensitive; this.sensitive = sensitive;
} }
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override @Override
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() { public Class<? extends Endpoint> getEndpointType() {

@ -67,4 +67,5 @@ public class ManagementErrorEndpoint implements MvcEndpoint {
public Class<? extends Endpoint> getEndpointType() { public Class<? extends Endpoint> getEndpointType() {
return null; return null;
} }
} }

@ -17,24 +17,12 @@
"sourceType": "org.springframework.boot.actuate.endpoint.EnvironmentEndpoint", "sourceType": "org.springframework.boot.actuate.endpoint.EnvironmentEndpoint",
"description": "Keys that should be sanitized. Keys can be simple strings that the property ends with or regex expressions." "description": "Keys that should be sanitized. Keys can be simple strings that the property ends with or regex expressions."
}, },
{
"name": "endpoints.docs.enabled",
"type": "java.lang.Boolean",
"description": "Enable actuator docs endpoint.",
"defaultValue": true
},
{ {
"name": "endpoints.jmx.enabled", "name": "endpoints.jmx.enabled",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",
"description": "Enable JMX export of all endpoints.", "description": "Enable JMX export of all endpoints.",
"defaultValue": true "defaultValue": true
}, },
{
"name": "endpoints.jolokia.enabled",
"type": "java.lang.Boolean",
"description": "Enable Jolokia endpoint.",
"defaultValue": true
},
{ {
"name": "info", "name": "info",
"type": "java.util.Map<java.lang.String,java.lang.Object>", "type": "java.util.Map<java.lang.String,java.lang.Object>",

Loading…
Cancel
Save