rds_ssm_connect 2.0.0 → 2.0.1

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.
@@ -77,6 +77,9 @@ jobs:
77
77
  npx @yao-pkg/pkg src-tauri/binaries/gui-adapter-bundle.cjs --target ${{ matrix.sidecar_target }} -o src-tauri/binaries/gui-adapter-${{ matrix.sidecar_triple }}
78
78
  rm src-tauri/binaries/gui-adapter-bundle.cjs
79
79
 
80
+ - name: Download session-manager-plugin
81
+ run: node scripts/download-ssm-plugin.js --triple ${{ matrix.sidecar_triple }}
82
+
80
83
  - name: Build Tauri app
81
84
  uses: tauri-apps/tauri-action@v0
82
85
  env:
@@ -64,15 +64,10 @@ jobs:
64
64
  homepage "https://github.com/yarka-guru/connection_app"
65
65
 
66
66
  depends_on macos: ">= :monterey"
67
- depends_on formula: "aws-vault"
68
- depends_on formula: "awscli"
69
67
 
70
68
  app "RDS SSM Connect.app"
71
69
 
72
70
  caveats <<~EOS
73
- You also need the AWS Session Manager Plugin:
74
- brew install --cask session-manager-plugin
75
-
76
71
  Ensure your AWS profiles are configured in ~/.aws/config
77
72
  EOS
78
73
 
@@ -104,9 +99,6 @@ jobs:
104
99
  end
105
100
  end
106
101
 
107
- depends_on "awscli"
108
- depends_on "aws-vault"
109
-
110
102
  def install
111
103
  system "ar", "x", cached_download
112
104
  mkdir_p "extract"
@@ -118,9 +110,6 @@ jobs:
118
110
 
119
111
  def caveats
120
112
  <<~EOS
121
- You also need the AWS Session Manager Plugin:
122
- https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
123
-
124
113
  Ensure your AWS profiles are configured in ~/.aws/config
125
114
 
126
115
  On macOS, install the desktop app instead:
package/connect.js CHANGED
@@ -14,9 +14,10 @@ import {
14
14
  import { createAwsClients, destroyAwsClients } from './src/aws-clients.js'
15
15
  import * as ops from './src/aws-operations.js'
16
16
  import { findPluginBinary, spawnPlugin } from './src/plugin-resolver.js'
17
+ import { ensureSsoSession } from './src/sso-login.js'
17
18
 
18
19
  // Package info for version checking
19
- const packageJson = { name: 'rds_ssm_connect', version: '1.8.3' }
20
+ const packageJson = { name: 'rds_ssm_connect', version: '2.0.1' }
20
21
 
21
22
  // Event emitter for IPC communication
22
23
  const ipcEmitter = new EventEmitter()
@@ -962,6 +963,20 @@ async function main() {
962
963
  allEnvSuffixes.find((suffix) => ENV === suffix)
963
964
  const portNumber = envPortMapping[matchedSuffix] || defaultPort
964
965
 
966
+ // Ensure SSO session is valid (if SSO profile)
967
+ await ensureSsoSession(ENV, {
968
+ onEvent: (_event, data) => {
969
+ if (data?.message) console.log(`\u23F3 ${data.message}`)
970
+ },
971
+ onOpenUrl: (url) => {
972
+ console.log(`\n\uD83C\uDF10 Open this URL in your browser to authorize:\n ${url}\n`)
973
+ // Try to open browser automatically
974
+ const { platform } = process
975
+ const cmd = platform === 'darwin' ? 'open' : platform === 'win32' ? 'start' : 'xdg-open'
976
+ try { spawnSync(cmd, [url], { stdio: 'ignore' }) } catch {}
977
+ },
978
+ })
979
+
965
980
  // Create SDK clients ONCE for this CLI session
966
981
  const clients = createAwsClients(ENV, region)
967
982
 
@@ -1021,9 +1036,10 @@ async function main() {
1021
1036
  } finally {
1022
1037
  destroyAwsClients(clients)
1023
1038
  }
1024
- } catch (_error) {
1039
+ } catch (error) {
1040
+ console.error(`\n\u274C ${error.message || error}`)
1025
1041
  setImmediate(() => {
1026
- throw new Error('Forcing exit due to unhandled error')
1042
+ process.exit(1)
1027
1043
  })
1028
1044
  }
1029
1045
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rds_ssm_connect",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "@aws-sdk/client-sso-oidc": "^3.1000.0",
15
15
  "@aws-sdk/client-sts": "^3.1000.0",
16
16
  "@aws-sdk/credential-providers": "^3.1000.0",
17
- "fast-xml-parser": "^5.3.6",
17
+ "fast-xml-parser": "^5.3.8",
18
18
  "glob": "^13.0.0",
19
19
  "inquirer": "^13.2.2",
20
20
  "rimraf": "^6.1.2"
@@ -35,7 +35,7 @@
35
35
  "vite": "^6.4.1"
36
36
  },
37
37
  "overrides": {
38
- "fast-xml-parser": "^5.3.6"
38
+ "fast-xml-parser": "^5.3.8"
39
39
  },
40
40
  "bin": {
41
41
  "rds_ssm_connect": "./connect.js"
@@ -216,6 +216,29 @@ function extractWindowsZip(archivePath, tmpDir) {
216
216
  }
217
217
  }
218
218
 
219
+ // The AWS Windows zip has nested archives:
220
+ // outer.zip → SessionManagerPlugin.zip → package.zip → session-manager-plugin.exe
221
+ // Extract all nested zips we find.
222
+ function expandZip(zipPath, destDir) {
223
+ mkdirSync(destDir, { recursive: true });
224
+ if (isWindows) {
225
+ execSync(
226
+ `powershell -Command "Expand-Archive -Force -Path '${zipPath}' -DestinationPath '${destDir}'"`,
227
+ { stdio: "pipe" },
228
+ );
229
+ } else {
230
+ execSync(`unzip -o "${zipPath}" -d "${destDir}"`, { stdio: "pipe" });
231
+ }
232
+ }
233
+
234
+ for (const nestedName of ["SessionManagerPlugin.zip", "package.zip"]) {
235
+ const found = findFileRecursive(tmpDir, nestedName);
236
+ if (found) {
237
+ const destDir = join(tmpDir, nestedName.replace(".zip", "-extracted"));
238
+ expandZip(found, destDir);
239
+ }
240
+ }
241
+
219
242
  // Search for the exe — could be in bin/ subdirectory or at root
220
243
  const candidates = [
221
244
  join(tmpDir, "bin", "session-manager-plugin.exe"),
@@ -355,12 +378,25 @@ async function processTarget(target) {
355
378
  async function main() {
356
379
  const args = process.argv.slice(2);
357
380
  const currentPlatformOnly = args.includes("--current-platform-only");
381
+ const tripleIndex = args.indexOf("--triple");
382
+ const tripleArg = tripleIndex !== -1 ? args[tripleIndex + 1] : null;
358
383
 
359
384
  // Ensure output directory exists
360
385
  mkdirSync(BINARIES_DIR, { recursive: true });
361
386
 
362
387
  let targets;
363
- if (currentPlatformOnly) {
388
+ if (tripleArg) {
389
+ targets = TARGETS.filter((t) => t.triple === tripleArg);
390
+ if (targets.length === 0) {
391
+ console.error(`Error: Unknown triple "${tripleArg}".`);
392
+ console.error("Available triples:");
393
+ for (const t of TARGETS) {
394
+ console.error(` - ${t.triple}`);
395
+ }
396
+ process.exit(1);
397
+ }
398
+ console.log(`Downloading for triple: ${tripleArg}\n`);
399
+ } else if (currentPlatformOnly) {
364
400
  targets = getTargetsForCurrentPlatform();
365
401
  if (targets.length === 0) {
366
402
  console.warn(
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rds-ssm-connect"
3
- version = "2.0.0"
3
+ version = "2.0.1"
4
4
  description = "Secure RDS connections through AWS SSM"
5
5
  authors = ["Iaroslav Pyrogov"]
6
6
  edition = "2024"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://schema.tauri.app/config/2",
3
3
  "productName": "RDS SSM Connect",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "identifier": "com.rds-ssm-connect.desktop",
6
6
  "build": {
7
7
  "beforeDevCommand": "npm run dev:vite",