spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.42k stars 40.76k forks source link

Reference documentation incorrectly uses 'disabled' rather than 'none' for access restrictions #43351

Open lincze opened 6 hours ago

lincze commented 6 hours ago

i've installed spring boot 3.4.0, and tried to migrate to the new actuator configuration.

e.g. according to the docs:

management.endpoints.access.default=disabled
management.endpoint.loggers.access=read-only

(copy-pasted)

but when i use this, will get an exception:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [hu.f400.lifews.api.Application]: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration
...
Caused by: java.lang.IllegalArgumentException: No enum constant org.springframework.boot.actuate.endpoint.Access.disabled

and indeed, at Access.java you see:

...
public enum Access {

    /**
     * No access to the endpoint is permitted.
     */
    NONE,

    /**
     * Read-only access to the endpoint is permitted.
     */
    READ_ONLY,

    /**
     * Unrestricted access to the endpoint is permitted.
     */
    UNRESTRICTED;
...

using these values in my config:

management.endpoints.access.default=NONE
management.endpoint.health.access=READ_ONLY
...

it just works.

philwebb commented 4 hours ago

Also raised in https://github.com/spring-projects/spring-boot/issues/43302#issuecomment-2503531224