Skip to content

Commit a1d5118

Browse files
committed
fix(extension): fixed JSON file error. New README. Update AI model on BTP to gpt-4
fix #107
1 parent 97d9ce4 commit a1d5118

36 files changed

+509
-273
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ node_modules
66
.DS_Store
77
.nyc_output/
88
coverage/
9-
mochawesome-report/
10-
src/lib/key.json
9+
mochawesome-report/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.*ignore
33
.reuse/dep5
44
*.gif
5+
*.png
56
*.csv
67
.nvmrc
78
package-lock.json

README.md

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ VS Code extension for project "Credential Digger" is a free IDE extension that l
88

99
### How it works
1010

11-
Open any source file, or edit an existing one and save, then you will start seeing the issues reported by the extension.
11+
<u>Open</u> any source file, or edit an existing one and <u>save</u>, then you will start seeing the issues reported by the extension.
1212
The issues are highlighted in your code as warnings, and also are listed in the `Problems` panel.
1313

14-
![on-the-fly](images/credential-digger-how-it-works.gif)
14+
![on-the-fly](images/cd-how-it-works.png)
1515

1616
### Features
1717

@@ -52,43 +52,102 @@ The extension could be installed directly from the [VS Code Marketplace](https:/
5252

5353
The extension relies on an existing instance of the Credential Digger, hence you need to configure the extension based on the chosen mode
5454

55+
![settings](images/cd-settings.png)
56+
5557
#### Local
5658

57-
![local](images/credential-digger-local.gif)
59+
Navigate to the extension settings first. Go to the `Type` section and select the `binary` option. Then, from the `Binary` section, click on `Edit in settings.json`.
60+
61+
![local](images/cd-binary.png)
62+
63+
Next, provide the required information as shown in the following example:
64+
65+
```
66+
"credentialDigger.credentialDiggerRunner.type": "binary",
67+
"credentialDigger.credentialDiggerRunner.binary": {
68+
"path": "/bin/credentialdigger",
69+
"databaseConfig": {
70+
"type": "postgres",
71+
"postgres": {
72+
"envFile": "/tmp/test/postgres/.env"
73+
}
74+
}
75+
}
76+
```
5877

5978
#### Docker
6079

61-
![docker](images/credential-digger-docker.gif)
80+
Navigate to the extension settings first. Go to the `Type` section and select the `docker` option. Then, from the `Docker` section, click on `Edit in settings.json`.
81+
82+
![docker-edit](images/cd-docker.png)
83+
84+
Next, provide the required information as shown in the following example:
85+
86+
```
87+
"credentialDigger.credentialDiggerRunner.type": "docker",
88+
"credentialDigger.credentialDiggerRunner.docker": {
89+
"containerId": "378ffa800494",
90+
"databaseConfig": {
91+
"type": "sqlite",
92+
"sqlite": {
93+
"filename": "/data/db/data.db"
94+
}
95+
}
96+
}
97+
```
6298

6399
#### Web Server
64100

65-
![webserver](images/credential-digger-webserver.gif)
101+
Navigate to the extension settings first. Go to the `Type` section and select the `webserver` option. Then, from the `Webserver` section, click on `Edit in settings.json`.
102+
103+
![webserver-type](images/cd-webserver.png)
104+
105+
Next, provide the required information as shown in the following example:
106+
107+
```
108+
"credentialDigger.credentialDiggerRunner.type": "webserver",
109+
"credentialDigger.credentialDiggerRunner.webserver": {
110+
"host": "http://localhost:5000",
111+
"envFile": "/tmp/test/sqlite/.env"
112+
}
113+
```
66114

67115
### Add rules
68116

69-
If your Credential digger instance does not have scanning rules or you want to provide your customized set then you can push them by running this command `Credential Digger: Add Rules`
117+
If your Credential digger instance does not have scanning rules or you want to provide your customized set then you can first enter the path to your rules file into the `Rules` section and then push them by running this command `Credential Digger: Add Rules`
70118

71-
![add-rules](images/credential-digger-add-rules.gif)
119+
![add-rules](images/cd-add-rules.png)
72120

73121
### Exclude files
74122

75123
If you would like to exclude some files from being scanned you need to configure the extension by providing the patterns to filter out
76124

77-
![exclude-files](images/credential-digger-exclude-files.gif)
125+
Click on `Add Item`:
126+
127+
![exclude-files](images/cd-filter.png)
128+
129+
Then, enter each pattern individually:
130+
131+
![exclude-files-add](images/cd-filter-add.png)
78132

79133
### OpenAI
80134

81-
To fully benefit from the AI functionality, you need to configure some settings. Specifically, two fields need to be filled in the extension settings.
82-
(Your code will not be transmitted to an AI, only the file extension will be used on the prompt.)
135+
To fully benefit from the AI functionality, you need to configure two fields.
136+
(Your code will not be transmitted to an AI, only the file extension, like '.js' or '.java' will be used on the prompt.)
137+
138+
You have two AI modes at your disposal:
139+
140+
- **BTP OpenAI**: This option is for a Multi-tenant BTP service proxy for third-party LLM APIs. The extension use Azure OpenAI gpt-4 model.
141+
- Navigate to the `Openai Call Mode` section. From the dropdown menu, choose `BTP OpenAI`.
142+
- Then navigate to the `Openai Key Path` section. Here, enter a path that leads to your key within a .json file.
83143

84-
- **Openai Mode**: Select your preferred AI mode from the dropdown. The options include "BTP OpenAI" and "OpenAI."
144+
![btp-openai](images/cd-btp.png)
85145

86-
- <u>BTP OpenAI</u>: This option is for a Multi-tenant BTP service proxy for third-party LLM APIs. The extension use Azure OpenAI text-davinci-003 model.
87-
- <u>OpenAI</u>: This option is for OpenAI (https://platform.openai.com/).
146+
- **OpenAI**: This option is for OpenAI (https://platform.openai.com/)
147+
- Navigate to the `Openai Call Mode` section. From the dropdown menu, choose `OpenAI`.
148+
- Then navigate to the `Openai Key Path` section. Here, enter the path that directs to a .txt file. Make sure this file contains only the key you've copied and pasted.
88149

89-
- **Openai Key Path**: This field is for entering the full path to your OpenAI key. The type of key file depends on the selected OpenAI mode.
90-
- If <u>BTP OpenAI</u> was selected in the OpenAI Mode, the path should lead to a `.json` file containing your key.
91-
- If <u>OpenAI</u> was chosen, the path should direct to a `.txt` file containing only your copied and pasted key.
150+
![openai](images/cd-ai.png)
92151

93152
## Support, Feedback, Contributing
94153

images/cd-add-rules.png

537 KB
Loading

images/cd-ai.png

542 KB
Loading

images/cd-binary.png

589 KB
Loading

images/cd-btp.png

575 KB
Loading

images/cd-docker.png

597 KB
Loading

images/cd-filter-add.png

532 KB
Loading

images/cd-filter.png

503 KB
Loading

0 commit comments

Comments
 (0)