Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial endpoint enabled whereas global is disabled #2767

Closed
RaphC opened this issue Apr 3, 2015 · 4 comments
Closed

partial endpoint enabled whereas global is disabled #2767

RaphC opened this issue Apr 3, 2015 · 4 comments
Assignees
Labels
type: blocker An issue that is blocking us from releasing type: bug A general bug
Milestone

Comments

@RaphC
Copy link

RaphC commented Apr 3, 2015

Hi,

I noticed in Spring-boot 1.2.2.RELEASE that when you disable an endpoint you can access to a specific information.

Here is my application.yml file :

# ENDPOINTS
endpoints:
 enabled: false # disabled by default
/pre>

If I try to access /admin/env I got the following message : 


<SingletonMap>
<message>This endpoint is disabled</message>
</SingletonMap>

However I can access /admin/env/management.port infos

@philwebb philwebb added type: bug A general bug type: blocker An issue that is blocking us from releasing labels Apr 3, 2015
@philwebb philwebb added this to the 1.2.4 milestone Apr 3, 2015
@wilkinsona
Copy link
Member

This is somewhat similar to #2476

@wilkinsona wilkinsona self-assigned this Apr 7, 2015
@wilkinsona
Copy link
Member

The /metrics endpoint has the same problem

@wilkinsona
Copy link
Member

Reopening to consider how to reinstate the support for relaxed binding

@wilkinsona wilkinsona reopened this Apr 7, 2015
@philwebb
Copy link
Member

philwebb commented Apr 7, 2015

You might get away with a custom condition just to deal with endpoints.enabled. You could then use that in combination with the previous @ConditionalOnProperty conditions. One other thing to note is that SpEL is a lot slower to execute that the property tests.

bsodzik pushed a commit to bsodzik/spring-boot that referenced this issue May 23, 2015
Previously, only invocations of /metricName/ would honour the enabled
property and return a not found (404) response. For endpoints which
support nested paths, access to /metricName/foo would ignore the enabled
flag and return an OK (200) response. Furthermore, there was a comment
in EndpointMvcAdapter that suggested that an endpoint shouldn’t be
called when it is disabled, however this was not the case.

This commit updates EndpointWebMvcAutoConfiguration and
JolokiaAutoConfiguration to only register their MvcEndpoint beans if
the underlying endpoint is enabled. This means that an
EndpointMvcAdapter should not be called if its delegate is disabled,
making the comment described above accurate.

The check for the delegate being enabled has been retained so as not to
rely upon the auto-configurations’ behaviour. The methods which handle
nested paths (MetricsMvcEndpoint.value() and
EnvironmentMvcEndpoint.value()) have been updated to add the same check
for the enablement of their delegate.

Fixes spring-projectsgh-2767
bsodzik pushed a commit to bsodzik/spring-boot that referenced this issue May 23, 2015
This commit improves upon the changes made in a8bf9d3 by adding
support for relaxed binding of the endpoints.enabled and
endpoints.<name>.enabled properties. This is achieved by replacing
use of @ConditionalOnExpression (which does not support relaxed
binding) with a custom condition implementation that uses
RelaxedPropertyResolver.

Closes spring-projectsgh-2767
bsodzik pushed a commit to bsodzik/spring-boot that referenced this issue May 23, 2015
Previously, only invocations of /metricName/ would honour the enabled
property and return a not found (404) response. For endpoints which
support nested paths, access to /metricName/foo would ignore the enabled
flag and return an OK (200) response. Furthermore, there was a comment
in EndpointMvcAdapter that suggested that an endpoint shouldn’t be
called when it is disabled, however this was not the case.

This commit updates EndpointWebMvcAutoConfiguration and
JolokiaAutoConfiguration to only register their MvcEndpoint beans if
the underlying endpoint is enabled. This means that an
EndpointMvcAdapter should not be called if its delegate is disabled,
making the comment described above accurate.

The check for the delegate being enabled has been retained so as not to
rely upon the auto-configurations’ behaviour. The methods which handle
nested paths (MetricsMvcEndpoint.value() and
EnvironmentMvcEndpoint.value()) have been updated to add the same check
for the enablement of their delegate.

Fixes spring-projectsgh-2767
bsodzik pushed a commit to bsodzik/spring-boot that referenced this issue May 23, 2015
This commit improves upon the changes made in a8bf9d3 by adding
support for relaxed binding of the endpoints.enabled and
endpoints.<name>.enabled properties. This is achieved by replacing
use of @ConditionalOnExpression (which does not support relaxed
binding) with a custom condition implementation that uses
RelaxedPropertyResolver.

Closes spring-projectsgh-2767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: blocker An issue that is blocking us from releasing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants