This endpoint lets you get the value of a secret for a given secret store.
GET http://localhost:<daprPort>/v1.0/secrets/<secret-store-name>/<name>| Parameter | Description |
|---|---|
| daprPort | the Dapr port |
| secret-store-name | the name of the secret store to get the secret from |
| name | the name of the secret to get |
Note, all URL parameters are case-sensitive.
Some secret stores have optional metadata properties. metadata is populated using query parameters:
GET http://localhost:<daprPort>/v1.0/secrets/<secret-store-name>/<name>?metadata.version_id=15The following optional meta can be provided to the GCP Secret Manager component
| Query Parameter | Description |
|---|---|
| metadata.version_id | version for the given secret key |
The following optional meta can be provided to the AWS Secret Manager component
| Query Parameter | Description |
|---|---|
| metadata.version_id | version for the given secret key |
| metadata.version_stage | version stage for the given secret key |
If a secret store has support for multiple keys in a secret, a JSON payload is returned with the key names as fields and their respective values.
In case of a secret store that only has name/value semantics, a JSON payload is returned with the name of the secret as the field and the value of the secret as the value.
curl http://localhost:3500/v1.0/secrets/kubernetes/db-secret{
"key1": "value1",
"key2": "value2"
}curl http://localhost:3500/v1.0/secrets/vault/db-secret{
"db-secret": "value1"
}| Code | Description |
|---|---|
| 200 | OK |
| 204 | Secret not found |
| 400 | Secret store is missing or misconfigured |
| 500 | Failed to get secret |
curl http://localhost:3500/v1.0/secrets/vault/db-secret \curl http://localhost:3500/v1.0/secrets/vault/db-secret?metadata.version_id=15&metadata.version_stage=AAA \