https://github.com/visualjeff/hapi-azure-msi-vault-plugin
A Hapi v18 Azure MSI Vault plugin
https://github.com/visualjeff/hapi-azure-msi-vault-plugin
azure hapi identities managed msi plugin vault
Last synced: about 1 month ago
JSON representation
A Hapi v18 Azure MSI Vault plugin
- Host: GitHub
- URL: https://github.com/visualjeff/hapi-azure-msi-vault-plugin
- Owner: visualjeff
- License: mit
- Created: 2019-06-10T03:47:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T05:43:07.000Z (about 3 years ago)
- Last Synced: 2025-10-06T01:45:58.139Z (5 months ago)
- Topics: azure, hapi, identities, managed, msi, plugin, vault
- Language: JavaScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About hapi-azure-msi-vault-plugin
Tested successfully against Azure with Hapi v18.
[](https://travis-ci.org/visualjeff/hapi-azure-msi-plugin)
## Install:
```
npm install hapi-azure-msi-vault-plugin --save
```
## Prerequistes:
Setup an Azure Vault:
[https://azure.microsoft.com/en-us/resources/samples/key-vault-node-getting-started/](https://azure.microsoft.com/en-us/resources/samples/key-vault-node-getting-started/)
## Usage:
```js
'use strict';
const Hapi = require('@hapi/hapi');
const server = new Hapi.Server({
host: '0.0.0.0',
port: process.env.PORT || 1337
});
const startup = async () => {
await server.register([
{
plugin: require('hapi-azure-msi-vault-plugin'),
options: {
kvUri: 'https://<>.vault.azure.net/'
}
}
]);
await server.start();
};
startup().catch((err) => {
throw err;
});
console.log(`${new Date()}: server running at ${server.info.uri}`);
```
## How to fetch a secret:
```js
server.app.vault('myAppSecret', 'myAppSecretVersion').then(secret => {
console.log('secret: ', secret)
});
```