-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
@EndpointDisabled can be used on methods #40433
Comments
Alternatively one could extend the |
As an alternative you could use build profiles e.g. @DELETE
@IfBuildProfile("test")
public void deleteSomething () {
// ...
} |
but I want a toggle for runtime not build time... |
I think the requirement makes sense. I also wonder if it could be a good first issue if someone from the team provided a bit more details about how it could be implemented. I would expect most of the changes to be done in |
What OP is asking for though is to have the methods disabled with a runtime configuration property. I don't remember how the annotation works, so I would have to look at the code again |
Makes sense to extend its granularity from class to methods, yes. |
I'd love to try implementing it myself - as a first issue as @gsmet says. |
Feel free! |
I think adjusting the existing one is probably better |
Description
@EndpointDisabled currently "provides the ability to conditionally enable [i.e. disable] a JAX-RS Resource class at runtime based on the value of a property."
I would like to use this annotation or a similar one to disable specific methods (in Rest Data Panache https://quarkus.io/guides/rest-data-panache#using-a-runtime-property) at runtime based on a property.
My use case is, I use the state-changing PUT, POST and DELETE methods in tests, but want to disable them for security reasons in production and still be able to use the GET methods in production to query the data.
Implementation ideas
Currently the annotation is
@Target({ElementType.TYPE})
but should ideally be alsoElementType.METHOD
.The text was updated successfully, but these errors were encountered: