From 830e6ab54a5109e9c9a6a94a59951e823cecce37 Mon Sep 17 00:00:00 2001 From: mikiodehartj1 <113941652+mikiodehartj1@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:44:34 -0600 Subject: [PATCH 1/2] adding raw data field --- .vscode/settings.json | 5 +++++ src/steps/secret-manager/converters.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..b242572e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] +} \ No newline at end of file diff --git a/src/steps/secret-manager/converters.ts b/src/steps/secret-manager/converters.ts index 1e3fdf05..de63d446 100644 --- a/src/steps/secret-manager/converters.ts +++ b/src/steps/secret-manager/converters.ts @@ -22,6 +22,12 @@ export function createSecretEntity(data: secretmanager_v1.Schema$Secret) { rotationPeriod: data.rotation?.rotationPeriod, topicNames: data.topics?.map((t) => t.name!), ttl: data.ttl, + 'replication.automatic.customerManagedEncryption.kmsKeyName': + data.replication?.automatic?.customerManagedEncryption?.kmsKeyName, + 'replication.userManaged.replicas.location': + data.replication?.userManaged?.replicas + ?.filter((replica) => typeof replica.location === 'string') + .map((replica) => replica.location || ''), }, }, }); From a2ec42ffe8d7eaa1354f300ad2b99456236c03ce Mon Sep 17 00:00:00 2001 From: Gaston Yelmini Date: Tue, 4 Jun 2024 16:06:08 -0300 Subject: [PATCH 2/2] Fix tests --- .vscode/settings.json | 5 ----- .../secret-manager/__snapshots__/converters.test.ts.snap | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index b242572e..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "githubPullRequests.ignoredPullRequestBranches": [ - "main" - ] -} \ No newline at end of file diff --git a/src/steps/secret-manager/__snapshots__/converters.test.ts.snap b/src/steps/secret-manager/__snapshots__/converters.test.ts.snap index 071bd6d2..9ed5d49d 100644 --- a/src/steps/secret-manager/__snapshots__/converters.test.ts.snap +++ b/src/steps/secret-manager/__snapshots__/converters.test.ts.snap @@ -23,6 +23,8 @@ exports[`#createSecretEntity should convert to entity 1`] = ` "expiresAt": undefined, "name": "sample-secret-name", "nextRotationTime": undefined, + "replication.automatic.customerManagedEncryption.kmsKeyName": undefined, + "replication.userManaged.replicas.location": undefined, "rotationPeriod": undefined, "topicNames": undefined, "ttl": undefined, @@ -53,6 +55,8 @@ exports[`#createSecretVersionEntity should convert to entity 1`] = ` "expiresAt": undefined, "name": "projects/j1-gc-integration-dev-v3/secrets/sample-secret-name/versions/1", "nextRotationTime": undefined, + "replication.automatic.customerManagedEncryption.kmsKeyName": undefined, + "replication.userManaged.replicas.location": undefined, "rotationPeriod": undefined, "topicNames": undefined, "ttl": undefined,