-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support FIPS in endpoint heuristics (#3923)
- Loading branch information
Showing
11 changed files
with
4,450 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "bugfix", | ||
"category": "endpoint", | ||
"description": "Support FIPS in endpoint heuristics" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const test_cases = require('./test_cases.json'); | ||
const helpers = require('../../helpers'); | ||
const AWS = helpers.AWS; | ||
|
||
async function testApiCall(input) { | ||
const { clientName, region, signingRegion, hostname } = input; | ||
|
||
if (!AWS[clientName]) { | ||
throw new Error(`${clientName} does not exist`); | ||
} | ||
|
||
const client = | ||
clientName === 'IotData' | ||
? // requires an explicit `endpoint' configuration option. | ||
new AWS.IotData({ region, endpoint: 'endpoint' }) | ||
: new AWS[clientName]({ region }); | ||
|
||
const req = client[Object.keys(client.api.operations)[0]](); | ||
req.on('complete', () => { | ||
expect(region).to.equal(client.config.region); | ||
expect(signingRegion).to.equal(req.httpRequest.region); | ||
expect(hostname).to.equal(req.httpRequest.endpoint.host); | ||
}); | ||
|
||
try { | ||
await req.promise(); | ||
} catch (error) {} | ||
}; | ||
|
||
describe('endpoints.fips', function() { | ||
beforeEach(function () { | ||
helpers.mockResponse({ | ||
data: {} | ||
}); | ||
}); | ||
|
||
for (const test_case of test_cases) { | ||
it(`testing ${test_case.clientName} with region: ${test_case.region}`, async function() { | ||
await testApiCall(test_case); | ||
}); | ||
} | ||
}); |
Oops, something went wrong.