Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log("Rest Error: ", e.message);
} else {
throw e;
}
}
// The client can also be configured using a a customized Pipeline. This allows control
// over the request policy factories( for example, adding your own RequestPolicyFactory),
// as well as providng a custom-implementation of HTTP Client.
// This is a more advanced scenario. For more information, see
// https://github.com/Azure/ms-rest-js/blob/master/docs/architectureOverview.md
const customPipeline: Pipeline = {
requestPolicyFactories: [
deserializationPolicy(),
exponentialRetryPolicy(),
signingPolicy(credential),
]
};
const client2 = new SecretsClient(url, credential, customPipeline);
for await (const version of client2.getSecretVersions(secretName)) {
const secret = await client2.getSecret(secretName, { version: version.version });
console.log("secret: ", secret);
}
await client.deleteSecret(secretName);
}
const requestPolicyFactories: RequestPolicyFactory[] = [
proxyPolicy(getDefaultProxySettings((pipelineOptions.proxyOptions || {}).proxySettings)),
userAgentPolicy({ value: userAgentString }),
generateClientRequestIdPolicy(),
deserializationPolicy(), // Default deserializationPolicy is provided by protocol layer
throttlingRetryPolicy(),
systemErrorRetryPolicy(),
exponentialRetryPolicy(
retryOptions.retryCount,
retryOptions.retryIntervalInMS,
RetryConstants.MIN_RETRY_INTERVAL_MS, // Minimum retry interval to prevent frequent retries
retryOptions.maxRetryDelayInMs
),
redirectPolicy(),
signingPolicy(credential)
];
return {
httpClient: pipelineOptions.HTTPClient,
httpPipelineLogger: pipelineOptions.logger,
requestPolicyFactories
};
}
const requestPolicyFactories: RequestPolicyFactory[] = [
proxyPolicy(getDefaultProxySettings((pipelineOptions.proxyOptions || {}).proxySettings)),
userAgentPolicy({ value: userAgentString }),
generateClientRequestIdPolicy(),
deserializationPolicy(), // Default deserializationPolicy is provided by protocol layer
throttlingRetryPolicy(),
systemErrorRetryPolicy(),
exponentialRetryPolicy(
retryOptions.retryCount,
retryOptions.retryIntervalInMS,
RetryConstants.MIN_RETRY_INTERVAL_MS, // Minimum retry interval to prevent frequent retries
retryOptions.maxRetryDelayInMs
),
redirectPolicy(),
signingPolicy(credential)
];
return {
httpClient: pipelineOptions.HTTPClient,
httpPipelineLogger: pipelineOptions.logger,
requestPolicyFactories
};
}