Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A loopback-next extension for HashiCorp's Vault integration in loopback-next applications

License

NotificationsYou must be signed in to change notification settings

sourcefuse/loopback4-vault

ARC By SourceFuse logo

npm versionSonar Quality GateSynk StatusGitHub contributorsdownloadsLicensePowered By LoopBack 4

Overview

A simple loopback-next extension for Hashicorp'sVault integration in loopback applications based on node.js vault clientnode-vault.

Install

npm install @sourceloop/vault

Usage

In order to use this component into your LoopBack application, please follow below steps.

  • Add component to application and provide vault endpoint, vault token and unseal key viaVaultSecurityBindings.
this.component(VaultComponent);this.bind(VaultSecurityBindings.CONFIG).to({endpoint:process.env.VAULT_URL,token:process.env.VAULT_TOKEN,unsealKey:process.env.VAULT_UNSEAL_KEY,});
  • After this, you can just inject theVaultSecurityBindings.VAULT_CONNECTOR across application.
@inject(VaultSecurityBindings.VAULT_CONNECTOR)privatereadonlyvaultConnector:VaultConnect,

All the methods mentionedhere are now available onvaultConnector.

Here is an example usage below

privateasyncupsertKeyToVault(credKey: string):Promise<{data:AnyObject}>{letdata:{data:AnyObject};try{data=awaitthis.vaultConnector.read(credKey);}catch(error){if(error.response.statusCode===404){awaitthis.vaultConnector.write(credKey,{empty:true});data=awaitthis.vaultConnector.read(credKey);}else{this.logger.error(error);throwerror;}}returndata;}
  • If you need to update vault token or any other connection parameters, there is areconnect(config: VaultProviderOptions) function available to do so. Whatever new config parameters are needed, you can pass those and leave the unchanged ones out of the config. It will only update the new ones keeping the existing ones intact and will reconnect with vault again. Please note that this may cause disconnection with your existing vault data if you change the endpoints here.

Feedback

If you've noticed a bug or have a question or have a feature request,search the issue tracker to see if someone else in the community has already created a ticket.If not, go ahead andmake one!All feature requests are welcome. Implementation time may vary. Feel free to contribute the same, if you can.If you think this extension is useful, pleasestar it. Appreciation really helps in keeping this project alive.

Contributing

Please readCONTRIBUTING.md for details on the process for submitting pull requests to us.

Code of conduct

Code of conduct guidelineshere.

License

MIT

About

A loopback-next extension for HashiCorp's Vault integration in loopback-next applications

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors17


[8]ページ先頭

©2009-2025 Movatter.jp