From 38f7a24f62397709eb0235e5f860dbce093f7b98 Mon Sep 17 00:00:00 2001 From: Phil Kedy Date: Wed, 25 Aug 2021 14:14:48 -0400 Subject: [PATCH] Adding more detail on how flattened values work when multiValued = true. --- .../file-secret-store.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-secret-stores/file-secret-store.md b/daprdocs/content/en/reference/components-reference/supported-secret-stores/file-secret-store.md index 2475d4fbb..16370f955 100644 --- a/daprdocs/content/en/reference/components-reference/supported-secret-stores/file-secret-store.md +++ b/daprdocs/content/en/reference/components-reference/supported-secret-stores/file-secret-store.md @@ -45,7 +45,7 @@ spec: ## Setup JSON file to hold the secrets -Given the following json: +Given the following JSON loaded from `secretsFile`: ```json { @@ -82,6 +82,31 @@ If `multiValued` is `"true"`, you would instead use the top level key. In this e } ``` +Nested structures after the top level will be flattened. In this example, `connectionStrings` would return the following map: + +JSON from `secretsFile`: + +```json +{ + "redisPassword": "your redis password", + "connectionStrings": { + "mysql": { + "username": "your mysql username", + "password": "your mysql password" + } + } +} +``` + +Response: + +```json +{ + "mysql:username": "your mysql username", + "mysql:password": "your mysql password" +} +``` + This is useful in order to mimic secret stores like Vault or Kubernetes that return multiple key/value pairs per secret key. ## Related links