Process Spring Boot externalized property values

后端 未结 5 716
广开言路
广开言路 2020-12-03 12:22

I have the task of obfuscating passwords in our configuration files. While I don\'t think this is the right approach, managers disagree...

So the project I am workin

5条回答
  •  佛祖请我去吃肉
    2020-12-03 13:11

    Use spring cloud config server

    Define encrypt.key=MySecretKey

    Post message to encrypt https://config-server/encrypt

    Define password now like

    app.password={cipher}encryptedvalue
    

    Use @Value("${app.password}") in code

    and spring boot should give you decrypted value

提交回复
热议问题