Skip to content

Commit

Permalink
fix(rules): add GCP KMS
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 7, 2023
1 parent 2bfbdc4 commit acea79b
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ exports[`all > should match everything 1`] = `
"gcp.gce",
"gcp.gcs",
"gcp.gke",
"gcp.kms",
"gcp.language",
"gcp.maps",
"gcp.pubsub",
Expand Down
22 changes: 22 additions & 0 deletions src/rules/api/gcp.kms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { register } from '../../register.js';

register({
tech: 'gcp.kms',
name: 'Google Key Management',
type: 'api',
dependencies: [
{ type: 'npm', name: '@google-cloud/kms' },
{
type: 'terraform.resource',
name: /^google_kms_/,
example: 'google_kms_crypto_key',
},
{
type: 'ruby',
name: /^google-cloud-kms/,
example: 'google-cloud-kms-v1',
},
{ type: 'golang', name: 'cloud.google.com/go/kms' },
{ type: 'php', name: 'google/cloud-kms' },
],
});
1 change: 1 addition & 0 deletions src/rules/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './gcp.aiplatform.js';
import './gcp.dialogflow.js';
import './gcp.kms.js';
import './gcp.language.js';
import './gcp.maps.js';
import './gcp.speech.js';
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`golang (lockfile) > should match everything 1`] = `
"gcp.functions",
"gcp.gce",
"gcp.gcs",
"gcp.kms",
"gcp.language",
"gcp.maps",
"gcp.pubsub",
Expand Down Expand Up @@ -88,6 +89,11 @@ exports[`golang (lockfile) > should match everything 2`] = `
"cloud.google.com/go/functions",
"v1.0.0",
],
[
"golang",
"cloud.google.com/go/kms",
"v1.0.0",
],
[
"golang",
"cloud.google.com/go/language",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ exports[`npm > should match everything 1`] = `
"gcp.functions",
"gcp.gce",
"gcp.gcs",
"gcp.kms",
"gcp.language",
"gcp.maps",
"gcp.pubsub",
Expand Down Expand Up @@ -353,6 +354,11 @@ exports[`npm > should match everything 2`] = `
"@google-cloud/functions-framework",
"0.0.0",
],
[
"npm",
"@google-cloud/kms",
"0.0.0",
],
[
"npm",
"@google-cloud/language",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/php/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exports[`php > should match everything 1`] = `
"gcp.functions",
"gcp.gce",
"gcp.gcs",
"gcp.kms",
"gcp.language",
"gcp.pubsub",
"gcp.secretmanager",
Expand Down Expand Up @@ -371,6 +372,11 @@ exports[`php > should match everything 2`] = `
"google/cloud-functions-framework",
"0.0.0",
],
[
"php",
"google/cloud-kms",
"0.0.0",
],
[
"php",
"google/cloud-language",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ exports[`ruby (component) > should match everything 1`] = `
"gcp.functions",
"gcp.gce",
"gcp.gcs",
"gcp.kms",
"gcp.language",
"gcp.maps",
"gcp.pubsub",
Expand Down Expand Up @@ -303,6 +304,11 @@ exports[`ruby (component) > should match everything 2`] = `
"google-cloud-functions-v1",
"1.0.0",
],
[
"ruby",
"google-cloud-kms-v1",
"1.0.0",
],
[
"ruby",
"google-cloud-language-v1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"gcp.gce",
"gcp.gcs",
"gcp.gke",
"gcp.kms",
"gcp.maps",
"gcp.pubsub",
"gcp.secretmanager",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export type AllowedKeys =
| 'gcp.gce'
| 'gcp.gcs'
| 'gcp.gke'
| 'gcp.kms'
| 'gcp.language'
| 'gcp.maps'
| 'gcp.pubsub'
Expand Down

0 comments on commit acea79b

Please sign in to comment.