Update component-secrets.md

Changed the wording of "How-To: Reference secrets in components" to satisfy the requirements in issue #1440.
This commit is contained in:
georgestevens99 2021-08-31 19:15:54 -04:00
parent b420062481
commit 2cf5ce5e13
1 changed files with 3 additions and 3 deletions

View File

@ -64,10 +64,10 @@ auth:
`SECRET_STORE_NAME` is the name of the configured [secret store component]({{< ref supported-secret-stores >}}). When running in Kubernetes and using a Kubernetes secret store, the field `auth.SecretStore` defaults to `kubernetes` and can be left empty.
The above component definition tells Dapr to extract a secret named `redis-secret` from the defined `secretStore` and assign the value of the `redis-password` key embedded in the secret to the `redisPassword` field in the component.
The above component definition tells Dapr to extract a secret named `redis-secret` from the defined `secretStore` and assign the value associated with the `redis-password` key embedded in the secret to the `redisPassword` field in the component.
On the other hand, the below Special Case applies when there is NOT a key embedded in the secret. Rather, the secret is just a string. Therefore, in the `secretKeyRef` section both the secret `name` and the secret `key` will be identical. This is the case when the secret is an entire connection string with no embedded key whose value needs to be extracted. This Special Case is shown in the below component definition yaml.
On the other hand, the below Special Case applies when there is NOT a key embedded in the secret. Rather, the secret is just a string. Therefore, in the `secretKeyRef` section both the secret `name` and the secret `key` will be identical. This is the case when the secret is an entire connection string with no embedded key whose value needs to be extracted. Typically a connection string consists of connection information, some sort of secret to allow connection, plus perhaps other information and does not require a separate "secret". This Special Case is shown in the below component definition yaml.
```yml
apiVersion: dapr.io/v1alpha1
@ -88,7 +88,7 @@ auth:
secretStore: <SECRET_STORE_NAME>
```
The above Special Case yaml tells Dapr to extract a secret named `asbNsConnstring` from the defined `secretStore` and assign the value of secret to the `connectionString` field in the component since there is no key embedded in the secret because it is a plain string. This requires the secret `name` and secret `key` to be identical.
The above Special Case yaml tells Dapr to extract a connection string named `asbNsConnstring` from the defined `secretStore` and assign the value to the `connectionString` field in the component since there is no key embedded in the "secret" from the `secretStore` because it is a plain string. This requires the secret `name` and secret `key` to be identical.
## Example