How to use the ms-rest-azure.KeyVaultCredentials function in ms-rest-azure

To help you get started, we’ve selected a few ms-rest-azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-node / lib / services / keyVault / lib / keyVault.js View on Github external
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;
  }
github Azure / azure-sdk-for-node / test / services / keyVault / keyVault-storage-tests.js View on Github external
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();
    });
  });