1.0.1 • Published 1 year ago

@hilma/secrets-handler v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

secrets-handler

This package handles the projects secrets and gets the secrets from env file or from aws

secrets-handler is a package for getting secrets, from an env file or from aws secrets manager.

Installation

$ npm i @hilma/secrets-handler

Setup

in app module change forRoot => forRootAsync

for connector(db) secrets you should follow this syntax:

ALIAS_HOST ALIAS_PORT ALIAS_PASSWORD ALIAS_ENGINE ALIAS_USER ALIAS_SECRET_NAME

in tsconfig file add:

“include”: “node_modules/@hilma/secrets_handler”, “src”

If types are not visible:

Restart ts server or enter node_modules/@hilma/secrets_handler/secrets_handler.d.ts

Usage

call getSecrets with an array, according to the table below.

Array type for getSecrets

key/svalue/ typeof valuewhat for
objType requiredconnector - for databases unknown - for singleton secretpreknown - for preknown valuesto determine the type of the secret and get it accordingly.
name requiredstringthe name refering to the object in the code.privateSecretname
aliasrequiredstringshort string that precedes env variables names. ex: DB_NAME and DB_SECRET_NAME - "DB" is the alias
envNamerequired for objType unknownarray containing names of the wanted aliases from the envTo get them from the env filedatabase informationUse in cases when the key is not in the env file or you want to override it.
valuerequired for objType preknownobject. key: string, value: any.for secrets that do not have data in the env file.
port, engine, host, dbname, username, paswordoptional for objType connectorstring / numberhard coded data for your db connection
1.0.1

1 year ago

1.0.0-beta.0.9

2 years ago

1.0.0-beta.0.8

2 years ago

1.0.0

2 years ago

1.0.0-beta.0.6

2 years ago

1.0.0-beta.0.5

2 years ago

1.0.0-beta.0.4

2 years ago

1.0.0-beta.0.3

2 years ago

1.0.0-beta.0.2

2 years ago

1.0.0-beta.0.1

2 years ago