azure-keyvault-emulator
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

License NPM version Downloads
Build Status

npm install -g azure-keyvault-emulator@latest

Requires node of version later than 8.12.0

Summary

A emulation utility for faking the Azure KeyVault.
Azure doesn't support you accessing the KeyVault from another AD account then the Vault is hosted,
however sometimes you might want that. Or at least host an open source repository without sharing your api-keys with the world.

Usage

To use the module you simply install this npm module globally and run azure-keyvault-emulator start.
After you've started the server you can register json files that can be used to fake a subscribtion in Azure.

You do this by running azure-keyvault-emulator subscribe {subscribtionName} {filePath},
after you do this the secrets of the file can be read by navigating to "http://localhost:10003/secrets/{subscribtionName}/{keyName}".
This endpoint will expose a json model like Azure KeyVault does.
The filePath has to point to a json file specced according to the SubscribtionFile type definition; basically meaning that it should contain a list of properties pointing to a string or an object.
The reference will not be loaded in memory untill every request so you do not need to issue the subscribe command again after you edit the file.

You can issue the subscribe command for existing files without consequense so you can add this to your pre-build steps for example.

<Target 
    Name="RegisterKeyVaultSecret" 
    BeforeTargets="PreBuildEvent" 
    Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
 
    <Exec Command="azure-keyvault-emulator subscribe &quot;$(ProjectName)&quot; &quot;$(ProjectDir)secrets.json&quot;" />
</Target>
 
<Target 
    Name="StartKeyVaultEmulator" 
    BeforeTargets="PostBuildEvent" 
    Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
 
    <Exec Command="azure-keyvault-emulator start" />
</Target>

For a more detailed view of the commands see the Command reference.

Contributing

See the Contribution guide for help about contributing to this project.

Changelog

See the Changelog to see the change history.

Package Sidebar

Install

npm i azure-keyvault-emulator

Weekly Downloads

3

Version

1.0.5

License

Apache-2.0

Unpacked Size

92 kB

Total Files

64

Last publish

Collaborators

  • marvin-brouwer