Polish
See gh-18736
This commit is contained in:
committed by
Stephane Nicoll
parent
7827d1261e
commit
f61da8b723
@@ -75,7 +75,7 @@ public enum ApiVersion {
|
|||||||
try {
|
try {
|
||||||
return valueOf(type.toUpperCase());
|
return valueOf(type.toUpperCase());
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex) {
|
catch (IllegalArgumentException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -65,13 +65,13 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
|
|||||||
|
|
||||||
private Map<EndpointId, PathMappedEndpoint> getEndpoints(Collection<EndpointsSupplier<?>> suppliers) {
|
private Map<EndpointId, PathMappedEndpoint> getEndpoints(Collection<EndpointsSupplier<?>> suppliers) {
|
||||||
Map<EndpointId, PathMappedEndpoint> endpoints = new LinkedHashMap<>();
|
Map<EndpointId, PathMappedEndpoint> endpoints = new LinkedHashMap<>();
|
||||||
suppliers.forEach((supplier) -> {
|
for (EndpointsSupplier<?> supplier : suppliers) {
|
||||||
supplier.getEndpoints().forEach((endpoint) -> {
|
supplier.getEndpoints().forEach((endpoint) -> {
|
||||||
if (endpoint instanceof PathMappedEndpoint) {
|
if (endpoint instanceof PathMappedEndpoint) {
|
||||||
endpoints.put(endpoint.getEndpointId(), (PathMappedEndpoint) endpoint);
|
endpoints.put(endpoint.getEndpointId(), (PathMappedEndpoint) endpoint);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
return Collections.unmodifiableMap(endpoints);
|
return Collections.unmodifiableMap(endpoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,11 +100,8 @@ public class HealthWebEndpointResponseMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean canSeeDetails(SecurityContext securityContext, ShowDetails showDetails) {
|
private boolean canSeeDetails(SecurityContext securityContext, ShowDetails showDetails) {
|
||||||
if (showDetails == ShowDetails.NEVER || (showDetails == ShowDetails.WHEN_AUTHORIZED
|
return showDetails != ShowDetails.NEVER && (showDetails != ShowDetails.WHEN_AUTHORIZED
|
||||||
&& (securityContext.getPrincipal() == null || !isUserInRole(securityContext)))) {
|
|| (securityContext.getPrincipal() != null && isUserInRole(securityContext)));
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isUserInRole(SecurityContext securityContext) {
|
private boolean isUserInRole(SecurityContext securityContext) {
|
||||||
|
|||||||
Reference in New Issue
Block a user