Skip to content

Commit

Permalink
fix(rules): add GCP Datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Aug 7, 2023
1 parent 521dc76 commit 849a31c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/common/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const list: TechItem[] = [
{ key: 'gcp', name: 'GCP', type: 'hosting' },
{ key: 'gcp.bigquery', name: 'Big Query', type: 'db' },
{ key: 'gcp.bigtable', name: 'Big Table', type: 'db' },
{ key: 'gcp.datastore', name: 'Datastore', type: 'db' },
{ key: 'gcp.cloudrun', name: 'Cloud Run', type: 'hosting' },
{ key: 'gcp.pubsub', name: 'PubSub', type: 'messaging' },
{ key: 'gcp.gce', name: 'Compute Engine', type: 'hosting' },
Expand Down
13 changes: 13 additions & 0 deletions src/rules/db/gcp.datastore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { register } from '../../rules.js';

register({
tech: 'gcp.datastore',
dependencies: [
{ type: 'npm', name: '@google-cloud/datastore' },
{
type: 'terraform.resource',
name: 'google_datastore_index',
},
{ type: 'ruby', name: 'google-cloud-datastore' },
],
});
5 changes: 3 additions & 2 deletions src/rules/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import './couchbase.js';
import './elasticsearch.js';
import './gcp.bigquery.js';
import './gcp.bigtable.js';
import './gcp.datastore.js';
import './gcp.sql.js';
import './hashicorp_vault.js';
import './influxdb.js';
import './mariadb.js';
import './memcached.js';
Expand All @@ -15,6 +17,5 @@ import './neo4j.js';
import './percona.js';
import './postgres.js';
import './redis.js';
import './sqlite.js';
import './snowflake.js';
import './hashicorp_vault.js';
import './sqlite.js';
1 change: 1 addition & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ exports[`npm > should match everything 1`] = `
"gcp.bigquery",
"gcp.bigtable",
"gcp.cloudrun",
"gcp.datastore",
"gcp.gce",
"gcp.gcs",
"gcp.pubsub",
Expand Down
10 changes: 8 additions & 2 deletions src/rules/spec/ruby/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ Set {
"gcp",
"gcp.bigquery",
"gcp.bigtable",
"gcp.datastore",
"gcp.sql",
"hashicorp_vault",
"influxdb",
"mariadb",
"memcached",
"mongodb",
"mysql",
"postgresql",
"redis",
"sqlite",
"snowflake",
"hashicorp_vault",
"sqlite",
"aws.s3",
"azure",
"fastly",
Expand Down Expand Up @@ -174,6 +175,11 @@ exports[`ruby (component) > should match everything 2`] = `
"google-cloud-compute",
"1.0.0",
],
[
"ruby",
"google-cloud-datastore",
"1.0.0",
],
[
"ruby",
"google-cloud-pubsub",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/spec/rust/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Set {
"elasticsearch",
"gcp",
"gcp.bigquery",
"hashicorp_vault",
"influxdb",
"memcached",
"mongodb",
"mysql",
"postgresql",
"redis",
"sqlite",
"snowflake",
"hashicorp_vault",
"sqlite",
"aws.s3",
"azure",
"fastly",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"gcp.bigquery",
"gcp.bigtable",
"gcp.cloudrun",
"gcp.datastore",
"gcp.gce",
"gcp.gcs",
"gcp.gke",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type AllowedKeys =
| 'gcp.bigquery'
| 'gcp.bigtable'
| 'gcp.cloudrun'
| 'gcp.datastore'
| 'gcp.gce'
| 'gcp.gcs'
| 'gcp.gke'
Expand Down

0 comments on commit 849a31c

Please sign in to comment.