aws / aws/aws-toolkit-visual-studio

AWS Toolkit erased the content of the credentials file

Open
#454 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
135
Forks
37
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Recently, AWS Toolkit was updated to version 1.55.2.0. I got the yellow banner in Visual Studio that suggest I configure the extension using "Extensions > AWS Toolkit > Getting Started" menu option. I did that, selected "AWS Explorer", and then clicked "Edit credentials file directly...", because I already have the required profiles configured.

AWS Toolkit, replaced the content of the credentials file with the following text:

```
# AWS credentials file used by AWS CLI, SDKs, and tools.
# Created by AWS Toolkit for Visual Studio. https://aws.amazon.com/visualstudio/
#
# Each [section] in this file declares a named "profile", which can be selected
# in tools like AWS Toolkit to choose which credentials you want to use.
#
# See also:
# https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
# https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html
```

This all happens without any warning and before even configuring and saving anything.

**To Reproduce**

**Expected behavior**
AWS Toolkit leave the credentials file unchanged, unless the user configures something. In such case, AWS Toolkit must append to the file, not replace it.

**Screenshots**
N/A

**Toolkit Logs**
N/A

**Development System (please complete the following information):**
- Windows Version: Windows 10 22H2
- Visual Studio Version: 17.10.4
- AWS Toolkit for Visual Studio Version: 1.55.2.0

**Additional context**
I have no addition context to add, but I would like to express my frustration. Any "destructive" action must not happen without the user's knowledge. It does not make sense to assume that the file does not exist or its content do not matter.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue through Extensions > AWS Toolkit > Getting Started, then choose AWS Explorer and "Edit credentials file directly...". Inspect the user's %USERPROFILE%\.aws\credentials file before and after the action. Done means an existing credentials file remains unchanged until configuration is saved, and new configuration is appended rather than replacing existing content.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.