-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Restrict runtime config property changes #45606
Comments
/cc @radcortez (config) |
I believe there are a couple of options to implement this: You can add a config source with max ordinality. That will place that source at the top of lookup, effectively negating any overrides. We do something similar for our configuration, that is, build time and runtime fixed:
This is not 100% bullet proof. A user could provide a source with max ordinality as well, and in that case, the result is undefined, because of the sort. For us, this has been good enough. Another option is to provide an interceptor and throw an exception if the value is coming from an unexpected source. This can probably be implemented in a 100% reliable way. To avoid leaks, the Ideally, |
Is there a way to have the config source interceptor only filter only during runtime and not build time? |
Are you using a Quarkus extension, or is it just part of the application? The Quarkus extension is straightforward, but from the application, not so much. |
I am using it in a application, but i am also used to writing extensions. Your answer is indicating that i need to write an extension with a buildstep registering the service class only for runtime? |
It is easier with an extension because you can use |
Do you have some recommendation for specific classes to check? I need a quick solution before creating a extension. Would really appreciate that. |
Something like this is working for me to check for runtime env:
Do i miss something? |
Description
I would like support to restrict (all) quarkus properties from being changed at runtime and only allow changes to specific quarkus properties or custom properties. This would be nice for distributed applications to be protected from users changing sensitive properties that should not be changed. this should also work in native images.
Currently i do not see the possibility to do this. If there is a workaround for this i would really appreciate someone commenting it here.
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: