# @amplication/plugin-secrets-manager-hashicorp-vault

> Amplication plugin for HashiCorp Vault

Latest version **1.0.1** (published 2023-12-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @amplication/plugin-secrets-manager-hashicorp-vault
pnpm add @amplication/plugin-secrets-manager-hashicorp-vault
yarn add @amplication/plugin-secrets-manager-hashicorp-vault
bun add @amplication/plugin-secrets-manager-hashicorp-vault
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-12-28 |
| First published | 2023-11-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | easedeath |
| Maintainers | amplication-bot, mulygottlieb, levivannoort, overbit, barshimi, morhag, amitbarletz, yuvalhazaz |

## Links

- npm: https://www.npmjs.com/package/@amplication/plugin-secrets-manager-hashicorp-vault
- npm.io page: https://npm.io/package/@amplication/plugin-secrets-manager-hashicorp-vault

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [ast-types](https://npm.io/package/ast-types.md) ^0.14.2
- [@amplication/code-gen-types](https://npm.io/package/@amplication/code-gen-types.md) ^2.0.20
- [@amplication/code-gen-utils](https://npm.io/package/@amplication/code-gen-utils.md) ^0.0.7

## Recent versions

- 1.0.1 (latest) — 2023-12-28
- 1.0.4-beta.pr-354.1e83d71 (beta) — 2024-03-12
- 1.0.4-beta.pr-354.31d30ce — 2024-03-12
- 1.0.3 — 2024-03-08
- 1.0.2 — 2024-03-08
- 1.0.0 — 2023-11-29

## README

# @amplication/plugin-secrets-manager-hashicorp-vault

[![NPM Downloads](https://img.shields.io/npm/dt/@amplication/plugin-secrets-manager-hashicorp-vault)](https://www.npmjs.com/package/@amplication/plugin-secrets-manager-hashicorp-vault)

Amplication plugin that allows easy management of secrets by using HashiCorp Vault.

## Purpose

This purpose of this plugin is to easily and securely use secrets from HashiCorp Vault.

## Configuration

### Plugin Fetch Mode

The plugins are fetched by two methods:

- `STARTUP` - In this method, the plugins are fetched during the startup time (Initially loaded).
- `ON_DEMAND` - In this method, the plugins are fetched during the runtime (Loaded when the secrets are needed).

You need to define also a property named `secretNames` that will contain a list of the secrets that the service needs to interact with (see below for the formatting of the secret name).

Example:

```json
"fetchMode": "STARTUP",
"secretNames": [
    "/path/common",
    "/path/path1:SecretA",
    "/path/path2:SecretB",
    "/path/path2/path3:SecretC"
]

```

### Plugin auth mode

The plugin allows authentication by two methods:

- By using root token

  If you want to authenticate by using Root token, choose the `authMode` as `TOKEN`.
  To use this authentication mode, you need to set your root token inside of the `.env` file

- By using app role

  If you want to use AppRole mode, choose the `authMode` as `APPROLE`.
  To use this authentication mode, you need to set your Role Id and the Secret Id inside of the `.env` file

Example:

```json
"authMode": "APPROLE/TOKEN",
```

## Secret name format

The secret name must be formatted in either of the following way:

- `<secret_path>:<secret_name>` - This format specifies that a single secret named `secret_name` needs to be loaded from the `secret_path` path [applies to both fetch mode].
- `<secret_path>` - This format specifies that all the secrets that are in the `secret_path` needs to be loaded [only applies to `STARTUP` fetch mode].

## Usage

To use this plugin:

1. Enable the plugin in your Amplication app.
2. If you are using `AppRole` method, enable the AppRole access mode in dashboard.
3. Create ACL policy for the secrets and attach the policy to the AppRole method.

This plugin will override your default implementation for `SecretsManagerService` to use the secrets from HashiCorp Vault

## Scripts

### `build`

Running `npm run build` will bundle your plugin with Webpack for production.

### `dev`

Running `npm run dev` will watch your plugin's source code and automatically bundle it with every change.

---
_Source: https://npm.io/package/@amplication/plugin-secrets-manager-hashicorp-vault · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
