Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static getDefaultPipeline(
credential: ServiceClientCredentials,
pipelineOptions: NewPipelineOptions = {}
): Pipeline {
// Order is important. Closer to the API at the top & closer to the network at the bottom.
// The credential's policy factory must appear close to the wire so it can sign any
// changes made by other factories (like UniqueRequestIDPolicyFactory)
const retryOptions = pipelineOptions.retryOptions || {};
const userAgentString: string = SecretsClient.getUserAgentString(pipelineOptions.telemetry);
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 {
public static getDefaultPipeline(
credential: ServiceClientCredentials,
pipelineOptions: NewPipelineOptions = {}
): Pipeline {
// Order is important. Closer to the API at the top & closer to the network at the bottom.
// The credential's policy factory must appear close to the wire so it can sign any
// changes made by other factories (like UniqueRequestIDPolicyFactory)
const retryOptions = pipelineOptions.retryOptions || {};
const userAgentString: string = KeysClient.getUserAgentString(pipelineOptions.telemetry);
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 {