Skip to content

Commit

Permalink
Merge pull request #82 from imranalisyed506/im-cx-change2
Browse files Browse the repository at this point in the history
Remove request and request-promise-native api dependency and integrate axios changes
  • Loading branch information
rakhimundhada15 authored Aug 21, 2023
2 parents 5a04e9c + 8f51962 commit 6b81a6b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ exports.handler = function(event, context) {
if (process.env.azollect_api && !process.env.azcollect_api) {
process.env.collector_id = 'NA';
process.env.azcollect_api = process.env.azollect_api;
process.env.collector_status_api = process.env.azcollect_api;
}

const collector = new cweCollector(
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "al-cwe-collector",
"version": "1.3.18",
"version": "1.3.19",
"license": "MIT",
"description": "Alert Logic CloudWatch Events Collector",
"repository": {
Expand All @@ -21,26 +21,24 @@
}
],
"devDependencies": {
"aws-sdk": "^2.929.0",
"aws-sdk": "^2.1434.0",
"aws-sdk-mock": "^5.8.0",
"clone": "^2.1.2",
"dotenv": "^16.0.3",
"jshint": "^2.9.5",
"dotenv": "^16.3.1",
"jshint": "^2.13.6",
"mocha": "^10.2.0",
"mocha-jenkins-reporter": "^0.4.8",
"nyc": "^15.1.0",
"rewire": "^6.0.0",
"sinon": "^15.0.1"
"sinon": "^15.2.0"
},
"dependencies": {
"@alertlogic/al-aws-collector-js": "^4.1.14",
"@alertlogic/al-collector-js": "^3.0.5",
"@alertlogic/al-aws-collector-js": "4.1.20",
"@alertlogic/al-collector-js": "3.0.9",
"async": "^3.2.4",
"cfn-response": "^1.0.1",
"debug": "^4.1.1",
"moment": "^2.19.2",
"request": "^2.88.0",
"request-promise-native": "^1.0.7"
"debug": "^4.3.4",
"moment": "^2.29.4"
},
"author": "Alert Logic Inc."
}
9 changes: 8 additions & 1 deletion test/al-cwe-collector_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ function setAlServiceStub() {
azcollect: 'new-azcollect-endpoint'
};
break;
case '/residency/default/services/collector_status/endpoint':
ret = {
collector_status: 'new-collectors-status-endpoint'
};
break;
default:
break;
}
Expand Down Expand Up @@ -69,10 +74,12 @@ function mockSetEnvStub() {
setEnvStub = sinon.stub(m_al_aws, 'setEnv').callsFake((vars, callback) => {
const {
ingest_api,
azcollect_api
azcollect_api,
collector_status_api
} = vars;
process.env.ingest_api = ingest_api ? ingest_api : process.env.ingest_api;
process.env.azollect_api = azcollect_api ? azcollect_api : process.env.azollect_api;
process.env.collector_status_api = collector_status_api ? collector_status_api : process.env.collector_status_api;
const returnBody = {
Environment: {
Varaibles: vars
Expand Down
1 change: 1 addition & 0 deletions test/cwe_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ process.env.AWS_LAMBDA_FUNCTION_NAME = 'test-function-name';
process.env.al_api = 'api.global-services.global.alertlogic.com';
process.env.ingest_api = 'ingest.global-services.global.alertlogic.com';
process.env.azollect_api = 'azcollect.global-services.global.alertlogic.com';
process.env.collector_status_api = 'azcollect.global-services.global.alertlogic.com';
process.env.collector_id = 'collector-id';
process.env.al_application_id = 'guardduty';

Expand Down

0 comments on commit 6b81a6b

Please sign in to comment.