-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add logging for CredentialsProviderError (#1290)
* chore: add logging for CredentialsProviderError * use options object * var name clarity * test fixes * formatting * set internal tag on getSelectorName
- Loading branch information
Showing
13 changed files
with
238 additions
and
87 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,8 @@ | ||
--- | ||
"@smithy/credential-provider-imds": minor | ||
"@smithy/shared-ini-file-loader": minor | ||
"@smithy/node-config-provider": minor | ||
"@smithy/property-provider": minor | ||
--- | ||
|
||
new logging-compatible signature for CredentialsProviderError |
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,19 @@ | ||
/** | ||
* Attempts to extract the name of the variable that the functional selector is looking for. | ||
* Improves readability over the raw Function.toString() value. | ||
* @internal | ||
* @param functionString - function's string representation. | ||
* | ||
* @returns constant value used within the function. | ||
*/ | ||
export function getSelectorName(functionString: string): string { | ||
try { | ||
const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); | ||
constants.delete("CONFIG"); | ||
constants.delete("CONFIG_PREFIX_SEPARATOR"); | ||
constants.delete("ENV"); | ||
return [...constants].join(", "); | ||
} catch (e) { | ||
return functionString; | ||
} | ||
} |
Oops, something went wrong.