spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Endpoint: /key/{name}/{profiles} returns same key

Open thiagogjt opened this issue 10 years ago • 5 comments

Hi!

"/key/{name}/{profiles}" endpoint is meant to do what? I've created a keystore and added 2 keys, but the endpoint always the same key (the default one) no matters what parameter i provide.

thiagogjt avatar Nov 27 '16 16:11 thiagogjt

How have you configured the keys?

@dsyer might be able to explain it.

spencergibb avatar Nov 28 '16 19:11 spencergibb

Hi!

I've created a keystore

keytool -genkeypair -alias cbr-setup -keyalg RSA -dname "CN=setup.abc.com.br" -keypass XXXXX -keystore cbr-setup.jks -storepass XXXXX

added another key to it

keytool -genkeypair -alias scc -keyalg RSA -dname "CN=scc.abc.com.br" -keypass XXXXXX -keystore cbr-setup.jks -storepass XXXXXX

application.yml:

encrypt:
  keyStore:
    location: classpath:/cbr-setup.jks
    password: XXXXX
    alias: cbr-setup
    secret: XXXXX

trying to obtain both keys with:

http://server/key/cbr-setup/default
http://server/key/scc/default

but the endpoint always return the default one (cbr-setup)

thiagogjt avatar Nov 28 '16 19:11 thiagogjt

I see, the name parameter is not the name of the key, but the name of the application.

spencergibb avatar Nov 28 '16 19:11 spencergibb

Hi @spencergibb, thanks for the feedback!

Sorry, but i dont got it. For the record, i already made my own EncryptionController with a mapping to get the key based on the parameters, my doubt is if this endpoint was meant to do that. If it is a bug, we can fix it, if is a feature i whant to understand how it works

thiagogjt avatar Nov 28 '16 21:11 thiagogjt

I don't think so, but I'm not real familiar with this code.

spencergibb avatar Dec 02 '16 00:12 spencergibb