dwp / queue-triage

DLQ processing support
MIT License
5 stars 4 forks source link

Declaring a Vault path inside server.ssl.keyStorePassword is not resolved correctly #162

Closed dwp-kevinpotgieter closed 6 years ago

dwp-kevinpotgieter commented 6 years ago

TL;DR - Register a converter from char[] to String

Given config that looks something like:

server:
  ssl:
    keyStorePassword: "VAULT(/some/secret/path)"   

Vault is correctly able to lookup the value, and return the char[] representation of this vault path.

However, when the configuration properties bean binding occurs, this value is incorrectly set on the corresponding configuration POJO. (See the org.springframework.boot.autoconfigure.web.ServerProperties for more details.)

The main reason being, is that the keyStorePassword field on the org.springframework.boot.context.embedded.Ssl class is a String not a char[], and there is no relevant org.springframework.core.convert.converter.Converter registered to handle this so the default fallback is to call .toString() on the object in question.

amcghie commented 6 years ago

@dwp-kevinpotgieter are you happy for this to be closed?

dwp-kevinpotgieter commented 6 years ago

Yip. Looks like this change is merged in now and should be working. Am happy for it to be closed.