Secret name containing a period is truncated to the last period in Spring Cloud Services Config Server
search cancel

Secret name containing a period is truncated to the last period in Spring Cloud Services Config Server

book

Article ID: 297166

calendar_today

Updated On:

Products

Support Only for Spring

Issue/Introduction

Whenever a secret is created in Spring Cloud Services Config Server, if the name contains one or more period or dot, the name is truncated to the last period or dot (excluded).
  • If no secret with the resulting name exists, then a new secret is created with the truncated name.
  • If a secret corresponding to the truncated name already exists, then it is overwritten.
This issue occurs when using the Spring Cloud Services cf CLI plugin or the Config Server API.

For example, creating the secret foo.bar will actually create (or overwrite) foo
cf cs-add service app/default/master/foo.bar '{"key":"value"}'
-> /c/p.spring-cloud-services-scs-service-broker/config-server-00000000-0000-0000-0000-000000000000/app/default/master/foo


Environment

Product Version: 3.1

Resolution

The issue is present in lower versions of SCS and has been fixed in 3.1.32+.

To work around this issue, do the following:


Spring Cloud Services cf CLI plugin

If using Spring Cloud Services cf CLI plugin, add a trailing period to the secret name: foo.bar. creates (or overwrites) foo.bar.
cf cs-add service app/default/master/foo.bar. '{"key":"value"}'
-> /c/p.spring-cloud-services-scs-service-broker/config-server-00000000-0000-0000-0000-000000000000/app/default/master/foo.bar


Config Server API 

If using Config Server API, add a trailing slash to the query, [...]/foo.bar/, creates (or overwrites) foo.bar.
curl https://config-server-00000000-0000-0000-0000-000000000000.lab.local/secrets/app/default/master/foo.bar/ -iks -H "Authorization: $(cf oauth-token)" -X PUT --data '{"key":"value"}' -H "Content-Type: application/json"
-> /c/p.spring-cloud-services-scs-service-broker/config-server-00000000-0000-0000-0000-000000000000/app/default/master/foo.bar