@azure/msal-node
Version:
Microsoft Authentication Library for Node
40 lines (37 loc) • 1.75 kB
JavaScript
/*! @azure/msal-node v3.4.1 2025-03-25 */
;
import { RequestParameterBuilder, UrlUtils, UrlString } from '@azure/msal-common/node';
import { MANAGED_IDENTITY_MAX_RETRIES, MANAGED_IDENTITY_RETRY_DELAY, MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON } from '../utils/Constants.mjs';
import { LinearRetryPolicy } from '../retry/LinearRetryPolicy.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class ManagedIdentityRequestParameters {
constructor(httpMethod, endpoint, retryPolicy) {
this.httpMethod = httpMethod;
this._baseEndpoint = endpoint;
this.headers = {};
this.bodyParameters = {};
this.queryParameters = {};
const defaultRetryPolicy = new LinearRetryPolicy(MANAGED_IDENTITY_MAX_RETRIES, MANAGED_IDENTITY_RETRY_DELAY, MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON);
this.retryPolicy = retryPolicy || defaultRetryPolicy;
}
computeUri() {
const parameters = new Map();
if (this.queryParameters) {
RequestParameterBuilder.addExtraQueryParameters(parameters, this.queryParameters);
}
const queryParametersString = UrlUtils.mapToQueryString(parameters);
return UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
}
computeParametersBodyString() {
const parameters = new Map();
if (this.bodyParameters) {
RequestParameterBuilder.addExtraQueryParameters(parameters, this.bodyParameters);
}
return UrlUtils.mapToQueryString(parameters);
}
}
export { ManagedIdentityRequestParameters };
//# sourceMappingURL=ManagedIdentityRequestParameters.mjs.map