codeant-cli 0.4.2 → 0.4.4
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.
package/package.json
CHANGED
|
@@ -381,7 +381,41 @@ function BypassPrompt({ secrets, onSelect }) {
|
|
|
381
381
|
els.push(React.createElement(Text, { key: 'div-top', color: 'gray', dimColor: true }, DIVIDER));
|
|
382
382
|
els.push(React.createElement(
|
|
383
383
|
Text, { key: 'title', color: 'yellow', bold: true },
|
|
384
|
-
`${allSecrets.length} secret(s) detected
|
|
384
|
+
`${allSecrets.length} secret(s) detected:`,
|
|
385
|
+
));
|
|
386
|
+
els.push(React.createElement(Text, { key: 'sp-list' }, ''));
|
|
387
|
+
|
|
388
|
+
// Group by file and list each secret with line + type
|
|
389
|
+
const grouped = {};
|
|
390
|
+
allSecrets.forEach(s => {
|
|
391
|
+
const file = s.file_path || 'Unknown';
|
|
392
|
+
(grouped[file] ??= []).push(s);
|
|
393
|
+
});
|
|
394
|
+
const sortedFiles = Object.keys(grouped).sort();
|
|
395
|
+
sortedFiles.forEach(f =>
|
|
396
|
+
grouped[f].sort((a, b) => (a.line_number || 0) - (b.line_number || 0))
|
|
397
|
+
);
|
|
398
|
+
sortedFiles.forEach((file, fi) => {
|
|
399
|
+
const fileSecrets = grouped[file];
|
|
400
|
+
els.push(React.createElement(
|
|
401
|
+
Text, { key: `bp-f-${fi}`, color: 'white', bold: true }, ` ${file}`,
|
|
402
|
+
));
|
|
403
|
+
fileSecrets.forEach((secret, si) => {
|
|
404
|
+
const isLast = si === fileSecrets.length - 1;
|
|
405
|
+
const branch = isLast ? '└─' : '├─';
|
|
406
|
+
const lineStr = secret.line_number ? `L${secret.line_number}` : '';
|
|
407
|
+
els.push(React.createElement(
|
|
408
|
+
Box, { key: `bp-s-${fi}-${si}` },
|
|
409
|
+
React.createElement(Text, { color: 'gray' }, ` ${branch} `),
|
|
410
|
+
React.createElement(Text, { color: 'gray' }, padEnd(lineStr, 6)),
|
|
411
|
+
React.createElement(Text, { color: 'white' }, secret.type || ''),
|
|
412
|
+
));
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
els.push(React.createElement(Text, { key: 'sp-action' }, ''));
|
|
417
|
+
els.push(React.createElement(
|
|
418
|
+
Text, { key: 'action-label', color: 'yellow', bold: true }, 'Select an action:',
|
|
385
419
|
));
|
|
386
420
|
els.push(React.createElement(Text, { key: 'sp' }, ''));
|
|
387
421
|
|
|
@@ -25,7 +25,10 @@ function buildHookBlock(cliPath) {
|
|
|
25
25
|
# Auto-installed by CodeAnt AI — blocks pushes containing secrets.
|
|
26
26
|
# To disable: delete this hook or run "codeant push-protection disable"
|
|
27
27
|
# Uses the CLI bundled with the VS Code extension.
|
|
28
|
-
|
|
28
|
+
# Reopen stdin from terminal so the CLI can show an interactive bypass prompt.
|
|
29
|
+
# In non-interactive environments (CI), this silently fails and the push is blocked.
|
|
30
|
+
exec < /dev/tty 2>/dev/null || true
|
|
31
|
+
if [ -f "${cliPath}" ] && command -v node >/dev/null 2>&1; then
|
|
29
32
|
node "${cliPath}" secrets --committed --hook
|
|
30
33
|
else
|
|
31
34
|
command -v codeant >/dev/null 2>&1 || exit 0
|
|
@@ -36,6 +39,7 @@ ${HOOK_MARKER_END}`;
|
|
|
36
39
|
return `${HOOK_MARKER}
|
|
37
40
|
# Auto-installed by CodeAnt AI — blocks pushes containing secrets.
|
|
38
41
|
# To disable: delete this hook or run "codeant push-protection disable"
|
|
42
|
+
exec < /dev/tty 2>/dev/null || true
|
|
39
43
|
command -v codeant >/dev/null 2>&1 || exit 0
|
|
40
44
|
codeant secrets --committed --hook
|
|
41
45
|
${HOOK_MARKER_END}`;
|