Skip to content

Commit 974574d

Browse files
authored
[COASTAL-1291] added tidepool security plugin (#593)
* added tidepool security plugin * refactor to provide security provider to pump manager * response to comments * response to PR comments * response to PR comment * fixed unit tests * all active plugins * corrected typo * corrected file name
1 parent b5351cd commit 974574d

21 files changed

+365
-112
lines changed

Common/Models/PumpManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import MockKit
1212
import MockKitUI
1313

1414
let staticPumpManagersByIdentifier: [String: PumpManagerUI.Type] = [
15-
MockPumpManager.managerIdentifier : MockPumpManager.self
15+
MockPumpManager.pluginIdentifier : MockPumpManager.self
1616
]
1717

1818
var availableStaticPumpManagers: [PumpManagerDescriptor] {
1919
if FeatureFlags.allowSimulators {
2020
return [
21-
PumpManagerDescriptor(identifier: MockPumpManager.managerIdentifier, localizedTitle: MockPumpManager.localizedTitle)
21+
PumpManagerDescriptor(identifier: MockPumpManager.pluginIdentifier, localizedTitle: MockPumpManager.localizedTitle)
2222
]
2323
} else {
2424
return []
@@ -31,7 +31,7 @@ extension PumpManager {
3131

3232
var rawValue: RawValue {
3333
return [
34-
"managerIdentifier": self.managerIdentifier,
34+
"managerIdentifier": self.pluginIdentifier,
3535
"state": self.rawState
3636
]
3737
}

Loop.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@
374374
B42D124328D371C400E43D22 /* AlertMuter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42D124228D371C400E43D22 /* AlertMuter.swift */; };
375375
B43CF07E29434EC4008A520B /* HowMuteAlertWorkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B43CF07D29434EC4008A520B /* HowMuteAlertWorkView.swift */; };
376376
B43DA44124D9C12100CAFF4E /* DismissibleHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B43DA44024D9C12100CAFF4E /* DismissibleHostingController.swift */; };
377+
B470F5842AB22B5100049695 /* StatefulPluggable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B470F5832AB22B5100049695 /* StatefulPluggable.swift */; };
377378
B48B0BAC24900093009A48DE /* PumpStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B48B0BAB24900093009A48DE /* PumpStatusHUDView.swift */; };
378379
B490A03F24D0550F00F509FA /* GlucoseRangeCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A03E24D0550F00F509FA /* GlucoseRangeCategory.swift */; };
379380
B490A04124D0559D00F509FA /* DeviceLifecycleProgressState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B490A04024D0559D00F509FA /* DeviceLifecycleProgressState.swift */; };
@@ -387,6 +388,7 @@
387388
B4CAD8792549D2540057946B /* LoopCompletionFreshnessTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4CAD8782549D2540057946B /* LoopCompletionFreshnessTests.swift */; };
388389
B4D4534128E5CA7900F1A8D9 /* AlertMuterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4D4534028E5CA7900F1A8D9 /* AlertMuterTests.swift */; };
389390
B4D620D424D9EDB900043B3C /* GuidanceColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4D620D324D9EDB900043B3C /* GuidanceColors.swift */; };
391+
B4D904412AA8989100CBD826 /* StatefulPluginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4D904402AA8989100CBD826 /* StatefulPluginManager.swift */; };
390392
B4E202302661063E009421B5 /* AutomaticDosingStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E2022F2661063E009421B5 /* AutomaticDosingStatus.swift */; };
391393
B4E96D4B248A6B6E002DABAD /* DeviceStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E96D4A248A6B6E002DABAD /* DeviceStatusHUDView.swift */; };
392394
B4E96D4F248A6E20002DABAD /* CGMStatusHUDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E96D4E248A6E20002DABAD /* CGMStatusHUDView.swift */; };
@@ -1297,6 +1299,7 @@
12971299
B42D124228D371C400E43D22 /* AlertMuter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertMuter.swift; sourceTree = "<group>"; };
12981300
B43CF07D29434EC4008A520B /* HowMuteAlertWorkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HowMuteAlertWorkView.swift; sourceTree = "<group>"; };
12991301
B43DA44024D9C12100CAFF4E /* DismissibleHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissibleHostingController.swift; sourceTree = "<group>"; };
1302+
B470F5832AB22B5100049695 /* StatefulPluggable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatefulPluggable.swift; sourceTree = "<group>"; };
13001303
B48B0BAB24900093009A48DE /* PumpStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpStatusHUDView.swift; sourceTree = "<group>"; };
13011304
B490A03C24D04F9400F509FA /* Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.swift; sourceTree = "<group>"; };
13021305
B490A03E24D0550F00F509FA /* GlucoseRangeCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlucoseRangeCategory.swift; sourceTree = "<group>"; };
@@ -1307,6 +1310,7 @@
13071310
B4CAD8782549D2540057946B /* LoopCompletionFreshnessTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoopCompletionFreshnessTests.swift; sourceTree = "<group>"; };
13081311
B4D4534028E5CA7900F1A8D9 /* AlertMuterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertMuterTests.swift; sourceTree = "<group>"; };
13091312
B4D620D324D9EDB900043B3C /* GuidanceColors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidanceColors.swift; sourceTree = "<group>"; };
1313+
B4D904402AA8989100CBD826 /* StatefulPluginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatefulPluginManager.swift; sourceTree = "<group>"; };
13101314
B4E2022F2661063E009421B5 /* AutomaticDosingStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomaticDosingStatus.swift; sourceTree = "<group>"; };
13111315
B4E96D4A248A6B6E002DABAD /* DeviceStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceStatusHUDView.swift; sourceTree = "<group>"; };
13121316
B4E96D4E248A6E20002DABAD /* CGMStatusHUDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGMStatusHUDView.swift; sourceTree = "<group>"; };
@@ -2293,10 +2297,12 @@
22932297
43C094491CACCC73001F6403 /* NotificationManager.swift */,
22942298
A97F250725E056D500F0EE19 /* OnboardingManager.swift */,
22952299
432E73CA1D24B3D6009AD15D /* RemoteDataServicesManager.swift */,
2300+
B4D904402AA8989100CBD826 /* StatefulPluginManager.swift */,
22962301
A9C62D852331703000535612 /* Service.swift */,
22972302
A9C62D872331703000535612 /* ServicesManager.swift */,
22982303
C1F7822527CC056900C0919A /* SettingsManager.swift */,
22992304
E9BB27AA23B85C3500FB4987 /* SleepStore.swift */,
2305+
B470F5832AB22B5100049695 /* StatefulPluggable.swift */,
23002306
43FCEEA8221A615B0013DD30 /* StatusChartsManager.swift */,
23012307
1D63DEA426E950D400F46FA5 /* SupportManager.swift */,
23022308
4F70C20F1DE8FAC5006380B7 /* ExtensionDataManager.swift */,
@@ -3653,10 +3659,12 @@
36533659
B4FEEF7D24B8A71F00A8DF9B /* DeviceDataManager+DeviceStatus.swift in Sources */,
36543660
142CB7592A60BF2E0075748A /* EditMode.swift in Sources */,
36553661
E95D380324EADF36005E2F50 /* CarbStoreProtocol.swift in Sources */,
3662+
B470F5842AB22B5100049695 /* StatefulPluggable.swift in Sources */,
36563663
E98A55ED24EDD6380008715D /* LatestStoredSettingsProvider.swift in Sources */,
36573664
C1FB428F217921D600FAB378 /* PumpManagerUI.swift in Sources */,
36583665
A9B996F227238705002DC09C /* DosingDecisionStore.swift in Sources */,
36593666
43C513191E864C4E001547C7 /* GlucoseRangeSchedule.swift in Sources */,
3667+
B4D904412AA8989100CBD826 /* StatefulPluginManager.swift in Sources */,
36603668
E9B355292935919E0076AB04 /* MissedMealSettings.swift in Sources */,
36613669
43A51E1F1EB6D62A000736CC /* CarbAbsorptionViewController.swift in Sources */,
36623670
43776F901B8022E90074EA36 /* AppDelegate.swift in Sources */,

