Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(credentials, options) {
// convert credentials to KeyVaultCredentials if needed
let keyVaultCredentials = credentials;
if (!(_isKeyVaultCredentials(credentials))) {
keyVaultCredentials = new msRestAzure.KeyVaultCredentials(null, credentials);
}
// create and add new custom filter before calling super()
if (keyVaultCredentials.createSigningFilter) {
if (!options) options = [];
if (!options.filters) options.filters = [];
options.filters.push(keyVaultCredentials.createSigningFilter());
}
// ServiceClient constructor adds filter to the pipeline
super(keyVaultCredentials, options);
this._getPendingCertificateSigningRequest = _getPendingCertificateSigningRequest;
}
suite.setupSuite(function () {
akvClient = new KeyVault.KeyVaultClient(new msRestAzure.KeyVaultCredentials(null, suite.credentials));
kvManagementClient = new KeyVaultManagementClient(suite.credentials, suite.subscriptionId);
storageMgmtClient = new StorageManagementClient(suite.credentials, suite.subscriptionId);
acclocation = process.env['AZURE_TEST_LOCATION'];
if (!suite.isPlayback && !process.env['AZURE_PASSWORD']) {
throw new Error('AKV storage test recording requires user credentials');
}
if (suite.isPlayback) {
kvManagementClient.longRunningOperationRetryTimeout = 0;
storageMgmtClient.longRunningOperationRetryTimeout = 0;
}
done();
});
});