Skip to content

Commit 89e9e1c

Browse files
authored
feat: proper secretstore registration fixes (#3952)
Signed-off-by: Samantha Coyle <[email protected]>
1 parent a47da8e commit 89e9e1c

File tree

7 files changed

+162
-12
lines changed

7 files changed

+162
-12
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: secretstores
4+
name: alicloud.parameterstore
5+
version: v1
6+
status: alpha
7+
title: "AliCloud OSS Parameter Store"
8+
urls:
9+
- title: Reference
10+
url: https://docs.dapr.io/reference/components-reference/supported-secret-stores/alicloud-oss-parameter-store/
11+
authenticationProfiles:
12+
- title: "Access Key Authentication"
13+
description: "Authenticate using AliCloud access key and secret."
14+
metadata:
15+
- name: regionId
16+
type: string
17+
required: true
18+
description: The AliCloud region ID.
19+
example: "cn-hangzhou"
20+
- name: accessKeyId
21+
type: string
22+
required: true
23+
description: The AliCloud access key ID.
24+
example: "access-key-id"
25+
- name: accessKeySecret
26+
type: string
27+
required: true
28+
description: The AliCloud access key secret.
29+
example: "access-key-secret"
30+
- name: securityToken
31+
type: string
32+
required: false
33+
description: The AliCloud security token for temporary credentials.
34+
example: "security-token"
35+
metadata:
36+
- name: version_id
37+
type: string
38+
required: false
39+
description: The version ID of the parameter to retrieve. If not specified, the latest version is used.
40+
example: "1"
41+
- name: path
42+
type: string
43+
required: false
44+
description: The path prefix for bulk operations. If not specified, root path (/) is used.
45+
example: "/myapp/"

secretstores/huaweicloud/csms/csms.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ type csmsSecretStore struct {
4848
}
4949

5050
type CsmsSecretStoreMetadata struct {
51-
Region string
52-
AccessKey string
53-
SecretAccessKey string
51+
Region string `json:"region"`
52+
AccessKey string `json:"accessKey"`
53+
SecretAccessKey string `json:"secretAccessKey"`
5454
}
5555

5656
// NewHuaweiCsmsSecretStore returns a new Huawei csms secret store.
@@ -114,7 +114,7 @@ func (c *csmsSecretStore) BulkGetSecret(ctx context.Context, req secretstores.Bu
114114
secret, err := c.GetSecret(ctx, secretstores.GetSecretRequest{
115115
Name: secretName,
116116
Metadata: map[string]string{
117-
versionID: latestVersion,
117+
versionID: latestVersion, // TODO: make this configurable
118118
},
119119
})
120120
if err != nil {
@@ -130,7 +130,7 @@ func (c *csmsSecretStore) BulkGetSecret(ctx context.Context, req secretstores.Bu
130130
// Get all secret names recursively.
131131
func (c *csmsSecretStore) getSecretNames(ctx context.Context, marker *string) ([]string, error) {
132132
request := &model.ListSecretsRequest{}
133-
limit := pageLimit
133+
limit := pageLimit // TODO: make this configurable
134134
request.Limit = &limit
135135
request.Marker = marker
136136

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: secretstores
4+
name: huaweicloud.csms
5+
version: v1
6+
status: alpha
7+
title: "HuaweiCloud CSMS"
8+
urls:
9+
- title: Reference
10+
url: https://docs.dapr.io/reference/components-reference/supported-secret-stores/huaweicloud-csms/
11+
authenticationProfiles:
12+
- title: "Access Key Authentication"
13+
description: "Authenticate using HuaweiCloud access key and secret."
14+
metadata:
15+
- name: region
16+
type: string
17+
required: true
18+
description: The HuaweiCloud region.
19+
example: "cn-north-4"
20+
- name: accessKey
21+
type: string
22+
required: true
23+
description: The HuaweiCloud access key.
24+
example: "access-key"
25+
- name: secretAccessKey
26+
type: string
27+
required: true
28+
description: The HuaweiCloud secret access key.
29+
example: "secret-access-key"
30+
metadata:
31+
- name: version_id
32+
type: string
33+
required: false
34+
description: The version ID of the secret to retrieve. If not specified, the latest version is used.
35+
example: "1"

secretstores/local/file/filestore.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import (
3131
)
3232

3333
type localSecretStoreMetaData struct {
34-
SecretsFile string
35-
NestedSeparator string
36-
MultiValued bool
34+
SecretsFile string `json:"secretsFile"`
35+
NestedSeparator string `json:"nestedSeparator"`
36+
MultiValued bool `json:"multiValued"`
3737
}
3838

3939
var _ secretstores.SecretStore = (*localSecretStore)(nil)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: secretstores
4+
name: local.file
5+
version: v1
6+
status: stable
7+
title: "Local File Secret Store"
8+
description: "Read secrets from a local JSON file for local development."
9+
urls:
10+
- title: Reference
11+
url: https://docs.dapr.io/reference/components-reference/supported-secret-stores/file-secret-store/
12+
metadata:
13+
- name: secretsFile
14+
type: string
15+
required: true
16+
description: Path to the JSON file containing secrets.
17+
example: "secrets.json"
18+
- name: nestedSeparator
19+
type: string
20+
required: false
21+
description: Separator used for nested keys in the JSON file.
22+
example: ":"
23+
default: ":"
24+
- name: multiValued
25+
type: bool
26+
required: false
27+
description: If true, enables multiple key-values per secret feature.
28+
example: false
29+
default: false
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# yaml-language-server: $schema=../../../component-metadata-schema.json
2+
schemaVersion: v1
3+
type: secretstores
4+
name: tencentcloud.ssm
5+
version: v1
6+
status: alpha
7+
title: "TencentCloud Secret Manager"
8+
urls:
9+
- title: Reference
10+
url: https://docs.dapr.io/reference/components-reference/supported-secret-stores/
11+
authenticationProfiles:
12+
- title: "Secret Key Authentication"
13+
description: "Authenticate using TencentCloud secret ID and key."
14+
metadata:
15+
- name: secretId
16+
type: string
17+
required: true
18+
description: The TencentCloud secret ID.
19+
example: "secret-id"
20+
- name: secretKey
21+
type: string
22+
required: true
23+
description: The TencentCloud secret key.
24+
example: "secret-key"
25+
- name: token
26+
type: string
27+
required: false
28+
description: The TencentCloud temporary token for temporary credentials.
29+
example: "token"
30+
- name: region
31+
type: string
32+
required: true
33+
description: The TencentCloud region.
34+
example: "ap-guangzhou"
35+
metadata:
36+
- name: VersionID
37+
type: string
38+
required: false
39+
description: The version ID of the secret to retrieve.
40+
example: "1"

secretstores/tencentcloud/ssm/ssm.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
)
3131

3232
const (
33+
// TODO: lowercase these and add to metadata struct eventually
3334
VersionID = "VersionID"
3435
RequestID = "RequestID"
3536
ValueType = "SecretValueType"
@@ -56,10 +57,10 @@ type ssmSecretStore struct {
5657
}
5758

5859
type SsmMetadata struct {
59-
SecretID string
60-
SecretKey string
61-
Token string
62-
Region string
60+
SecretID string `json:"secretId"`
61+
SecretKey string `json:"secretKey"`
62+
Token string `json:"token"`
63+
Region string `json:"region"`
6364
}
6465

6566
// NewSSM returns a new TencentCloud ssm secret store.

0 commit comments

Comments
 (0)