Closed jsattler closed 1 year ago
See the Spring Cloud 2022.0.0 release notes. https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2022.0-Release-Notes#breaking-changes
We have removed support for the spring cloud cli in the 2022 release train and the 2022 release train is the only release train that is compatible with Boot 3.0.0. In other words there will not be a Spring Cloud CLI release that will work with Boot 3.0.0.
@ryanjbaxter How can we encrypt and decrypt properties with {chiper}
in the terminal now that Spring Cloud CLI does not work with Spring Boot 3 ?
You will not be able to using the CLI
@ryanjbaxter Ok I understand. But is there any alternative way to encrypt and decrypt secrets, now ?
Hi @akoufa, please refer to https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_encryption_and_decryption to use the Config Server instance itself to encrypt values. I have used and preferred this method for some time now and find it simple and effective.
There is nothing better (and easy) to go back to 2.x versions -
sdk install springboot 2.7.15
set the above as default if prompted
spring install org.springframework.cloud:spring-cloud-cli:3.1.1
spring encrypt mysecret --key foo
spring decrypt --key foo 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
👍
Otherwise there is a up to date standalone replacement for it now:
https://github.com/mptechnology/spring-crypto-cli
@mpstadler Thanks!
Otherwise there is a up to date standalone replacement for it now: https://github.com/mptechnology/spring-crypto-cli
This should work just fine - and if someone doesn't want to use 3rd party tools for this security related part - the code is right in https://github.com/mptechnology/spring-crypto-cli/blob/main/src/main/java/ch/mptechnology/crypto/CryptoCli.java and pretty easy to use in a snippet file or something for local execution.
The snippet (with the dependency on spring-security-crypto
, included in i.e. spring-boot-starter-security
) could be just
org.springframework.security.crypto.encrypt.
Encryptors.text(System.getenv("ENCRYPT_KEY"), "deadbeef").encrypt("password")
just don't check it in 🙃. The salt needs to be "deadbeef" as it seems its not included within the encrypted text 🤷 - thus the spring-cloud-starter-config predefined one must be used.
Following the install instructions I end up with the following message:
I installed
spring-boot-cli
v3.0.0 via Homebrew and it seems there is an incompatibility withspring-cloud-cli
v3.1.1.Am I missing something or is the
install
command just not supported anymore? If not what is the suggested way to still be able to usespring-cloud-cli
?