-
Notifications
You must be signed in to change notification settings - Fork 322
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
Spring framework 6.2 placeholder parser rewrite breaks the secret manager prefix sm:// #3391
Comments
For our project, the workaround to use We've rolled back to spring-boot 3.3.6 to ensure spring-framework 6.1.x is used. |
If the secret is in a quoted string it should be double escaped, as so |
It is in a properties file |
Thanks for raising this and providing a workaround. Mine was in a single quoted string in a helm
|
I can also confirm that the workaround with escaping the double-colon works. Any plans from google side to address this issue with a fix, though? |
Registering my interest in a bugfix - this is quite a problematic breaking change from Spring. I wish that I had a good solution to offer. |
We don't support spring boot 3.4.0 right now and we've been working on the support, see #3320. Please see the compatibility with spring project versions. |
This will be solved by Framework 6.2.2, it's in their next milestone's roadmap - see spring-projects/spring-framework#34124. We are still working on upgrading to Cloud 2024 as per #3320 (comment). |
For the record, this was never meant to be supported in the first place. That being said, we've decided to restore this use case for backward compatible reason with 6.x but we might revisit this in the future. In short, please don't rely on a placeholder with a non escaped reserved keyword in it. |
so just to confirm: currently there is no way to use escape sm:// in properties files correctly to make it work with Spring Boot 3.4 / Spring Framework 6.2 ? /cc @keesvandieren |
For us it didn't work, but for some others it seemed to work? |
Worked for us with: |
There is currently no version of Spring Cloud GCP yet that is compatible with Spring Cloud 2024.0 / Spring Boot 3.4 / Spring Framework 6.2 (see Compatibility with Spring Project Versions). I would recommend just waiting for Spring Cloud GCP 6 to be released before upgrading. |
Describe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.
spring-cloud-gcp-starter-secretmanager: 5.8.0
Spring framework 6.2.0 (i.e, spring boot 3.4.0)
The rewrite of springs property placeholder parser (6.1 vs 6.2) changes the way default values are parsed. This change breaks hardcoded prefix of the secret manager,
sm://
.For example a property defined as
secret: ${sm://MY_SECRET}
will be be parsed differently in spring framework 6.1 and 6.2. In 6.1 it will be resolved correctly to the actual secret. In 6.2 it will be parsed as//MY_SECRET
(unless a property calledsm
is defined) which is clearly wrongThe workaround is to change the prefix in each application config to
sm\://
, e.g.,secret: ${sm\://MY_SECRET}
, but this is not only ugly but not at all intuitive to do.At the very least I expect the documentation to be updated with the workaround.
Would it be possible to either
:
, such assm//
Workaround (yaml)
The text was updated successfully, but these errors were encountered: