Commit 33dcc3c
authored
HCK-10566: AWS credentials monitoring (#28)
<!--do not remove this marker, its needed to replace info when ticket
title is updated -->
<!--jira-description-action-hidden-marker-start-->
<table>
<td>
<a href="https://hackolade.atlassian.net/browse/HCK-10566"
title="HCK-10566" target="_blank"><img alt="Sub-task"
src="https://hackolade.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium"
/>HCK-10566</a> Add connection info in logs: credentials file used?
Session token used?
</td></table>
<br />
<!--jira-description-action-hidden-marker-end-->
## Technical details
* extended the mechanism of getting AWS credentials, making it more
explicit in the logs:
* when there were no AWS credentials in Connection Config:
```
2025-04-01T16:55:16.268Z Retrieving databases and collections
information:
'Access Key ID' or 'Secret Access Key' were not specified, checking
system AWS credentials...
2025-04-01T16:55:16.270Z Retrieving databases and collections
information:
AWS credentials were successfully obtained from the file.
```
* when there were no AWS credentials in Connection Config and the AWS
credential file is not recognized:
```
2025-04-01T16:58:19.617Z Retrieving databases and collections
information:
'Access Key ID' or 'Secret Access Key' were not specified, checking
system AWS credentials...
2025-04-01T16:58:19.619Z Retrieving databases and collections
information:
{
"message": "Could not resolve credentials using profile: [default] in
configuration/credentials file(s).",
"stack": "CredentialsProviderError: Could not resolve credentials using
profile: [default] in configuration/credentials file(s).
at resolveProfileData
(/home/oleg/.hackolade/plugins/DocumentDB/node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js:246:9)
at
/home/oleg/.hackolade/plugins/DocumentDB/node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js:263:10
at async getCredentials
(/home/oleg/.hackolade/plugins/DocumentDB/shared/getDocDbClientInstance.js:16:24)
at async getDocDbClientInstance
(/home/oleg/.hackolade/plugins/DocumentDB/shared/getDocDbClientInstance.js:48:16)
at async Object.getDbCollectionsNames
(/home/oleg/.hackolade/plugins/DocumentDB/reverse_engineering/api.js:57:4)
at async callApiHandler
(/home/oleg/Documents/hackolade/studio/dist-dev/reWorker.js:92:3)
at async EventEmitter.<anonymous>
(/home/oleg/Documents/hackolade/studio/dist-dev/reWorker.js:219:5)"
}
```
* when everything, related to AWS credentials, were provided, including
the session token:
```
2025-04-01T17:00:32.618Z Retrieving databases and collections
information:
AWS session token provided, including it into credentials.
```1 parent 0971f64 commit 33dcc3c
File tree
4 files changed
+3152
-342
lines changed- reverse_engineering
4 files changed
+3152
-342
lines changed
0 commit comments