From 3eaf155071d92f7dbe5b61aeb915ad3211d1668f Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 29 Nov 2020 15:40:52 -0800 Subject: [PATCH 01/12] Changed SSH key comment Signed-off-by: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> --- Secretive/Views/SecretDetailView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index e1878dd3..2fd31a36 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -21,19 +21,19 @@ struct SecretDetailView: View { .frame(minHeight: 200, maxHeight: .infinity) } - var dashedKeyName: String { - secret.name.replacingOccurrences(of: " ", with: "-") + var dashedUserName: String { + NSUserName().replacingOccurrences(of: " ", with: "-") } var dashedHostName: String { - ["secretive", Host.current().localizedName, "local"] + [Host.current().localizedName, "local"] .compactMap { $0 } .joined(separator: ".") .replacingOccurrences(of: " ", with: "-") } var keyString: String { - keyWriter.openSSHString(secret: secret, comment: "\(dashedKeyName)@\(dashedHostName)") + keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") } func copy() { From e6e290292245180584a57b085215ab3a1984e460 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 29 Nov 2020 21:15:59 -0800 Subject: [PATCH 02/12] Added comment option when generating key --- Secretive/Views/CreateSecretView.swift | 20 +++++++++++++++++++- Secretive/Views/SecretDetailView.swift | 8 +++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Secretive/Views/CreateSecretView.swift b/Secretive/Views/CreateSecretView.swift index 5753932b..bd500b8f 100644 --- a/Secretive/Views/CreateSecretView.swift +++ b/Secretive/Views/CreateSecretView.swift @@ -5,9 +5,10 @@ struct CreateSecretView: View { @ObservedObject var store: StoreType @Binding var showing: Bool - + @State private var comment = "" @State private var name = "" @State private var requiresAuthentication = true + let defaults = UserDefaults.standard var body: some View { VStack { @@ -25,6 +26,10 @@ struct CreateSecretView: View { Text("Name:") TextField("Shhhhh", text: $name).focusable() } + HStack { + Text("Comment:") + TextField("\(dashedUserName)@\(dashedHostName)", text: $comment).focusable() + } HStack { Toggle(isOn: $requiresAuthentication) { Text("Requires Authentication (Biometrics or Password)") @@ -45,9 +50,22 @@ struct CreateSecretView: View { } }.padding() } + var dashedUserName: String { + NSUserName().replacingOccurrences(of: " ", with: "-") + } + var dashedHostName: String { + [Host.current().localizedName, "local"] + .compactMap { $0 } + .joined(separator: ".") + .replacingOccurrences(of: " ", with: "-") + } func save() { try! store.create(name: name, requiresAuthentication: requiresAuthentication) + if comment != "" { + defaults.set(comment, forKey: name) + } + defaults.set(comment, forKey: name) showing = false } } diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index 2fd31a36..ef23e2cd 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -5,6 +5,8 @@ struct SecretDetailView: View { @State var secret: SecretType + let defaults = UserDefaults.standard + private let keyWriter = OpenSSHKeyWriter() var body: some View { @@ -33,7 +35,11 @@ struct SecretDetailView: View { } var keyString: String { - keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") + if defaults.string(forKey: secret.name) != "" { + return keyWriter.openSSHString(secret: secret, comment: defaults.string(forKey: secret.name)) + } else { + return keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") + } } func copy() { From f4564655ff445a7514046605180d4e1c7e4959b0 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Mon, 30 Nov 2020 00:15:58 -0800 Subject: [PATCH 03/12] Allowed setup to properly show for all builds --- Secretive/Controllers/ShellConfigurationController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Secretive/Controllers/ShellConfigurationController.swift b/Secretive/Controllers/ShellConfigurationController.swift index 75b06147..be1f42ac 100644 --- a/Secretive/Controllers/ShellConfigurationController.swift +++ b/Secretive/Controllers/ShellConfigurationController.swift @@ -3,7 +3,7 @@ import Cocoa struct ShellConfigurationController { - let socketPath = (NSHomeDirectory().replacingOccurrences(of: "com.maxgoedjen.Secretive.Host", with: "com.maxgoedjen.Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String + let socketPath = (NSHomeDirectory().replacingOccurrences(of: "Secretive.Host", with: "Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String var shellInstructions: [ShellConfigInstruction] { [ From 9c4b4ac39eff2b55c5fa6e374d745cb12ebac7a1 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Mon, 30 Nov 2020 00:47:31 -0800 Subject: [PATCH 04/12] Fixed rest of app for non-standard build --- Secretive/Controllers/AgentStatusChecker.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Secretive/Controllers/AgentStatusChecker.swift b/Secretive/Controllers/AgentStatusChecker.swift index d09cd32f..ab333845 100644 --- a/Secretive/Controllers/AgentStatusChecker.swift +++ b/Secretive/Controllers/AgentStatusChecker.swift @@ -9,6 +9,7 @@ protocol AgentStatusCheckerProtocol: ObservableObject { class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { @Published var running: Bool = false + let bundleID = Bundle.main.bundleIdentifier?.replacingOccurrences(of: "Host", with: "SecretAgent") init() { check() @@ -20,7 +21,7 @@ class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { // All processes, including ones from older versions, etc var secretAgentProcesses: [NSRunningApplication] { - NSRunningApplication.runningApplications(withBundleIdentifier: Constants.secretAgentAppID) + NSRunningApplication.runningApplications(withBundleIdentifier: bundleID ?? "com.maxgoedjen.Secretive.SecretAgent") } // The process corresponding to this instance of Secretive @@ -37,10 +38,4 @@ class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { } -extension AgentStatusChecker { - enum Constants { - static let secretAgentAppID = "com.maxgoedjen.Secretive.SecretAgent" - } - -} From 670bfb17d558b7a086ac5fa374e01cf374f83d46 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Mon, 30 Nov 2020 18:25:52 -0800 Subject: [PATCH 05/12] Allows auto-launch for every user's build --- Secretive/Controllers/AgentStatusChecker.swift | 4 ++-- Secretive/Controllers/LaunchAgentController.swift | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Secretive/Controllers/AgentStatusChecker.swift b/Secretive/Controllers/AgentStatusChecker.swift index ab333845..04b7c0a3 100644 --- a/Secretive/Controllers/AgentStatusChecker.swift +++ b/Secretive/Controllers/AgentStatusChecker.swift @@ -9,7 +9,7 @@ protocol AgentStatusCheckerProtocol: ObservableObject { class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { @Published var running: Bool = false - let bundleID = Bundle.main.bundleIdentifier?.replacingOccurrences(of: "Host", with: "SecretAgent") + let bundleID = Bundle.main.bundleIdentifier!.replacingOccurrences(of: "Host", with: "SecretAgent") init() { check() @@ -21,7 +21,7 @@ class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { // All processes, including ones from older versions, etc var secretAgentProcesses: [NSRunningApplication] { - NSRunningApplication.runningApplications(withBundleIdentifier: bundleID ?? "com.maxgoedjen.Secretive.SecretAgent") + NSRunningApplication.runningApplications(withBundleIdentifier: bundleID ) } // The process corresponding to this instance of Secretive diff --git a/Secretive/Controllers/LaunchAgentController.swift b/Secretive/Controllers/LaunchAgentController.swift index 97915f8c..6d9cf23d 100644 --- a/Secretive/Controllers/LaunchAgentController.swift +++ b/Secretive/Controllers/LaunchAgentController.swift @@ -4,7 +4,8 @@ import AppKit import OSLog struct LaunchAgentController { - + + let bundleID = Bundle.main.bundleIdentifier!.replacingOccurrences(of: "Host", with: "SecretAgent") func install(completion: (() -> Void)? = nil) { Logger().debug("Installing agent") _ = setEnabled(false) @@ -32,7 +33,7 @@ struct LaunchAgentController { } private func setEnabled(_ enabled: Bool) -> Bool { - SMLoginItemSetEnabled("com.maxgoedjen.Secretive.SecretAgent" as CFString, enabled) + SMLoginItemSetEnabled(bundleID as CFString, enabled) } } From edeb603ce0d73a5f599b05f96a94774a59f663d1 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 27 Dec 2020 17:07:56 -0800 Subject: [PATCH 06/12] made a Bundle extension in SecretKit with hostBundleID and agentBundleID properties --- SecretKit/Common/bundleIDs.swift | 15 +++++++++++++++ Secretive/Controllers/AgentStatusChecker.swift | 4 ++-- Secretive/Controllers/LaunchAgentController.swift | 4 ++-- .../ShellConfigurationController.swift | 3 ++- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 SecretKit/Common/bundleIDs.swift diff --git a/SecretKit/Common/bundleIDs.swift b/SecretKit/Common/bundleIDs.swift new file mode 100644 index 00000000..bb651c88 --- /dev/null +++ b/SecretKit/Common/bundleIDs.swift @@ -0,0 +1,15 @@ +// +// bundleIDs.swift +// SecretKit +// +// Created by Alex lavallee on 12/27/20. +// Copyright © 2020 Max Goedjen. All rights reserved. +// + +import Foundation + + +extension Bundle { + public var agentBundleID: String {(self.bundleIdentifier?.replacingOccurrences(of: "Host", with: "SecretAgent"))!} + public var hostBundleID: String {(self.bundleIdentifier?.replacingOccurrences(of: "SecretAgent", with: "Host"))!} +} diff --git a/Secretive/Controllers/AgentStatusChecker.swift b/Secretive/Controllers/AgentStatusChecker.swift index 04b7c0a3..c8c04656 100644 --- a/Secretive/Controllers/AgentStatusChecker.swift +++ b/Secretive/Controllers/AgentStatusChecker.swift @@ -1,6 +1,7 @@ import Foundation import Combine import AppKit +import SecretKit protocol AgentStatusCheckerProtocol: ObservableObject { var running: Bool { get } @@ -9,7 +10,6 @@ protocol AgentStatusCheckerProtocol: ObservableObject { class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { @Published var running: Bool = false - let bundleID = Bundle.main.bundleIdentifier!.replacingOccurrences(of: "Host", with: "SecretAgent") init() { check() @@ -21,7 +21,7 @@ class AgentStatusChecker: ObservableObject, AgentStatusCheckerProtocol { // All processes, including ones from older versions, etc var secretAgentProcesses: [NSRunningApplication] { - NSRunningApplication.runningApplications(withBundleIdentifier: bundleID ) + NSRunningApplication.runningApplications(withBundleIdentifier: Bundle.main.agentBundleID) } // The process corresponding to this instance of Secretive diff --git a/Secretive/Controllers/LaunchAgentController.swift b/Secretive/Controllers/LaunchAgentController.swift index 6d9cf23d..1f3ef5d2 100644 --- a/Secretive/Controllers/LaunchAgentController.swift +++ b/Secretive/Controllers/LaunchAgentController.swift @@ -2,10 +2,10 @@ import Foundation import ServiceManagement import AppKit import OSLog +import SecretKit struct LaunchAgentController { - let bundleID = Bundle.main.bundleIdentifier!.replacingOccurrences(of: "Host", with: "SecretAgent") func install(completion: (() -> Void)? = nil) { Logger().debug("Installing agent") _ = setEnabled(false) @@ -33,7 +33,7 @@ struct LaunchAgentController { } private func setEnabled(_ enabled: Bool) -> Bool { - SMLoginItemSetEnabled(bundleID as CFString, enabled) + SMLoginItemSetEnabled(Bundle.main.agentBundleID as CFString, enabled) } } diff --git a/Secretive/Controllers/ShellConfigurationController.swift b/Secretive/Controllers/ShellConfigurationController.swift index be1f42ac..a7f2096b 100644 --- a/Secretive/Controllers/ShellConfigurationController.swift +++ b/Secretive/Controllers/ShellConfigurationController.swift @@ -1,9 +1,10 @@ import Foundation import Cocoa +import SecretKit struct ShellConfigurationController { - let socketPath = (NSHomeDirectory().replacingOccurrences(of: "Secretive.Host", with: "Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String + let socketPath = (NSHomeDirectory().replacingOccurrences(of: Bundle.main.hostBundleID, with: Bundle.main.agentBundleID) as NSString).appendingPathComponent("socket.ssh") as String var shellInstructions: [ShellConfigInstruction] { [ From 33bad0a26433ec3fdbf6dcdc5e53595a958c9507 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:03:35 -0800 Subject: [PATCH 07/12] Fixed project.pbxproj --- Secretive.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Secretive.xcodeproj/project.pbxproj b/Secretive.xcodeproj/project.pbxproj index ef8acc9a..f64ce058 100644 --- a/Secretive.xcodeproj/project.pbxproj +++ b/Secretive.xcodeproj/project.pbxproj @@ -84,6 +84,7 @@ 50BB046B2418AAAE00D6E079 /* EmptyStoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BB046A2418AAAE00D6E079 /* EmptyStoreView.swift */; }; 50C385A3240789E600AF2719 /* OpenSSHReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C385A2240789E600AF2719 /* OpenSSHReader.swift */; }; 50C385A52407A76D00AF2719 /* SecretDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C385A42407A76D00AF2719 /* SecretDetailView.swift */; }; + FA0B34672599619E0013AB3A /* bundleIDs.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B34662599619E0013AB3A /* bundleIDs.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -302,6 +303,7 @@ 50BB046A2418AAAE00D6E079 /* EmptyStoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyStoreView.swift; sourceTree = ""; }; 50C385A2240789E600AF2719 /* OpenSSHReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSSHReader.swift; path = SecretKit/Common/OpenSSH/OpenSSHReader.swift; sourceTree = SOURCE_ROOT; }; 50C385A42407A76D00AF2719 /* SecretDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretDetailView.swift; sourceTree = ""; }; + FA0B34662599619E0013AB3A /* bundleIDs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = bundleIDs.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -583,6 +585,7 @@ 5068389F2415EA4F00F55094 /* Erasers */, 506838A42415EA6800F55094 /* OpenSSH */, 5068389D241471CD00F55094 /* SecretStoreList.swift */, + FA0B34662599619E0013AB3A /* bundleIDs.swift */, ); path = Common; sourceTree = ""; @@ -1026,6 +1029,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + FA0B34672599619E0013AB3A /* bundleIDs.swift in Sources */, 501B7AE1251C56F700776EC7 /* SigningRequestProvenance.swift in Sources */, 50617DC723FCE4EA0099B055 /* SecretStore.swift in Sources */, 5099A02723FE34FA0062B6F2 /* SmartCard.swift in Sources */, From cbb22b2a9f78c34f3250b7b6a1ffb559fdf941fe Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:06:16 -0800 Subject: [PATCH 08/12] Removed default Xcode comment --- SecretKit/Common/bundleIDs.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/SecretKit/Common/bundleIDs.swift b/SecretKit/Common/bundleIDs.swift index bb651c88..de4967dc 100644 --- a/SecretKit/Common/bundleIDs.swift +++ b/SecretKit/Common/bundleIDs.swift @@ -1,11 +1,3 @@ -// -// bundleIDs.swift -// SecretKit -// -// Created by Alex lavallee on 12/27/20. -// Copyright © 2020 Max Goedjen. All rights reserved. -// - import Foundation From aac15f91e4334f9ef8ee89c64dccaf404124b0e2 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 17 Jan 2021 21:37:07 -0800 Subject: [PATCH 09/12] Change hard-coded bundleID to automatically retrieved one --- Secretive/Views/CreateSecretView.swift | 20 +------------------- Secretive/Views/SecretDetailView.swift | 8 +------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/Secretive/Views/CreateSecretView.swift b/Secretive/Views/CreateSecretView.swift index bd500b8f..5753932b 100644 --- a/Secretive/Views/CreateSecretView.swift +++ b/Secretive/Views/CreateSecretView.swift @@ -5,10 +5,9 @@ struct CreateSecretView: View { @ObservedObject var store: StoreType @Binding var showing: Bool - @State private var comment = "" + @State private var name = "" @State private var requiresAuthentication = true - let defaults = UserDefaults.standard var body: some View { VStack { @@ -26,10 +25,6 @@ struct CreateSecretView: View { Text("Name:") TextField("Shhhhh", text: $name).focusable() } - HStack { - Text("Comment:") - TextField("\(dashedUserName)@\(dashedHostName)", text: $comment).focusable() - } HStack { Toggle(isOn: $requiresAuthentication) { Text("Requires Authentication (Biometrics or Password)") @@ -50,22 +45,9 @@ struct CreateSecretView: View { } }.padding() } - var dashedUserName: String { - NSUserName().replacingOccurrences(of: " ", with: "-") - } - var dashedHostName: String { - [Host.current().localizedName, "local"] - .compactMap { $0 } - .joined(separator: ".") - .replacingOccurrences(of: " ", with: "-") - } func save() { try! store.create(name: name, requiresAuthentication: requiresAuthentication) - if comment != "" { - defaults.set(comment, forKey: name) - } - defaults.set(comment, forKey: name) showing = false } } diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index ef7e0062..cbe76bc7 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -5,8 +5,6 @@ struct SecretDetailView: View { @State var secret: SecretType - let defaults = UserDefaults.standard - private let keyWriter = OpenSSHKeyWriter() var body: some View { @@ -38,11 +36,7 @@ struct SecretDetailView: View { } var keyString: String { - if defaults.string(forKey: secret.name) != "" { - return keyWriter.openSSHString(secret: secret, comment: defaults.string(forKey: secret.name)) - } else { - return keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") - } + keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") } func copy() { From eeb6387839081f631cf5477888f6d5292a1665c8 Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Sun, 17 Jan 2021 22:56:08 -0800 Subject: [PATCH 10/12] Rename bundleIDs.swift Removed incorrectly added changes --- SecretKit/Common/{bundleIDs.swift => BundleIDs.swift} | 0 Secretive.xcodeproj/project.pbxproj | 8 ++++---- Secretive/Views/SecretDetailView.swift | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename SecretKit/Common/{bundleIDs.swift => BundleIDs.swift} (100%) diff --git a/SecretKit/Common/bundleIDs.swift b/SecretKit/Common/BundleIDs.swift similarity index 100% rename from SecretKit/Common/bundleIDs.swift rename to SecretKit/Common/BundleIDs.swift diff --git a/Secretive.xcodeproj/project.pbxproj b/Secretive.xcodeproj/project.pbxproj index 847f5364..cad1ecfd 100644 --- a/Secretive.xcodeproj/project.pbxproj +++ b/Secretive.xcodeproj/project.pbxproj @@ -86,7 +86,7 @@ 50BB046B2418AAAE00D6E079 /* EmptyStoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BB046A2418AAAE00D6E079 /* EmptyStoreView.swift */; }; 50C385A3240789E600AF2719 /* OpenSSHReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C385A2240789E600AF2719 /* OpenSSHReader.swift */; }; 50C385A52407A76D00AF2719 /* SecretDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C385A42407A76D00AF2719 /* SecretDetailView.swift */; }; - FA0B34672599619E0013AB3A /* bundleIDs.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B34662599619E0013AB3A /* bundleIDs.swift */; }; + FA0B34672599619E0013AB3A /* BundleIDs.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B34662599619E0013AB3A /* BundleIDs.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -307,7 +307,7 @@ 50BB046A2418AAAE00D6E079 /* EmptyStoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyStoreView.swift; sourceTree = ""; }; 50C385A2240789E600AF2719 /* OpenSSHReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OpenSSHReader.swift; path = SecretKit/Common/OpenSSH/OpenSSHReader.swift; sourceTree = SOURCE_ROOT; }; 50C385A42407A76D00AF2719 /* SecretDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretDetailView.swift; sourceTree = ""; }; - FA0B34662599619E0013AB3A /* bundleIDs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = bundleIDs.swift; sourceTree = ""; }; + FA0B34662599619E0013AB3A /* BundleIDs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleIDs.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -590,7 +590,7 @@ 5068389F2415EA4F00F55094 /* Erasers */, 506838A42415EA6800F55094 /* OpenSSH */, 5068389D241471CD00F55094 /* SecretStoreList.swift */, - FA0B34662599619E0013AB3A /* bundleIDs.swift */, + FA0B34662599619E0013AB3A /* BundleIDs.swift */, ); path = Common; sourceTree = ""; @@ -1037,7 +1037,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FA0B34672599619E0013AB3A /* bundleIDs.swift in Sources */, + FA0B34672599619E0013AB3A /* BundleIDs.swift in Sources */, 501B7AE1251C56F700776EC7 /* SigningRequestProvenance.swift in Sources */, 50617DC723FCE4EA0099B055 /* SecretStore.swift in Sources */, 5099A02723FE34FA0062B6F2 /* SmartCard.swift in Sources */, diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index cbe76bc7..ed20ae10 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -24,12 +24,12 @@ struct SecretDetailView: View { .frame(minHeight: 200, maxHeight: .infinity) } - var dashedUserName: String { - NSUserName().replacingOccurrences(of: " ", with: "-") + var dashedKeyName: String { + secret.name.replacingOccurrences(of: " ", with: "-") } var dashedHostName: String { - [Host.current().localizedName, "local"] + ["secretive", Host.current().localizedName, "local"] .compactMap { $0 } .joined(separator: ".") .replacingOccurrences(of: " ", with: "-") From 5b6e6dd3f3aaafd249fe9ba2193dcecec357dd3f Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Mon, 18 Jan 2021 00:55:57 -0800 Subject: [PATCH 11/12] Changed key name to user name --- Secretive/Views/SecretDetailView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index ed20ae10..32411a45 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -24,10 +24,10 @@ struct SecretDetailView: View { .frame(minHeight: 200, maxHeight: .infinity) } - var dashedKeyName: String { - secret.name.replacingOccurrences(of: " ", with: "-") + var dashedUserName: String { + NSUserName().replacingOccurrences(of: " ", with: "-") } - + var dashedHostName: String { ["secretive", Host.current().localizedName, "local"] .compactMap { $0 } From e53b7966709615d22dd1a2b530c58414550433bd Mon Sep 17 00:00:00 2001 From: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com> Date: Mon, 18 Jan 2021 09:53:58 -0800 Subject: [PATCH 12/12] Changed username to key name --- Secretive/Views/SecretDetailView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index 32411a45..f8c7d12b 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -24,8 +24,8 @@ struct SecretDetailView: View { .frame(minHeight: 200, maxHeight: .infinity) } - var dashedUserName: String { - NSUserName().replacingOccurrences(of: " ", with: "-") + var dashedKeyName: String { + secret.name.replacingOccurrences(of: " ", with: "-") } var dashedHostName: String { @@ -36,7 +36,7 @@ struct SecretDetailView: View { } var keyString: String { - keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)") + keyWriter.openSSHString(secret: secret, comment: "\(dashedKeyName)@\(dashedHostName)") } func copy() {