Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@gojob/nest-cloud-datastore
Advanced tools
Cloud Datastore module for Nestjs
yarn add @gojob/nest-cloud-datastore
# or
npm install @gojob/nest-cloud-datastore
If you use the default configuration of GCP client libraries, just import the module CloudDatastoreModule
as-is.
Otherwise, the configuration passed to the constructor of Datastore can be customized in two ways:
forRoot
:import { CloudDatastoreModule, DatastoreModuleAsyncOptions } from '@gojob/nest-cloud-datastore';
const datastoreModule = CloudDatastoreModule.forRoot({ keyFile: configService.get('GCP_KEY_FILE_DATASTORE') });
export default datastoreModule;
forRootAsync
, for configuration object built dynamically:import { CloudDatastoreModule, DatastoreModuleAsyncOptions } from '@gojob/nest-cloud-datastore';
import { ConfigModule } from '../config/config.module';
import { ConfigService } from '../config/config.service';
const moduleConfig: DatastoreModuleAsyncOptions = {
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({ keyFile: configService.get('GCP_KEY_FILE_DATASTORE') }),
};
const datastoreModule = CloudDatastoreModule.forRootAsync(moduleConfig);
export default datastoreModule;
Once the module imported, CloudDatastoreService
is made available in the injection scope.
Have a look at src/cloud-datastore.integration-test.ts
to see the methods available.
Thanks to the Docker image google/cloud-sdk
including an emulator, testing the integration of your features with Cloud Datastore is pretty straightforward. Download docker-compose.yml
from this git repository, then:
docker-compose up -d # run the emulator
curl localhost:8081 # ensure the emulator is available
# run your tests, with the following environment variables:
# DATASTORE_EMULATOR_HOST=localhost:8081
# DATASTORE_PROJECT_ID=datastore-testing
A helper class DatastoreEmulator
is provided in this package, in order to easily:
reset
)removeDatastoreKeyProp
)createEntity
, createEntities
)getAll
)Examples of tests are available src/cloud-datastore.integration-test.ts
.
yarn install
yarn build
docker-compose up -d # start the Cloud Datastore emulator
yarn integration
docker-compose down
FAQs
Cloud Datastore module for Nestjs
We found that @gojob/nest-cloud-datastore demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.