service-binding-operator icon indicating copy to clipboard operation
service-binding-operator copied to clipboard

Extract key from json object in a Secret

Open haf-tech opened this issue 4 years ago • 2 comments

Enhancement Provide the capability to extract a key/field from a json object which is stored in a Secret resource object

Example

kind: Secret
data
   connection: base64-encoded-string

The base64-encoded-string contains a JSON string, like

{
  "postgres": {
      "auth": {
          "user": "blub",
          "pass": "pass",
          "method": "direct"
      },
      "host": "example.com",
      "tls": {

      }
  }
}

Objective is, that SBO only inject/bind a specific field from the JSON, e.g. postgres.auth.user and postgres.auth.pass etc. in the resulting Secret in separate keys.

Probably, this is possible with the new go-template support in the mapping?

haf-tech avatar Jan 31 '21 18:01 haf-tech

cc @redhat-developer/service-binding

sbose78 avatar Feb 16 '21 13:02 sbose78

We could handle this as part of the Mapping Extension in the spec: https://github.com/servicebinding/spec/issues/145

baijum avatar Apr 07 '22 12:04 baijum

@haf-tech Hi, are you still interested in this feature? Please let us know.

pmacik avatar Dec 08 '22 13:12 pmacik

@haf-tech Closing the issue now, if you are still interested feel free to re-open.

pmacik avatar Jan 19 '23 13:01 pmacik