mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
[bs-138] Add categories (secure,open) to EndpointsProperties
This commit is contained in:
parent
c99d7a0a09
commit
a6c03e72e6
@ -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() };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user