-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds a new export from the package for aws-sdk v3 (#758)
* adds a new export from the package for aws-sdk v3 Signed-off-by: Tushar Sharma <ts17995@gmail.com> * adds tests, doc updates and better error messages Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: add docs & missing license field Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: test Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: add license Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: tests & credential loader code Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: tests error due to dependency being installed now Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: tests Signed-off-by: Tushar Sharma <ts17995@gmail.com> * update yarn Signed-off-by: Tushar Sharma <ts17995@gmail.com> * use yarn install Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: update yarn.lock Signed-off-by: Tushar Sharma <ts17995@gmail.com> * fix: remove peer dependency Signed-off-by: Tushar Sharma <ts17995@gmail.com> * revert yarn lock Signed-off-by: Tushar Sharma <ts17995@gmail.com> * use npm Signed-off-by: Tushar Sharma <ts17995@gmail.com> --------- Signed-off-by: Tushar Sharma <ts17995@gmail.com>
- Loading branch information
Showing
13 changed files
with
393 additions
and
152 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
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,32 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
const AwsSigv4SignerError = require('./errors'); | ||
const { giveAwsV4Signer, giveAwsCredentialProviderLoader } = require('./shared'); | ||
|
||
const getAwsSDKCredentialsProvider = async () => { | ||
try { | ||
const awsV3 = await import('@aws-sdk/credential-provider-node'); | ||
if (typeof awsV3.defaultProvider === 'function') { | ||
return awsV3.defaultProvider(); | ||
} | ||
} catch (err) { | ||
throw new AwsSigv4SignerError( | ||
"Missing '@aws-sdk/credential-provider-node' module. Install it as a dependency." | ||
); | ||
} | ||
}; | ||
|
||
const AwsSigv4Signer = giveAwsV4Signer( | ||
giveAwsCredentialProviderLoader(getAwsSDKCredentialsProvider) | ||
); | ||
|
||
module.exports = AwsSigv4Signer; |
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,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const AwsSigv4Signer = require('./AwsSigv4Signer-sdk-v3'); | ||
const AwsSigv4SignerError = require('./errors'); | ||
|
||
module.exports = { | ||
AwsSigv4Signer, | ||
AwsSigv4SignerError, | ||
}; |
Oops, something went wrong.