A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.
C++
feat(ssl): add mTLS support for Teleport tunnels + add CI workflow
Tobi4708ef2e2366
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 0000000..eeb5f06--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,33 @@+name: CI++on:+ push:+ branches: [main]+ pull_request:+ branches: [main]++jobs:+ build-macos:+ name: Build macOS+ runs-on: macos-14+ timeout-minutes: 30++ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Select Xcode+ run: |+ XCODE=$(ls /Applications | grep "^Xcode" | sort -V | tail -1)+ sudo xcode-select -s "/Applications/$XCODE/Contents/Developer"+ swift --version+ xcodebuild -version++ - name: Resolve dependencies+ run: swift package resolve++ - name: Build (Debug)+ run: swift build++ - name: Build (Release)+ run: swift build -c releasediff --git a/macos/Core/Models/Database/ConnectionConfig.swift b/macos/Core/Models/Database/ConnectionConfig.swiftindex ebe4536..578e4a3 100644--- a/macos/Core/Models/Database/ConnectionConfig.swift+++ b/macos/Core/Models/Database/ConnectionConfig.swift@@ -17,6 +17,11 @@ struct ConnectionConfig: Codable, Sendable, Hashable, Identifiable {var colorTag: ColorTag?var group: String?+ // SSL/TLS certificates (for mTLS, e.g., Teleport)+ var sslKeyPath: String?+ var sslCertPath: String?+ var sslCACertPath: String?+// SQLite-specificvar filePath: String?@@ -34,6 +39,9 @@ struct ConnectionConfig: Codable, Sendable, Hashable, Identifiable {sslEnabled: Bool = false,colorTag: ColorTag? = nil,group: String? = nil,+ sslKeyPath: String? = nil,+ sslCertPath: String? = nil,+ sslCACertPath: String? = nil,filePath: String? = nil,sshConfig: SSHTunnelConfig? = nil) {@@ -47,6 +55,9 @@ struct ConnectionConfig: Codable, Sendable, Hashable, Identifiable {self.sslEnabled = sslEnabledself.colorTag = colorTagself.group = group+ self.sslKeyPath = sslKeyPath+ self.sslCertPath = sslCertPath+ self.sslCACertPath = sslCACertPathself.filePath = filePathself.sshConfig = sshConfig}diff --git a/macos/Data/Adapters/PostgreSQL/PostgreSQLAdapter.swift b/macos/Data/Adapters/PostgreSQL/PostgreSQLAdapter.swiftindex a501003..755f0d2 100644--- a/macos/Data/Adapters/PostgreSQL/PostgreSQLAdapter.swift+++ b/macos/Data/Adapters/PostgreSQL/PostgreSQLAdapter.swift@@ -31,7 +31,24 @@ final class PostgreSQLAdapter: DatabaseAdapter, SchemaInspectable, @unchecked Selet tlsConfig: PostgresClient.Configuration.TLSif config.sslEnabled {var tls = TLSConfiguration.makeClientConfiguration()- tls.certificateVerification = .none++ // Load client certificate and key for mTLS (e.g., Teleport)+ if let certPath = config.sslCertPath, !certPath.isEmpty,+ let keyPath = config.sslKeyPath, !keyPath.isEmpty {+ let cert = try NIOSSLCertificate.fromPEMFile(certPath)+ let key = try NIOSSLPrivateKey(file: keyPath, format: .pem)+ tls.certificateChain = cert.map { .certificate($0) }+ tls.privateKey = .privateKey(key)+ }++ // Load CA certificate for server verification+ if let caPath = config.sslCACertPath, !caPath.isEmpty {+ tls.trustRoots = .file(caPath)+ tls.certificateVerification = .fullVerification+ } else {+ tls.certificateVerification = .none+ }+tlsConfig = .prefer(tls)} else {tlsConfig = .disablediff --git a/macos/Presentation/Views/ConnectionForm/ConnectionFormView.swift b/macos/Presentation/Views/ConnectionForm/ConnectionFormView.swiftindex ee4a09a..3b4a334 100644--- a/macos/Presentation/Views/ConnectionForm/ConnectionFormView.swift+++ b/macos/Presentation/Views/ConnectionForm/ConnectionFormView.swift@@ -376,6 +376,11 @@ struct ConnectionFormView: View {colorTag = config.colorTag ?? .bluesqliteFilePath = config.filePath ?? ""+ // SSL certificates (for mTLS)+ sslKeyPath = config.sslKeyPath ?? ""+ sslCertPath = config.sslCertPath ?? ""+ sslCACertPath = config.sslCACertPath ?? ""+if let ssh = config.sshConfig {sshEnabled = truesshHost = ssh.host@@ -435,6 +440,9 @@ struct ConnectionFormView: View {sslEnabled: isFileDB ? false : sslEnabled,colorTag: colorTag,group: existingConfig?.group,+ sslKeyPath: sslKeyPath.isEmpty ? nil : sslKeyPath,+ sslCertPath: sslCertPath.isEmpty ? nil : sslCertPath,+ sslCACertPath: sslCACertPath.isEmpty ? nil : sslCACertPath,filePath: databaseType == .sqlite ? sqliteFilePath : nil,sshConfig: sshConfig)