grepleaks 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/grepleaks.js +11 -2
  2. package/package.json +3 -2
package/bin/grepleaks.js CHANGED
@@ -138,8 +138,11 @@ async function createZip() {
138
138
 
139
139
  // Send scan request to API (async endpoint with AI analysis)
140
140
  async function sendScan(zipPath, apiKey) {
141
+ // Get project name from current directory
142
+ const projectName = path.basename(process.cwd());
143
+
141
144
  // Step 1: Submit the scan job
142
- const jobId = await submitScanJob(zipPath, apiKey);
145
+ const jobId = await submitScanJob(zipPath, apiKey, projectName);
143
146
 
144
147
  // Step 2: Poll for completion
145
148
  logInfo('Processing with analysis...');
@@ -149,12 +152,18 @@ async function sendScan(zipPath, apiKey) {
149
152
  }
150
153
 
151
154
  // Submit scan job to async endpoint
152
- function submitScanJob(zipPath, apiKey) {
155
+ function submitScanJob(zipPath, apiKey, projectName) {
153
156
  return new Promise((resolve, reject) => {
154
157
  const boundary = '----FormBoundary' + Math.random().toString(36).slice(2);
155
158
  const fileContent = fs.readFileSync(zipPath);
156
159
 
157
160
  const bodyParts = [
161
+ `--${boundary}\r\n`,
162
+ `Content-Disposition: form-data; name="source"\r\n\r\n`,
163
+ `cli\r\n`,
164
+ `--${boundary}\r\n`,
165
+ `Content-Disposition: form-data; name="project_name"\r\n\r\n`,
166
+ `${projectName}\r\n`,
158
167
  `--${boundary}\r\n`,
159
168
  `Content-Disposition: form-data; name="file"; filename="code.zip"\r\n`,
160
169
  `Content-Type: application/zip\r\n\r\n`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepleaks",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Security scanner for your code - detect vulnerabilities, secrets, and misconfigurations",
5
5
  "main": "bin/grepleaks.js",
6
6
  "bin": {
@@ -34,6 +34,7 @@
34
34
  "bin/"
35
35
  ],
36
36
  "dependencies": {
37
- "archiver": "^7.0.1"
37
+ "archiver": "^7.0.1",
38
+ "grepleaks": "^1.4.1"
38
39
  }
39
40
  }