Abstracted bundle prefix

This commit is contained in:
Maxwell Swadling
2023-03-12 15:01:45 +10:00
parent 12a8f1698b
commit 1bd724c8bf
15 changed files with 100 additions and 33 deletions

View File

@@ -16,11 +16,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
list.add(store: SmartCard.Store())
return list
}()
private let updater = Updater(checkOnLaunch: false)
private let updater = Updater(checkOnLaunch: false, bundlePrefix: BundlePrefix)
private let notifier = Notifier()
private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: NSHomeDirectory())
private lazy var agent: Agent = {
Agent(storeList: storeList, witness: notifier)
Agent(storeList: storeList, bundlePrefix: BundlePrefix, witness: notifier)
}()
private lazy var socketController: SocketController = {
let path = (NSHomeDirectory() as NSString).appendingPathComponent("socket.ssh") as String

View File

@@ -117,18 +117,18 @@ extension Notifier {
enum Constants {
// Update notifications
static let updateCategoryIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.update"
static let criticalUpdateCategoryIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.update.critical"
static let updateActionIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.update.updateaction"
static let ignoreActionIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.update.ignoreaction"
static let updateCategoryIdentitifier = BundlePrefix + ".SecretAgent.update"
static let criticalUpdateCategoryIdentitifier = BundlePrefix + ".SecretAgent.update.critical"
static let updateActionIdentitifier = BundlePrefix + ".SecretAgent.update.updateaction"
static let ignoreActionIdentitifier = BundlePrefix + ".SecretAgent.update.ignoreaction"
// Authorization persistence notificatoins
static let persistAuthenticationCategoryIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.persistauthentication"
static let doNotPersistActionIdentitifier = "com.maxgoedjen.Secretive.SecretAgent.persistauthentication.donotpersist"
static let persistForActionIdentitifierPrefix = "com.maxgoedjen.Secretive.SecretAgent.persistauthentication.persist."
static let persistAuthenticationCategoryIdentitifier = BundlePrefix + ".SecretAgent.persistauthentication"
static let doNotPersistActionIdentitifier = BundlePrefix + ".SecretAgent.persistauthentication.donotpersist"
static let persistForActionIdentitifierPrefix = BundlePrefix + ".SecretAgent.persistauthentication.persist."
static let persistSecretIDKey = "com.maxgoedjen.Secretive.SecretAgent.persistauthentication.secretidkey"
static let persistStoreIDKey = "com.maxgoedjen.Secretive.SecretAgent.persistauthentication.storeidkey"
static let persistSecretIDKey = BundlePrefix + ".SecretAgent.persistauthentication.secretidkey"
static let persistStoreIDKey = BundlePrefix + ".SecretAgent.persistauthentication.storeidkey"
}
}

View File

@@ -0,0 +1,7 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <Foundation/Foundation.h>
extern NSString *const BundlePrefix;

View File

@@ -10,7 +10,7 @@
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.maxgoedjen.Secretive</string>
<string>$(AppIdentifierPrefix)$(BUNDLE_PREFIX)</string>
</array>
</dict>
</plist>