-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Enable Serverless API protections dynamically #97079
Conversation
This commit changes the method for enabling Serverless API protections (see elastic#93607) from a system property to a runtime property. Within this project there is no external way to configure this property - it must be controlled by a plugin - but the RestController has been changed to dynamically adapt to a change in that property.
Hi @tvernum, I've created a changelog YAML for you. |
This is draft (no tests, and probably breaks existing tests) but it works in local testing, so I wanted to put it up for a first pass review in case someone hates the direction. |
This PR is ready for review now |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As commented on the other PR, there is a way to register a setting update listener without registering the setting itself. This would be my personal choice of implementation. But since the whole thing is temporary, the difference likely does not really matter.
|
||
package org.elasticsearch.rest; | ||
|
||
public class ServerlessApiProtections { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should we just call it ApiProtections
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind. I made it explicit because the annotation is @ServerlessScope
, so it's not intended to ever be a generic API protections facility.
I'm going to leave it as-is, mostly because I don't like the idea of having a setting in server that isn't registered. |
@elasticsearchmachine run elasticsearch-ci/part-3 please. |
This commit changes the method for enabling Serverless API protections (see #93607) from a system property to a runtime property.
Within this project there is no external way to configure this property - it must be controlled by a plugin - but the RestController has been changed to dynamically adapt to a change in that property.