{"action":"reopened","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-commons/issues/87","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-commons","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-commons/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-commons/issues/87/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-commons/issues/87/events","html_url":"https://github.com/spring-cloud/spring-cloud-commons/issues/87","id":131155846,"number":87,"title":"Decrypted values from environment variables not being picked up","user":{"login":"tanob","id":5013,"avatar_url":"https://avatars.githubusercontent.com/u/5013?v=3","gravatar_id":"","url":"https://api.github.com/users/tanob","html_url":"https://github.com/tanob","followers_url":"https://api.github.com/users/tanob/followers","following_url":"https://api.github.com/users/tanob/following{/other_user}","gists_url":"https://api.github.com/users/tanob/gists{/gist_id}","starred_url":"https://api.github.com/users/tanob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanob/subscriptions","organizations_url":"https://api.github.com/users/tanob/orgs","repos_url":"https://api.github.com/users/tanob/repos","events_url":"https://api.github.com/users/tanob/events{/privacy}","received_events_url":"https://api.github.com/users/tanob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-03T21:14:11Z","updated_at":"2016-02-05T14:38:05Z","closed_at":null,"body":"Given a Spring bean like this:\r\n\r\n```java\r\n@Component\r\npublic class Foo {\r\n    private final String fooPassword;\r\n\r\n    @Autowired\r\n    public Foo(@Value(\"${foo.password}\") String fooPassword) {\r\n        System.out.println(\"foo password is \" + fooPassword);\r\n        this.fooPassword = fooPassword;\r\n    }\r\n}\r\n```\r\n\r\nwhen we run the app providing an `ENCRYPT_KEY` and an encrypted value for `foo.password` using the relaxed binding ([reference 1](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-relaxed-binding) and [reference 2](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files)) through `FOO_PASSWORD`, it is not printing the decrypted value for `foo.password`:\r\n\r\n```\r\n$ ENCRYPT_KEY=foo FOO_PASSWORD={cipher}23cd3b5b92db6791c531fda2e2bdd51f2dd3d94d9f1de7b5ba932b5501dd72fc ./gradlew bootRun | grep \"foo password is\"\r\nfoo password is {cipher}23cd3b5b92db6791c531fda2e2bdd51f2dd3d94d9f1de7b5ba932b5501dd72fc\r\n```\r\n\r\nThe expected output would be:\r\n\r\n```\r\nfoo password is mypassword\r\n```\r\n\r\nThe same works if we change the environment variable name to match the dot-syntax one:\r\n\r\n```\r\n$ env ENCRYPT_KEY=foo foo.password={cipher}23cd3b5b92db6791c531fda2e2bdd51f2dd3d94d9f1de7b5ba932b5501dd72fc ./gradlew bootRun | grep \"foo password is\"\r\nfoo password is mypassword\r\n```\r\n\r\n(Notice I'm using the `env` command to be able to pass an env variable with a dot in the name, [more info here](http://unix.stackexchange.com/a/93533))\r\n\r\nYou can see the full example here:\r\nhttps://github.com/tanob/spring-relaxed-binding-and-decrypted-values\r\n"}}