rds_ssm_connect 1.8.4 → 1.8.5
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/.github/workflows/update-homebrew.yml +3 -0
- package/connect.js +15 -1
- package/package.json +1 -1
package/connect.js
CHANGED
|
@@ -84,6 +84,18 @@ async function checkForUpdates() {
|
|
|
84
84
|
// Store active child processes for cleanup
|
|
85
85
|
let activeChildProcesses = []
|
|
86
86
|
|
|
87
|
+
// Copy text to system clipboard. Returns true on success.
|
|
88
|
+
function copyToClipboard(text) {
|
|
89
|
+
try {
|
|
90
|
+
const cmd = process.platform === 'darwin' ? 'pbcopy' : process.platform === 'win32' ? 'clip' : 'xclip -selection clipboard'
|
|
91
|
+
const [bin, ...args] = cmd.split(' ')
|
|
92
|
+
const result = spawnSync(bin, args, { input: text, stdio: ['pipe', 'ignore', 'ignore'] })
|
|
93
|
+
return result.status === 0
|
|
94
|
+
} catch {
|
|
95
|
+
return false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
87
99
|
// Recursively collect all descendant PIDs of a process via pgrep.
|
|
88
100
|
function getDescendantPids(pid) {
|
|
89
101
|
const descendants = []
|
|
@@ -1087,7 +1099,9 @@ async function main() {
|
|
|
1087
1099
|
console.log(` Host: localhost`)
|
|
1088
1100
|
console.log(` Port: ${portNumber}`)
|
|
1089
1101
|
console.log(` Username: ${CREDENTIALS.username}`)
|
|
1090
|
-
|
|
1102
|
+
// Copy password to clipboard without logging it in clear text
|
|
1103
|
+
const copied = copyToClipboard(CREDENTIALS.password)
|
|
1104
|
+
console.log(` Password: ${'*'.repeat(CREDENTIALS.password.length)}${copied ? ' (copied to clipboard)' : ''}`)
|
|
1091
1105
|
console.log(` Database: ${projectConfig.database}`)
|
|
1092
1106
|
console.log(`\n⏳ Starting port forwarding...`)
|
|
1093
1107
|
console.log(' Press Ctrl+C to disconnect\n')
|