Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const endpoint_service: string = this._service || this._options.service;
const creds = {
secret_key: credentials.secretAccessKey,
access_key: credentials.accessKeyId,
session_token: credentials.sessionToken,
};
const endpointInfo = {
region: endpoint_region,
service: endpoint_service,
};
const signerServiceInfo = Object.assign(endpointInfo, signerServiceInfoParams);
const signed_params = Signer.sign(otherParams, creds, signerServiceInfo);
if (signed_params.data) {
signed_params.body = signed_params.data;
}
logger.debug('Signed Request: ', signed_params);
delete signed_params.headers['host'];
return axios(signed_params)
.then(response => isAllResponse ? response : response.data)
.catch((error) => {
logger.debug(error);
throw error;
});
}
secret_key: credentials.secretAccessKey,
access_key: credentials.accessKeyId,
session_token: credentials.sessionToken,
};
const endpointInfo = {
region: endpoint_region,
service: endpoint_service,
};
const signerServiceInfo = Object.assign(
endpointInfo,
signerServiceInfoParams
);
const signed_params = Signer.sign(otherParams, creds, signerServiceInfo);
if (signed_params.data) {
signed_params.body = signed_params.data;
}
logger.debug('Signed Request: ', signed_params);
delete signed_params.headers['host'];
return axios(signed_params)
.then(response => (isAllResponse ? response : response.data))
.catch(error => {
logger.debug(error);
throw error;
});
}