[bs-138] Add categories (secure,open) to EndpointsProperties

This commit is contained in:
Dave Syer 2013-06-03 09:48:40 +01:00
parent c99d7a0a09
commit a6c03e72e6
2 changed files with 21 additions and 1 deletions

View File

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.bootstrap.actuate.properties; package org.springframework.bootstrap.actuate.properties;
import javax.validation.Valid; import javax.validation.Valid;
@ -26,6 +25,7 @@ import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
* Externalized configuration for endpoints (e.g. paths) * Externalized configuration for endpoints (e.g. paths)
* *
* @author Dave Syer * @author Dave Syer
*
*/ */
@ConfigurationProperties(name = "endpoints", ignoreUnknownFields = false) @ConfigurationProperties(name = "endpoints", ignoreUnknownFields = false)
public class EndpointsProperties { public class EndpointsProperties {
@ -109,4 +109,14 @@ public class EndpointsProperties {
} }
} }
public String[] getSecurePaths() {
return new String[] { getMetrics().getPath(), getBeans().getPath(),
getDump().getPath(), getShutdown().getPath(), getTrace().getPath() };
}
public String[] getOpenPaths() {
return new String[] { getHealth().getPath(), getInfo().getPath(),
getError().getPath() };
}
} }

View File

@ -33,6 +33,8 @@ public class SecurityProperties {
private SessionCreationPolicy sessions = SessionCreationPolicy.stateless; private SessionCreationPolicy sessions = SessionCreationPolicy.stateless;
private String[] ignored = new String[0];
public SessionCreationPolicy getSessions() { public SessionCreationPolicy getSessions() {
return this.sessions; return this.sessions;
} }
@ -57,6 +59,14 @@ public class SecurityProperties {
this.requireSsl = requireSsl; this.requireSsl = requireSsl;
} }
public void setIgnored(String... ignored) {
this.ignored = ignored;
}
public String[] getIgnored() {
return this.ignored;
}
public static class Basic { public static class Basic {
private boolean enabled = true; private boolean enabled = true;