Skip to content

Commit 8743051

Browse files
committed
feat: add reusable SSH tunnel profiles (#381)
1 parent ae17f84 commit 8743051

8 files changed

Lines changed: 504 additions & 49 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Reusable SSH tunnel profiles: save SSH configurations once and select them across multiple connections
13+
- Amazon DynamoDB database support with PartiQL queries, AWS IAM/Profile/SSO authentication, GSI/LSI browsing, table scanning, capacity display, and DynamoDB Local support
14+
1015
### Fixed
1116

1217
- etcd connection failing with 404 when gRPC gateway uses a different API prefix (auto-detects `/v3/`, `/v3beta/`, `/v3alpha/`)

TablePro.xcodeproj/project.pbxproj

Lines changed: 156 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@
3030
5A86E000A00000000 /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
3131
5A86F000A00000000 /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
3232
5A87A000A00000000 /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
33-
5AE4F4902F6BC0640097AC5B /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
3433
5ACE00012F4F000000000004 /* CodeEditSourceEditor in Frameworks */ = {isa = PBXBuildFile; productRef = 5ACE00012F4F000000000002 /* CodeEditSourceEditor */; };
3534
5ACE00012F4F000000000005 /* CodeEditLanguages in Frameworks */ = {isa = PBXBuildFile; productRef = 5ACE00012F4F000000000003 /* CodeEditLanguages */; };
3635
5ACE00012F4F000000000006 /* CodeEditTextView in Frameworks */ = {isa = PBXBuildFile; productRef = 5ACE00012F4F000000000007 /* CodeEditTextView */; };
3736
5ACE00012F4F00000000000A /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 5ACE00012F4F000000000009 /* Sparkle */; };
3837
5ACE00012F4F00000000000D /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 5ACE00012F4F00000000000C /* MarkdownUI */; };
38+
5ADDB0010000000000000001 /* DynamoDBConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000001 /* DynamoDBConnection.swift */; };
39+
5ADDB0010000000000000002 /* DynamoDBItemFlattener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000002 /* DynamoDBItemFlattener.swift */; };
40+
5ADDB0010000000000000003 /* DynamoDBPartiQLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000003 /* DynamoDBPartiQLParser.swift */; };
41+
5ADDB0010000000000000004 /* DynamoDBPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000004 /* DynamoDBPlugin.swift */; };
42+
5ADDB0010000000000000005 /* DynamoDBPluginDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000005 /* DynamoDBPluginDriver.swift */; };
43+
5ADDB0010000000000000006 /* DynamoDBQueryBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000006 /* DynamoDBQueryBuilder.swift */; };
44+
5ADDB0010000000000000007 /* DynamoDBStatementGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADDB0020000000000000007 /* DynamoDBStatementGenerator.swift */; };
45+
5ADDB0010000000000000008 /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
46+
5AE4F4902F6BC0640097AC5B /* TableProPluginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A860000100000000 /* TableProPluginKit.framework */; };
3947
5AEA8B422F6808CA0040461A /* EtcdStatementGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AEA8B402F6808CA0040461A /* EtcdStatementGenerator.swift */; };
4048
5AEA8B432F6808CA0040461A /* EtcdPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AEA8B3D2F6808CA0040461A /* EtcdPlugin.swift */; };
4149
5AEA8B442F6808CA0040461A /* EtcdCommandParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AEA8B3B2F6808CA0040461A /* EtcdCommandParser.swift */; };
@@ -176,6 +184,14 @@
176184
5A86F000100000000 /* SQLImport.tableplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SQLImport.tableplugin; sourceTree = BUILT_PRODUCTS_DIR; };
177185
5A87A000100000000 /* CassandraDriver.tableplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CassandraDriver.tableplugin; sourceTree = BUILT_PRODUCTS_DIR; };
178186
5ABCC5A72F43856700EAF3FC /* TableProTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TableProTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
187+
5ADDB0020000000000000001 /* DynamoDBConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBConnection.swift; sourceTree = "<group>"; };
188+
5ADDB0020000000000000002 /* DynamoDBItemFlattener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBItemFlattener.swift; sourceTree = "<group>"; };
189+
5ADDB0020000000000000003 /* DynamoDBPartiQLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBPartiQLParser.swift; sourceTree = "<group>"; };
190+
5ADDB0020000000000000004 /* DynamoDBPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBPlugin.swift; sourceTree = "<group>"; };
191+
5ADDB0020000000000000005 /* DynamoDBPluginDriver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBPluginDriver.swift; sourceTree = "<group>"; };
192+
5ADDB0020000000000000006 /* DynamoDBQueryBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBQueryBuilder.swift; sourceTree = "<group>"; };
193+
5ADDB0020000000000000007 /* DynamoDBStatementGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamoDBStatementGenerator.swift; sourceTree = "<group>"; };
194+
5AE460EC2F6CEDB70097AC5B /* DynamoDBDriverPlugin.tableplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DynamoDBDriverPlugin.tableplugin; sourceTree = BUILT_PRODUCTS_DIR; };
179195
5AE4F4742F6BC0640097AC5B /* CloudflareD1DriverPlugin.tableplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CloudflareD1DriverPlugin.tableplugin; sourceTree = BUILT_PRODUCTS_DIR; };
180196
5AEA8B2A2F6808270040461A /* EtcdDriverPlugin.tableplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EtcdDriverPlugin.tableplugin; sourceTree = BUILT_PRODUCTS_DIR; };
181197
5AEA8B3B2F6808CA0040461A /* EtcdCommandParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EtcdCommandParser.swift; sourceTree = "<group>"; };
@@ -209,13 +225,6 @@
209225
);
210226
target = 5A862000000000000 /* SQLiteDriver */;
211227
};
212-
5AE4F4802F6BC0640097AC5B /* Exceptions for "Plugins/CloudflareD1DriverPlugin" folder in "CloudflareD1DriverPlugin" target */ = {
213-
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
214-
membershipExceptions = (
215-
Info.plist,
216-
);
217-
target = 5AE4F4732F6BC0640097AC5B /* CloudflareD1DriverPlugin */;
218-
};
219228
5A863000900000000 /* Exceptions for "Plugins/ClickHouseDriverPlugin" folder in "ClickHouseDriver" target */ = {
220229
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
221230
membershipExceptions = (
@@ -314,6 +323,13 @@
314323
);
315324
target = 5A87A000000000000 /* CassandraDriver */;
316325
};
326+
5AE4F4802F6BC0640097AC5B /* Exceptions for "Plugins/CloudflareD1DriverPlugin" folder in "CloudflareD1DriverPlugin" target */ = {
327+
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
328+
membershipExceptions = (
329+
Info.plist,
330+
);
331+
target = 5AE4F4732F6BC0640097AC5B /* CloudflareD1DriverPlugin */;
332+
};
317333
5AF312BE2F36FF7500E86682 /* Exceptions for "TablePro" folder in "TablePro" target */ = {
318334
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
319335
membershipExceptions = (
@@ -356,14 +372,6 @@
356372
path = Plugins/SQLiteDriverPlugin;
357373
sourceTree = "<group>";
358374
};
359-
5AE4F4812F6BC0640097AC5B /* Plugins/CloudflareD1DriverPlugin */ = {
360-
isa = PBXFileSystemSynchronizedRootGroup;
361-
exceptions = (
362-
5AE4F4802F6BC0640097AC5B /* Exceptions for "Plugins/CloudflareD1DriverPlugin" folder in "CloudflareD1DriverPlugin" target */,
363-
);
364-
path = Plugins/CloudflareD1DriverPlugin;
365-
sourceTree = "<group>";
366-
};
367375
5A863000500000000 /* Plugins/ClickHouseDriverPlugin */ = {
368376
isa = PBXFileSystemSynchronizedRootGroup;
369377
exceptions = (
@@ -481,6 +489,14 @@
481489
path = TableProTests;
482490
sourceTree = "<group>";
483491
};
492+
5AE4F4812F6BC0640097AC5B /* Plugins/CloudflareD1DriverPlugin */ = {
493+
isa = PBXFileSystemSynchronizedRootGroup;
494+
exceptions = (
495+
5AE4F4802F6BC0640097AC5B /* Exceptions for "Plugins/CloudflareD1DriverPlugin" folder in "CloudflareD1DriverPlugin" target */,
496+
);
497+
path = Plugins/CloudflareD1DriverPlugin;
498+
sourceTree = "<group>";
499+
};
484500
/* End PBXFileSystemSynchronizedRootGroup section */
485501

486502
/* Begin PBXFrameworksBuildPhase section */
@@ -639,6 +655,14 @@
639655
);
640656
runOnlyForDeploymentPostprocessing = 0;
641657
};
658+
5AE460E92F6CEDB70097AC5B /* Frameworks */ = {
659+
isa = PBXFrameworksBuildPhase;
660+
buildActionMask = 2147483647;
661+
files = (
662+
5ADDB0010000000000000008 /* TableProPluginKit.framework in Frameworks */,
663+
);
664+
runOnlyForDeploymentPostprocessing = 0;
665+
};
642666
5AE4F4712F6BC0640097AC5B /* Frameworks */ = {
643667
isa = PBXFrameworksBuildPhase;
644668
buildActionMask = 2147483647;
@@ -669,6 +693,7 @@
669693
5A1091BE2EF17EDC0055EA7C = {
670694
isa = PBXGroup;
671695
children = (
696+
5ADDB0050000000000000000 /* Plugins/DynamoDBDriverPlugin */,
672697
5AEA8B412F6808CA0040461A /* Plugins/EtcdDriverPlugin */,
673698
5AE4F4812F6BC0640097AC5B /* Plugins/CloudflareD1DriverPlugin */,
674699
5A1091C92EF17EDC0055EA7C /* TablePro */,
@@ -720,10 +745,25 @@
720745
5ABCC5A72F43856700EAF3FC /* TableProTests.xctest */,
721746
5AEA8B2A2F6808270040461A /* EtcdDriverPlugin.tableplugin */,
722747
5AE4F4742F6BC0640097AC5B /* CloudflareD1DriverPlugin.tableplugin */,
748+
5AE460EC2F6CEDB70097AC5B /* DynamoDBDriverPlugin.tableplugin */,
723749
);
724750
name = Products;
725751
sourceTree = "<group>";
726752
};
753+
5ADDB0050000000000000000 /* Plugins/DynamoDBDriverPlugin */ = {
754+
isa = PBXGroup;
755+
children = (
756+
5ADDB0020000000000000001 /* DynamoDBConnection.swift */,
757+
5ADDB0020000000000000002 /* DynamoDBItemFlattener.swift */,
758+
5ADDB0020000000000000003 /* DynamoDBPartiQLParser.swift */,
759+
5ADDB0020000000000000004 /* DynamoDBPlugin.swift */,
760+
5ADDB0020000000000000005 /* DynamoDBPluginDriver.swift */,
761+
5ADDB0020000000000000006 /* DynamoDBQueryBuilder.swift */,
762+
5ADDB0020000000000000007 /* DynamoDBStatementGenerator.swift */,
763+
);
764+
path = Plugins/DynamoDBDriverPlugin;
765+
sourceTree = "<group>";
766+
};
727767
5AEA8B412F6808CA0040461A /* Plugins/EtcdDriverPlugin */ = {
728768
isa = PBXGroup;
729769
children = (
@@ -1161,6 +1201,25 @@
11611201
productReference = 5ABCC5A72F43856700EAF3FC /* TableProTests.xctest */;
11621202
productType = "com.apple.product-type.bundle.unit-test";
11631203
};
1204+
5AE460EB2F6CEDB70097AC5B /* DynamoDBDriverPlugin */ = {
1205+
isa = PBXNativeTarget;
1206+
buildConfigurationList = 5AE460EF2F6CEDB80097AC5B /* Build configuration list for PBXNativeTarget "DynamoDBDriverPlugin" */;
1207+
buildPhases = (
1208+
5AE460E82F6CEDB70097AC5B /* Sources */,
1209+
5AE460E92F6CEDB70097AC5B /* Frameworks */,
1210+
5AE460EA2F6CEDB70097AC5B /* Resources */,
1211+
);
1212+
buildRules = (
1213+
);
1214+
dependencies = (
1215+
);
1216+
name = DynamoDBDriverPlugin;
1217+
packageProductDependencies = (
1218+
);
1219+
productName = DynamoDBDriverPlugin;
1220+
productReference = 5AE460EC2F6CEDB70097AC5B /* DynamoDBDriverPlugin.tableplugin */;
1221+
productType = "com.apple.product-type.bundle";
1222+
};
11641223
5AE4F4732F6BC0640097AC5B /* CloudflareD1DriverPlugin */ = {
11651224
isa = PBXNativeTarget;
11661225
buildConfigurationList = 5AE4F4752F6BC0640097AC5B /* Build configuration list for PBXNativeTarget "CloudflareD1DriverPlugin" */;
@@ -1264,6 +1323,9 @@
12641323
CreatedOnToolsVersion = 26.2;
12651324
TestTargetID = 5A1091C62EF17EDC0055EA7C;
12661325
};
1326+
5AE460EB2F6CEDB70097AC5B = {
1327+
CreatedOnToolsVersion = 26.3;
1328+
};
12671329
5AE4F4732F6BC0640097AC5B = {
12681330
CreatedOnToolsVersion = 26.3;
12691331
LastSwiftMigration = 2630;
@@ -1319,6 +1381,7 @@
13191381
5ABCC5A62F43856700EAF3FC /* TableProTests */,
13201382
5AEA8B292F6808270040461A /* EtcdDriverPlugin */,
13211383
5AE4F4732F6BC0640097AC5B /* CloudflareD1DriverPlugin */,
1384+
5AE460EB2F6CEDB70097AC5B /* DynamoDBDriverPlugin */,
13221385
);
13231386
};
13241387
/* End PBXProject section */
@@ -1457,6 +1520,13 @@
14571520
);
14581521
runOnlyForDeploymentPostprocessing = 0;
14591522
};
1523+
5AE460EA2F6CEDB70097AC5B /* Resources */ = {
1524+
isa = PBXResourcesBuildPhase;
1525+
buildActionMask = 2147483647;
1526+
files = (
1527+
);
1528+
runOnlyForDeploymentPostprocessing = 0;
1529+
};
14601530
5AE4F4722F6BC0640097AC5B /* Resources */ = {
14611531
isa = PBXResourcesBuildPhase;
14621532
buildActionMask = 2147483647;
@@ -1607,6 +1677,20 @@
16071677
);
16081678
runOnlyForDeploymentPostprocessing = 0;
16091679
};
1680+
5AE460E82F6CEDB70097AC5B /* Sources */ = {
1681+
isa = PBXSourcesBuildPhase;
1682+
buildActionMask = 2147483647;
1683+
files = (
1684+
5ADDB0010000000000000001 /* DynamoDBConnection.swift in Sources */,
1685+
5ADDB0010000000000000002 /* DynamoDBItemFlattener.swift in Sources */,
1686+
5ADDB0010000000000000003 /* DynamoDBPartiQLParser.swift in Sources */,
1687+
5ADDB0010000000000000004 /* DynamoDBPlugin.swift in Sources */,
1688+
5ADDB0010000000000000005 /* DynamoDBPluginDriver.swift in Sources */,
1689+
5ADDB0010000000000000006 /* DynamoDBQueryBuilder.swift in Sources */,
1690+
5ADDB0010000000000000007 /* DynamoDBStatementGenerator.swift in Sources */,
1691+
);
1692+
runOnlyForDeploymentPostprocessing = 0;
1693+
};
16101694
5AE4F4702F6BC0640097AC5B /* Sources */ = {
16111695
isa = PBXSourcesBuildPhase;
16121696
buildActionMask = 2147483647;
@@ -2952,6 +3036,53 @@
29523036
};
29533037
name = Release;
29543038
};
3039+
5AE460ED2F6CEDB80097AC5B /* Debug */ = {
3040+
isa = XCBuildConfiguration;
3041+
buildSettings = {
3042+
CLANG_ENABLE_MODULES = YES;
3043+
CODE_SIGN_STYLE = Automatic;
3044+
COMBINE_HIDPI_IMAGES = YES;
3045+
CURRENT_PROJECT_VERSION = 1;
3046+
GENERATE_INFOPLIST_FILE = YES;
3047+
INFOPLIST_FILE = Plugins/DynamoDBDriverPlugin/Info.plist;
3048+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
3049+
INFOPLIST_KEY_NSPrincipalClass = "$(PRODUCT_MODULE_NAME).DynamoDBPlugin";
3050+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
3051+
MACOSX_DEPLOYMENT_TARGET = 14.0;
3052+
MARKETING_VERSION = 1.0;
3053+
PRODUCT_BUNDLE_IDENTIFIER = com.TablePro.DynamoDBDriverPlugin;
3054+
PRODUCT_NAME = "$(TARGET_NAME)";
3055+
SDKROOT = macosx;
3056+
SKIP_INSTALL = YES;
3057+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
3058+
SWIFT_VERSION = 5.9;
3059+
WRAPPER_EXTENSION = tableplugin;
3060+
};
3061+
name = Debug;
3062+
};
3063+
5AE460EE2F6CEDB80097AC5B /* Release */ = {
3064+
isa = XCBuildConfiguration;
3065+
buildSettings = {
3066+
CLANG_ENABLE_MODULES = YES;
3067+
CODE_SIGN_STYLE = Automatic;
3068+
COMBINE_HIDPI_IMAGES = YES;
3069+
CURRENT_PROJECT_VERSION = 1;
3070+
GENERATE_INFOPLIST_FILE = YES;
3071+
INFOPLIST_FILE = Plugins/DynamoDBDriverPlugin/Info.plist;
3072+
INFOPLIST_KEY_NSHumanReadableCopyright = "";
3073+
INFOPLIST_KEY_NSPrincipalClass = "$(PRODUCT_MODULE_NAME).DynamoDBPlugin";
3074+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
3075+
MACOSX_DEPLOYMENT_TARGET = 14.0;
3076+
MARKETING_VERSION = 1.0;
3077+
PRODUCT_BUNDLE_IDENTIFIER = com.TablePro.DynamoDBDriverPlugin;
3078+
PRODUCT_NAME = "$(TARGET_NAME)";
3079+
SDKROOT = macosx;
3080+
SKIP_INSTALL = YES;
3081+
SWIFT_VERSION = 5.9;
3082+
WRAPPER_EXTENSION = tableplugin;
3083+
};
3084+
name = Release;
3085+
};
29553086
5AE4F4762F6BC0640097AC5B /* Debug */ = {
29563087
isa = XCBuildConfiguration;
29573088
buildSettings = {
@@ -3230,6 +3361,15 @@
32303361
defaultConfigurationIsVisible = 0;
32313362
defaultConfigurationName = Release;
32323363
};
3364+
5AE460EF2F6CEDB80097AC5B /* Build configuration list for PBXNativeTarget "DynamoDBDriverPlugin" */ = {
3365+
isa = XCConfigurationList;
3366+
buildConfigurations = (
3367+
5AE460ED2F6CEDB80097AC5B /* Debug */,
3368+
5AE460EE2F6CEDB80097AC5B /* Release */,
3369+
);
3370+
defaultConfigurationIsVisible = 0;
3371+
defaultConfigurationName = Release;
3372+
};
32333373
5AE4F4752F6BC0640097AC5B /* Build configuration list for PBXNativeTarget "CloudflareD1DriverPlugin" */ = {
32343374
isa = XCConfigurationList;
32353375
buildConfigurations = (

TablePro/Core/Database/DatabaseManager.swift

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -426,39 +426,61 @@ final class DatabaseManager {
426426
for connection: DatabaseConnection,
427427
sshPasswordOverride: String? = nil
428428
) async throws -> DatabaseConnection {
429-
guard connection.sshConfig.enabled else {
429+
// Resolve SSH configuration: profile takes priority over inline
430+
let sshConfig: SSHConfiguration
431+
let isProfile: Bool
432+
let secretOwnerId: UUID
433+
434+
if let profileId = connection.sshProfileId,
435+
let profile = SSHProfileStorage.shared.profile(for: profileId) {
436+
sshConfig = profile.toSSHConfiguration()
437+
secretOwnerId = profileId
438+
isProfile = true
439+
} else {
440+
sshConfig = connection.sshConfig
441+
secretOwnerId = connection.id
442+
isProfile = false
443+
}
444+
445+
guard sshConfig.enabled else {
430446
return connection
431447
}
432448

433449
// Load Keychain credentials off the main thread to avoid blocking UI
434-
let connectionId = connection.id
435450
let (storedSshPassword, keyPassphrase, totpSecret) = await Task.detached {
436-
let pwd = ConnectionStorage.shared.loadSSHPassword(for: connectionId)
437-
let phrase = ConnectionStorage.shared.loadKeyPassphrase(for: connectionId)
438-
let totp = ConnectionStorage.shared.loadTOTPSecret(for: connectionId)
439-
return (pwd, phrase, totp)
451+
if isProfile {
452+
let pwd = SSHProfileStorage.shared.loadSSHPassword(for: secretOwnerId)
453+
let phrase = SSHProfileStorage.shared.loadKeyPassphrase(for: secretOwnerId)
454+
let totp = SSHProfileStorage.shared.loadTOTPSecret(for: secretOwnerId)
455+
return (pwd, phrase, totp)
456+
} else {
457+
let pwd = ConnectionStorage.shared.loadSSHPassword(for: secretOwnerId)
458+
let phrase = ConnectionStorage.shared.loadKeyPassphrase(for: secretOwnerId)
459+
let totp = ConnectionStorage.shared.loadTOTPSecret(for: secretOwnerId)
460+
return (pwd, phrase, totp)
461+
}
440462
}.value
441463

442464
let sshPassword = sshPasswordOverride ?? storedSshPassword
443465

444466
let tunnelPort = try await SSHTunnelManager.shared.createTunnel(
445467
connectionId: connection.id,
446-
sshHost: connection.sshConfig.host,
447-
sshPort: connection.sshConfig.port,
448-
sshUsername: connection.sshConfig.username,
449-
authMethod: connection.sshConfig.authMethod,
450-
privateKeyPath: connection.sshConfig.privateKeyPath,
468+
sshHost: sshConfig.host,
469+
sshPort: sshConfig.port,
470+
sshUsername: sshConfig.username,
471+
authMethod: sshConfig.authMethod,
472+
privateKeyPath: sshConfig.privateKeyPath,
451473
keyPassphrase: keyPassphrase,
452474
sshPassword: sshPassword,
453-
agentSocketPath: connection.sshConfig.agentSocketPath,
475+
agentSocketPath: sshConfig.agentSocketPath,
454476
remoteHost: connection.host,
455477
remotePort: connection.port,
456-
jumpHosts: connection.sshConfig.jumpHosts,
457-
totpMode: connection.sshConfig.totpMode,
478+
jumpHosts: sshConfig.jumpHosts,
479+
totpMode: sshConfig.totpMode,
458480
totpSecret: totpSecret,
459-
totpAlgorithm: connection.sshConfig.totpAlgorithm,
460-
totpDigits: connection.sshConfig.totpDigits,
461-
totpPeriod: connection.sshConfig.totpPeriod
481+
totpAlgorithm: sshConfig.totpAlgorithm,
482+
totpDigits: sshConfig.totpDigits,
483+
totpPeriod: sshConfig.totpPeriod
462484
)
463485

464486
// Adapt SSL config for tunnel: SSH already authenticates the server,

0 commit comments

Comments
 (0)