-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Try to drop EndpointExposure #10176
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
Comments
The enum really reflects reality. For example, we need to generate |
Actually, now the package restructure is in I would like to reconsider our options. Something doesn't feel quite right about The |
The need for per-technology enablement is driven by the shutdown endpoint. For an app that doesn't need HTTP security, I think it's useful to be able to only expose the shutdown endpoint over JMX otherwise anyone with HTTP access to the app could shut it down. |
I second that and disagree with the complex argument. Things are located in a single class and the contract is isolated. I agree this particular class is a bit complex but that doesn't leak elsewhere. |
I'll try to spike something then we can make a decision. |
Still a way to go, but I've started experimenting here. Trying an annotation approach for both specializations and extensions: @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@EndpointExtension(filter = WebEndpointFilter.class) // Extension that only applies when the filter matches
public @interface EndpointWebExtension {
@AliasFor(annotation = EndpointExtension.class)
Class<?> endpoint();
} @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Endpoint
@FilteredEndpoint(WebEndpointFilter.class) // Endpoint only discovered when the filter matches
public @interface WebEndpoint {
@AliasFor(annotation = Endpoint.class)
String id();
@AliasFor(annotation = Endpoint.class)
boolean enableByDefault() default true;
} |
It might be possible to drop the
EndpointExposure
enum and replace it with a class. Currently it's somewhat limiting in that additional items can't be added easily.We might be able to use
Class<? extends AnnotationEndpointDiscoverer>
.The text was updated successfully, but these errors were encountered: