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