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.
@@ -4,6 +4,9 @@ on:
4
4
  release:
5
5
  types: [published]
6
6
 
7
+ permissions:
8
+ contents: read
9
+
7
10
  jobs:
8
11
  update-tap:
9
12
  runs-on: ubuntu-latest
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
- console.log(` Password: ${CREDENTIALS.password}`)
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')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rds_ssm_connect",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",