rds_ssm_connect 2.0.1 → 2.0.2

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.
@@ -913,135 +913,6 @@ async fn quit_app(
913
913
  Ok(())
914
914
  }
915
915
 
916
- // ========================
917
- // PREREQUISITES CHECK
918
- // ========================
919
-
920
- #[derive(Serialize, Deserialize, Debug, Clone)]
921
- pub struct PrerequisiteStatus {
922
- pub name: String,
923
- pub installed: bool,
924
- pub version: Option<String>,
925
- #[serde(rename = "installUrl")]
926
- pub install_url: String,
927
- #[serde(rename = "installCommand")]
928
- pub install_command: Option<String>,
929
- }
930
-
931
- #[derive(Serialize, Deserialize, Debug, Clone)]
932
- pub struct PrerequisitesResult {
933
- #[serde(rename = "allInstalled")]
934
- pub all_installed: bool,
935
- pub prerequisites: Vec<PrerequisiteStatus>,
936
- }
937
-
938
- #[tauri::command]
939
- async fn check_prerequisites() -> Result<PrerequisitesResult, String> {
940
- // Run all blocking I/O on a dedicated thread to avoid starving the Tokio runtime
941
- tokio::task::spawn_blocking(move || {
942
- use std::process::Command;
943
-
944
- // Common paths where tools might be installed
945
- let home = std::env::var("HOME").unwrap_or_default();
946
- let local_bin = format!("{}/.local/bin", home);
947
- let search_paths: Vec<&str> = vec![
948
- "/usr/local/bin",
949
- "/opt/homebrew/bin",
950
- "/usr/bin",
951
- "/bin",
952
- &local_bin,
953
- ];
954
-
955
- fn find_command(name: &str, search_paths: &[&str]) -> Option<std::path::PathBuf> {
956
- // First try PATH
957
- if let Ok(output) = std::process::Command::new("which").arg(name).output()
958
- && output.status.success() {
959
- let path = String::from_utf8_lossy(&output.stdout).trim().to_string();
960
- if !path.is_empty() {
961
- return Some(std::path::PathBuf::from(path));
962
- }
963
- }
964
- // Then search common paths
965
- for dir in search_paths {
966
- let path = std::path::Path::new(dir).join(name);
967
- if path.exists() {
968
- return Some(path);
969
- }
970
- }
971
- None
972
- }
973
-
974
- let mut prerequisites = Vec::new();
975
-
976
- // aws-vault and AWS CLI are no longer required — the app uses
977
- // AWS SDK v3 natively for all API calls and credential resolution.
978
- // Only the Session Manager Plugin is still needed for port forwarding.
979
-
980
- // Check Session Manager Plugin — also check the app bundle directory
981
- // (Tauri places externalBin entries next to the main binary at runtime)
982
- let exe_dir = std::env::current_exe()
983
- .ok()
984
- .and_then(|p| p.parent().map(|d| d.to_path_buf()));
985
-
986
- let bundled_plugin = exe_dir.as_ref().and_then(|dir| {
987
- let candidate = dir.join("session-manager-plugin");
988
- if candidate.exists() { Some(candidate) } else { None }
989
- });
990
-
991
- let ssm_plugin = if let Some(ref bundled_path) = bundled_plugin {
992
- // Plugin is bundled with the app
993
- let version = Command::new(bundled_path).arg("--version").output()
994
- .ok()
995
- .filter(|o| o.status.success())
996
- .map(|o| String::from_utf8_lossy(&o.stdout).trim().to_string());
997
- PrerequisiteStatus {
998
- name: "Session Manager Plugin".to_string(),
999
- installed: true,
1000
- version: version.or_else(|| Some("bundled".to_string())),
1001
- install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
1002
- install_command: None,
1003
- }
1004
- } else {
1005
- // Not bundled — check system PATH and known paths
1006
- match find_command("session-manager-plugin", &search_paths) {
1007
- Some(path) => match Command::new(&path).arg("--version").output() {
1008
- Ok(output) if output.status.success() => PrerequisiteStatus {
1009
- name: "Session Manager Plugin".to_string(),
1010
- installed: true,
1011
- version: Some(String::from_utf8_lossy(&output.stdout).trim().to_string()),
1012
- install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
1013
- install_command: None,
1014
- },
1015
- _ => PrerequisiteStatus {
1016
- name: "Session Manager Plugin".to_string(),
1017
- installed: false,
1018
- version: None,
1019
- install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
1020
- install_command: None,
1021
- },
1022
- },
1023
- None => PrerequisiteStatus {
1024
- name: "Session Manager Plugin".to_string(),
1025
- installed: false,
1026
- version: None,
1027
- install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
1028
- install_command: None,
1029
- },
1030
- }
1031
- };
1032
- prerequisites.push(ssm_plugin);
1033
-
1034
- let all_installed = prerequisites.iter().all(|p| p.installed);
1035
-
1036
- Ok(PrerequisitesResult {
1037
- all_installed,
1038
- prerequisites,
1039
- })
1040
- })
1041
- .await
1042
- .map_err(|e| format!("Prerequisites check task failed: {}", e))?
1043
- }
1044
-
1045
916
  // ========================
1046
917
  // AWS CONFIG MANAGEMENT
1047
918
  // ========================
@@ -1358,8 +1229,6 @@ pub fn run() {
1358
1229
  get_current_version,
1359
1230
  open_url,
1360
1231
  quit_app,
1361
- // Prerequisites commands
1362
- check_prerequisites,
1363
1232
  // AWS config commands
1364
1233
  read_aws_config,
1365
1234
  save_aws_profile,
@@ -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.1",
4
+ "version": "2.0.2",
5
5
  "identifier": "com.rds-ssm-connect.desktop",
6
6
  "build": {
7
7
  "beforeDevCommand": "npm run dev:vite",