Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyvault-configuration-resolver

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyvault-configuration-resolver - npm Package Compare versions

Comparing version 0.9.6 to 0.9.7

37

lib/index.js

@@ -118,12 +118,35 @@ //

if (!client) {
if (!options.clientId) {
throw new Error('Must provide an Azure Active Directory "clientId" value to the key vault resolver.');
let clientId = null;
let clientSecret = null;
let getClientCredentials = options.getClientCredentials;
if (!getClientCredentials) {
if (!options.clientId) {
throw new Error('Must provide an Azure Active Directory "clientId" value to the key vault resolver.');
}
if (!options.clientSecret) {
throw new Error('Must provide an Azure Active Directory "clientSecret" value to the key vault resolver.');
}
clientId = options.clientId;
clientSecret = options.clientSecret;
}
if (!options.clientSecret) {
throw new Error('Must provide an Azure Active Directory "clientSecret" value to the key vault resolver.');
}
const clientId = options.clientId;
const clientSecret = options.clientSecret;
const authenticator = (challenge, authCallback) => {
const context = new adalNode.AuthenticationContext(challenge.authorization);
// Support optional delayed secret resolution
if (getClientCredentials && (!clientId || !clientSecret)) {
try {
const ret = getClientCredentials();
if (ret) {
clientId = ret.clientId;
clientSecret = ret.clientSecret;
}
} catch (getClientCredentialsError) {
return authCallback(getClientCredentialsError);
}
if (!clientId || !clientSecret) {
return authCallback(new Error('After calling getClientCredentials, "clientId" and/or "clientSecret" remained unset. These values are required to authenticate with the vault.'));
}
}
return context.acquireTokenWithClientCredentials(challenge.resource, clientId, clientSecret, (tokenAcquisitionError, tokenResponse) => {

@@ -130,0 +153,0 @@ if (tokenAcquisitionError) {

2

package.json
{
"name": "keyvault-configuration-resolver",
"version": "0.9.6",
"version": "0.9.7",
"description": "Resolves custom keyvault:// URI values within an object graph using Azure KeyVault for Node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -121,2 +121,4 @@ # Azure KeyVault configuration secrets resolver

Alternatively, you can pass in a function called `getClientCredentials` that will be called when they are needed. `clientId` and `clientSecret` values are expected at this time.
### With an existing KeyVault credentials instance

@@ -123,0 +125,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc