Closed c0d1ngm0nk3y closed 1 year ago
This looks good. One question.
I think we should also try to flatten out the credentials into key/value pairs on the binding.
Thoughts on this?
This PR has creds defined as Credentials map[string]string
, and the entire Secret value is set to the map. This would make fetching values out of the credentials a little harder because you'd have to look for a binding of the right type, then pull the Credentials
, then pull out the value from the map. I think this would also be problematic with auto-config Spring Cloud Bindings which expects bindings with names like url
and password
, not credentials
.
I think we should keep what you have here and put it in as credentials, but we should also flatten the credentials so that there is a new (credentials key as the name and credentials value as the secret) Secret for each key in the Credentials map. That would mean you could look them up either way, fetch the whole set of credentials from one binding or fetch them individually.
My only concern was with overlap in credentials (like if something inside credentials had a key named credentials) and something outside of credentials (like type or credentials), but I don't think that should generally happen.
And thanks for submitting this so quickly!
I think this would also be problematic with auto-config Spring Cloud Bindings which expects bindings with names like
url
andpassword
, notcredentials
.
I am afraid, I didn't get it yet. Are you referring to this? Since Credentials
get passed into Secret
(see here), the usage should be the same.
Or what do you mean?
see this comment.
When reading bindings from
VCAP_SERVICES
,provider
andtype
are set and could have different values.