Skip to content

Commit

Permalink
docs(secret store): update secret store note for multiValue
Browse files Browse the repository at this point in the history
  • Loading branch information
lony2003 committed Jun 3, 2024
1 parent 15fb55c commit 8ef091b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/en/secretstore/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ or
spring.config.import = dapr:secret:mysecret/secret
```

Where `dapr:secret:` is the fixed field for the dapr secret store configuration, and the subsequent `mysecret/secret` is the user-configured secret location, formatted as `[Secret Store Name]/[Secret Name]`. You can also provide only the Secret Store Name, in which case the Dapr Client will retrieve all Secrets under that Secret Store, with the secret location formatted as `[Secret Store Name]`.
Where `dapr:secret:` is the fixed field for the dapr secret store configuration, and the subsequent `mysecret/secret` is the user-configured secret location, formatted as `[Secret Store Name]/[Secret Name]`. You can also provide only the Secret Store Name, in which case the Dapr Client will retrieve all Secrets under that Secret Store using Bulk, with the secret location formatted as `[Secret Store Name]`.

> __Please note: To avoid parsing failures, do not add any extra characters (such as "/", ":") at the beginning, end, or middle of the secret location.__
The document translates the Dapr Secret Store by converting the Secret Store configuration into a string in the Spring Boot Properties format for parsing. Therefore, when configuring the Secret Store, please store the secret key in a format similar to `spring.mysql.username`.

> __Please note: If the Secret is in a nested format, such as using json in localfile mode and nesting more than two layers, you need to set the `nestedSeparator` to `.`.__
> __The standard retrieval mode requires the 'multiValued' setting to be set to true. If your Secret Store implementation does not support 'multiValue', please use the Bulk mode to retrieve Secrets.__
It's important to note that since the configuration import process occurs during the Bootstrap phase, when the Spring IOC has not yet begun the batch Bean creation process, it is not possible to inject DaprClient by specifying `@Bean` in the Application Configuration.

Expand Down
3 changes: 2 additions & 1 deletion docs/zh-CN/secretstore/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ spring:
spring.config.import = dapr:secret:mysecret/secret
```

其中dapr:secret:为dapr secret store配置的固定字段,后方的mysecret/secret为用户配置的secret位置,格式为`[Secret Store Name]/[Secret Name]`,也可以只提供Secret Store Name,此时Dapr Client将获取该Secret Store下的所有Secret,此时secret位置格式为`[Secret Store Name]`
其中dapr:secret:为dapr secret store配置的固定字段,后方的mysecret/secret为用户配置的secret位置,格式为`[Secret Store Name]/[Secret Name]`,也可以只提供Secret Store Name,此时Dapr Client将使用Bulk模式获取该Secret Store下的所有Secret,此时secret位置格式为`[Secret Store Name]`

> __请注意:为了避免解析失败,请不要在secret位置的首尾及中间位置额外添加任何字符(如"/",":")__
本工件解析Dapr Secret Store的方式是将Secret Store配置转换为Spring Boot Properties格式的字符串进行解析,所以在配置Secret Store时,请将机密key存储为类似`spring.mysql.username`的格式。

> __请注意:如果为Secret为嵌套格式,如localfile模式中使用json并嵌套超过两层时,需要将`nestedSeparator`设定为`.`__
> __普通获取模式需要将multiValued设置为true,如果您的Secret Store实现并不支持multiValue,请使用Bulk模式获取Secret。__
值得注意的是,由于配置引入的过程是在Bootstrap阶段进行的,此时Spring IOC并没有开始进行批量的Bean创建过程,所以无法通过在Application Configuration中指定`@Bean`来实现对DaprClient的注入。

Expand Down

0 comments on commit 8ef091b

Please sign in to comment.