-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support resolving file content to Base64 via {file} prefix #3179
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: johnycho <[email protected]>
|
Thanks for the PR. This is something that we would have to consider merging into our next minor release as a new feature. We won't begin that work until the July timeframe. Please check the build failure and fix any errors. I also think that this environment repository should be disabled by default since it has the potential to expose file content. We would also need documentation on how this feature works. |
Signed-off-by: johnycho <[email protected]>
Signed-off-by: johnycho <[email protected]>
|
Thanks for the review and the detailed feedback! @ryanjbaxter I completely understand the timeline regarding the next minor release in July. I have just pushed the updates addressing your comments:
Please let me know if there is anything else needed. |
|
I am wondering if it would be useful to be able to reference another file in the environment repository. For example the keystore could reside in the git repo and you might want to reference that file rather than a file in the filesystem of the config server. |
|
Thank you for the feedback. @ryanjbaxter I see the point about referencing a separate Git repo, but in practice keeping artifacts in the same environment repo can be safer when configs and keystores must evolve together. Splitting into another repo adds a version-coupling problem (which config revision matches which keystore revision), which can become another operational risk. This PR is not trying to dictate repo structure, but to eliminate server-local file deployment as a dependency and improve reproducibility. Multi-repo support sounds like a good follow-up, but likely belongs in a separate issue/PR. |
|
You are misunderstanding what I am suggesting I think... Say you have this in My understanding of the current functionality is that What I think would be another common use case would be a path relative to |
|
Thank you for the clarification. @ryanjbaxter Just to confirm — would it be acceptable to extend the current {file} resolution so that it can also handle paths relative to the environment Git repository, rather than only files on the Config Server’s local filesystem? For example, allowing something like to resolve within the repository. |
|
That is what I am suggesting. One thing to keep in mind is that not all EnvironmetRepositories have files, for example JDBC |
Signed-off-by: johnycho <[email protected]>
|
Thanks @ryanjbaxter for the suggestion! I have updated the PR to support relative paths pointing to files within the configuration repository (e.g., Git). Key Changes:
I believe this covers the use case you mentioned! |
This commit introduces
FileResolvingEnvironmentRepository, a decorator that intercepts property values starting with the{file}prefix. It reads the referenced file from the local file system, encodes the content to Base64, and replaces the original property value.Key changes:
FileResolvingEnvironmentRepositoryto wrap existing repositories.PropertySourceinstances instead of modifying existing maps.FileResolvingEnvironmentRepositoryConfigurationfor auto-configuration.Fixes gh-2441