Loop/Managers/AnalyticsServicesManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class AnalyticsServicesManager {
2828
}
2929

3030
func removeService(_ analyticsService: AnalyticsService) {
31-
analyticsServices.removeAll { $0.serviceIdentifier == analyticsService.serviceIdentifier }
31+
analyticsServices.removeAll { $0.pluginIdentifier == analyticsService.pluginIdentifier }
3232
}
3333

3434
private func logEvent(_ name: String, withProperties properties: [AnyHashable: Any]? = nil, outOfSession: Bool = false) {

Loop/Managers/CGMManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import LoopKitUI
1010
import MockKit
1111

1212
let staticCGMManagersByIdentifier: [String: CGMManager.Type] = [
13-
MockCGMManager.managerIdentifier: MockCGMManager.self
13+
MockCGMManager.pluginIdentifier: MockCGMManager.self
1414
]
1515

1616
var availableStaticCGMManagers: [CGMManagerDescriptor] {
1717
if FeatureFlags.allowSimulators {
1818
return [
19-
CGMManagerDescriptor(identifier: MockCGMManager.managerIdentifier, localizedTitle: MockCGMManager.localizedTitle)
19+
CGMManagerDescriptor(identifier: MockCGMManager.pluginIdentifier, localizedTitle: MockCGMManager.localizedTitle)
2020
]
2121
} else {
2222
return []
@@ -40,7 +40,7 @@ extension CGMManager {
4040

4141
var rawValue: [String: Any] {
4242
return [
43-
"managerIdentifier": managerIdentifier,
43+
"managerIdentifier": pluginIdentifier,
4444
"state": self.rawState
4545
]
4646
}

0 commit comments

Comments
 (0)