rds_ssm_connect 1.5.3 → 1.7.0

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 (41) hide show
  1. package/.github/workflows/npm-publish.yml +9 -6
  2. package/.github/workflows/release.yml +114 -0
  3. package/CLAUDE.md +27 -15
  4. package/connect.js +380 -38
  5. package/envPortMapping.js +52 -27
  6. package/gui-adapter.js +268 -0
  7. package/index.html +21 -0
  8. package/package.json +27 -5
  9. package/scripts/generate-icons.js +206 -0
  10. package/scripts/generate-signing-key.sh +27 -0
  11. package/scripts/generate-update-json.js +61 -0
  12. package/scripts/pkg-sidecar-dev.js +94 -0
  13. package/scripts/pkg-sidecar.js +64 -0
  14. package/src/App.svelte +832 -0
  15. package/src/lib/ActiveConnections.svelte +468 -0
  16. package/src/lib/ConnectionForm.svelte +272 -0
  17. package/src/lib/CredentialsDisplay.svelte +400 -0
  18. package/src/lib/PrerequisitesCheck.svelte +241 -0
  19. package/src/lib/SavedConnections.svelte +559 -0
  20. package/src/lib/SessionStatus.svelte +102 -0
  21. package/src/lib/Settings.svelte +652 -0
  22. package/src/lib/UpdateBanner.svelte +167 -0
  23. package/src/main.js +8 -0
  24. package/src-tauri/Cargo.lock +5808 -0
  25. package/src-tauri/Cargo.toml +31 -0
  26. package/src-tauri/build.rs +3 -0
  27. package/src-tauri/capabilities/default.json +25 -0
  28. package/src-tauri/gen/schemas/acl-manifests.json +1 -0
  29. package/src-tauri/gen/schemas/capabilities.json +1 -0
  30. package/src-tauri/gen/schemas/desktop-schema.json +3025 -0
  31. package/src-tauri/gen/schemas/macOS-schema.json +3025 -0
  32. package/src-tauri/icons/128x128.png +0 -0
  33. package/src-tauri/icons/128x128@2x.png +0 -0
  34. package/src-tauri/icons/32x32.png +0 -0
  35. package/src-tauri/icons/icon.icns +0 -0
  36. package/src-tauri/icons/icon.ico +0 -0
  37. package/src-tauri/src/lib.rs +1087 -0
  38. package/src-tauri/src/main.rs +6 -0
  39. package/src-tauri/tauri.conf.json +53 -0
  40. package/svelte.config.js +5 -0
  41. package/vite.config.js +16 -0
@@ -3,16 +3,19 @@ on:
3
3
  release:
4
4
  types: [published]
5
5
  workflow_dispatch:
6
+
6
7
  jobs:
7
8
  build:
8
9
  runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
9
13
  steps:
10
- - uses: actions/checkout@v3
11
- - uses: actions/setup-node@v3
14
+ - uses: actions/checkout@v6
15
+ - uses: actions/setup-node@v6
12
16
  with:
13
- node-version: '20.x'
17
+ node-version: '22.x'
14
18
  registry-url: 'https://registry.npmjs.org'
19
+ - run: npm install -g npm@latest
15
20
  - run: npm ci
16
- - run: npm publish
17
- env:
18
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21
+ - run: npm publish --provenance --access public
@@ -0,0 +1,114 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ env:
9
+ CARGO_INCREMENTAL: 0
10
+
11
+ jobs:
12
+ build:
13
+ permissions:
14
+ contents: write
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ - platform: macos-latest
20
+ rust_target: aarch64-apple-darwin
21
+ sidecar_target: node22-macos-arm64
22
+ sidecar_triple: aarch64-apple-darwin
23
+ - platform: macos-latest
24
+ rust_target: x86_64-apple-darwin
25
+ sidecar_target: node22-macos-x64
26
+ sidecar_triple: x86_64-apple-darwin
27
+ - platform: ubuntu-22.04
28
+ rust_target: x86_64-unknown-linux-gnu
29
+ sidecar_target: node22-linux-x64
30
+ sidecar_triple: x86_64-unknown-linux-gnu
31
+ - platform: windows-latest
32
+ rust_target: x86_64-pc-windows-msvc
33
+ sidecar_target: node22-win-x64
34
+ sidecar_triple: x86_64-pc-windows-msvc
35
+
36
+ runs-on: ${{ matrix.platform }}
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - name: Setup Node
41
+ uses: actions/setup-node@v4
42
+ with:
43
+ node-version: '22'
44
+ cache: 'npm'
45
+
46
+ - name: Install Rust stable
47
+ uses: dtolnay/rust-toolchain@stable
48
+ with:
49
+ targets: ${{ matrix.rust_target }}
50
+
51
+ - name: Rust cache
52
+ uses: Swatinem/rust-cache@v2
53
+ with:
54
+ workspaces: src-tauri
55
+
56
+ - name: Install dependencies (Ubuntu)
57
+ if: matrix.platform == 'ubuntu-22.04'
58
+ run: |
59
+ sudo apt-get update
60
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
61
+
62
+ - name: Install frontend dependencies
63
+ run: npm ci
64
+
65
+ - name: Build sidecar for current platform
66
+ run: |
67
+ mkdir -p src-tauri/binaries
68
+ npx esbuild gui-adapter.js --bundle --platform=node --target=node22 --outfile=src-tauri/binaries/gui-adapter-bundle.cjs --format=cjs --external:inquirer
69
+ npx @yao-pkg/pkg src-tauri/binaries/gui-adapter-bundle.cjs --target ${{ matrix.sidecar_target }} -o src-tauri/binaries/gui-adapter-${{ matrix.sidecar_triple }}
70
+ rm src-tauri/binaries/gui-adapter-bundle.cjs
71
+
72
+ - name: Build Tauri app
73
+ uses: tauri-apps/tauri-action@v0
74
+ env:
75
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
77
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
78
+ with:
79
+ tagName: v__VERSION__
80
+ releaseName: 'RDS SSM Connect v__VERSION__'
81
+ releaseBody: 'See the assets to download this version and install.'
82
+ releaseDraft: true
83
+ prerelease: false
84
+ args: --target ${{ matrix.rust_target }}
85
+
86
+ # Generate update manifest after all builds complete
87
+ update-manifest:
88
+ needs: build
89
+ runs-on: ubuntu-latest
90
+ permissions:
91
+ contents: write
92
+ steps:
93
+ - uses: actions/checkout@v4
94
+
95
+ - name: Setup Node
96
+ uses: actions/setup-node@v4
97
+ with:
98
+ node-version: '22'
99
+
100
+ - name: Get version from tag
101
+ id: version
102
+ run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
103
+
104
+ - name: Generate latest.json
105
+ run: |
106
+ node scripts/generate-update-json.js ${{ steps.version.outputs.VERSION }} https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.VERSION }}
107
+
108
+ - name: Upload latest.json to release
109
+ uses: softprops/action-gh-release@v1
110
+ with:
111
+ files: latest.json
112
+ tag_name: v${{ steps.version.outputs.VERSION }}
113
+ env:
114
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CLAUDE.md CHANGED
@@ -16,20 +16,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
16
16
  - Establishes SSM port forwarding session
17
17
 
18
18
  ### Configuration
19
- - `envPortMapping.js` - Environment-to-port mapping configuration
20
- - Maps environment suffixes (dev, stage, prod, team1-5, qa1-5, etc.) to local port numbers (5433-5452)
21
- - Defines default database name: `emr`
22
- - Defines AWS region: `us-east-2`
23
- - **Critical**: When adding new environments, update this mapping to assign unique ports
19
+ - `envPortMapping.js` - Multi-project configuration
20
+ - `PROJECT_CONFIGS` - Object containing per-project settings:
21
+ - `tln`: TLN/EMR project (us-east-2, Aurora clusters, `rds!cluster` secrets)
22
+ - `covered`: Covered Healthcare project (us-west-1, RDS instances, `rds!db` secrets)
23
+ - Each project defines: region, database, secretPrefix, rdsType, rdsPattern, profileFilter, envPortMapping
24
+ - Legacy exports maintained for backward compatibility
24
25
 
25
26
  ### Core Flow
26
27
  1. Read AWS profiles from `~/.aws/config`
27
- 2. Prompt user to select environment (AWS profile)
28
- 3. Query Secrets Manager for RDS credentials (secrets starting with `rds!cluster`)
29
- 4. Find running bastion instance (tagged with `Name=*bastion*`)
30
- 5. Get RDS Aurora cluster endpoint (cluster IDs ending with `-rds-aurora`)
31
- 6. Start SSM port forwarding session
32
- 7. Display connection details for database client
28
+ 2. Prompt user to select project (TLN or Covered)
29
+ 3. Filter and prompt for environment (AWS profile) based on project
30
+ 4. Query Secrets Manager for RDS credentials (project-specific prefix)
31
+ 5. Find running bastion instance (tagged with `Name=*bastion*`)
32
+ 6. Get RDS endpoint (cluster or instance based on project config)
33
+ 7. Start SSM port forwarding session with correct remote port
34
+ 8. Display connection details for database client
33
35
 
34
36
  ## Development Commands
35
37
 
@@ -71,17 +73,27 @@ Package is published to npm via GitHub Actions workflow (`.github/workflows/npm-
71
73
 
72
74
  ## AWS Resource Naming Conventions
73
75
 
74
- The application relies on specific AWS resource naming patterns:
76
+ The application relies on specific AWS resource naming patterns (per project):
77
+
78
+ **TLN Project:**
75
79
  - **Secrets**: Must start with `rds!cluster`
76
80
  - **Bastion instances**: Must be tagged with `Name=*bastion*` and in `running` state
77
81
  - **RDS clusters**: DBClusterIdentifier must end with `-rds-aurora` and be in `available` state
82
+ - **Region**: us-east-2
83
+
84
+ **Covered Project:**
85
+ - **Secrets**: Must start with `rds!db`
86
+ - **Bastion instances**: Must be tagged with `Name=*bastion*` and in `running` state
87
+ - **RDS instances**: DBInstanceIdentifier must contain `covered-db` and be in `available` state
88
+ - **Region**: us-west-1
89
+ - **AWS Profiles**: Must start with `covered` (e.g., `covered`, `covered-staging`)
78
90
 
79
91
  ## Important Notes
80
92
 
81
- - Port assignment is based on longest-matching environment suffix (e.g., `my-team-dev` matches `dev` → port 5433)
93
+ - Port assignment is based on project-specific port mappings
82
94
  - The tool keeps the SSM session running until Ctrl+C is pressed
83
- - Default port is 5432 if no environment suffix matches
84
- - All AWS operations use the `us-east-2` region by default
95
+ - Each project has its own default port if no environment suffix matches
96
+ - AWS region is determined by the selected project
85
97
 
86
98
  ## Error Handling & Recovery
87
99