问题
I saw that spring cloud config provides an /encrypt
and /decrypt
endpoints. How can I use the encrypt and decrypt endpoint via Advanced REST Client in order to view the encrypted or decrypted string?
回答1:
As Spring Cloud Config documentation states:
The server also exposes
/encrypt
and/decrypt
endpoints (on the assumption that these will be secured and only accessed by authorized agents). If you are editing a remote config file you can use the Config Server to encrypt values by POSTing to the/encrypt
endpoint.
For encryption, send a POST
request to the /encrypt
endpoint with the Clear Text as the request body:
$ curl localhost:8888/encrypt -d mysecret
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
The inverse operation is also available via
/decrypt
(provided the server is configured with a symmetric key or a full key pair).
For decryption, send a POST
request to the /decrypt
endpoint with the Cipher Text as the request body:
$ curl localhost:8888/decrypt -d 682bc583f4641835fa2db00935529366...
mysecret
来源:https://stackoverflow.com/questions/37488311/spring-cloud-config-encrypt-password