0.4.0 • Published 12 months ago

nestjs-gcloud-secret-manager v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Summary

Google Cloud Secret Manager module for Nest.js

Installation

$ yarn add nestjs-gcloud-secret-manager

Examples

Setup

import { Module } from '@nestjs/common';
import { SecretManagerModule } from 'nestjs-gcloud-secret-manager';

@Module({
  imports: [
    /**
     * secrets are loaded to `SecretManagerService` when SecretManagerModule bootstrapped
     */
    SecretManagerModule.forRoot({
      projectId,
      credentials
    })
  ],
})
export class AppModule {}

using secret manager service

import { Injectable } from '@nestjs/common';
import { SecretManagerService } from 'nestjs-gcloud-secret-manager';

@Injectable()
export class AppService {
    constructor(private readonly secretManagerService: SecretManagerService) {}
    async getSecret() {
        this.secretManagerService.get(SECRET_NAME);
    }
}

using secret manager client

Functions such as creation have not yet been implemented. If you want to extend the functionality, use client as it is.

import { Inject } from '@nestjs/common';
import { CLIENT_INSTANCE, SecretManagerClient } from 'nestjs-gcloud-secret-manager';

export class AppService {
  constructor(@Inject(CLIENT_INSTANCE) private readonly client: SecretManagerClient) {}
}
0.3.0

1 year ago

0.1.2

1 year ago

0.3.2

1 year ago

0.4.0

12 months ago

0.3.1

1 year ago

0.2.2

1 year ago

0.3.3

1 year ago

0.1.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago