]> git.saurik.com Git - apple/security.git/blob - keychain/ckks/CKKSOperationDependencies.h
Security-59754.80.3.tar.gz
[apple/security.git] / keychain / ckks / CKKSOperationDependencies.h
1 #if OCTAGON
2
3 #import <Foundation/Foundation.h>
4 #import <CloudKit/CloudKit.h>
5
6 #import "keychain/ckks/CKKSCurrentKeyPointer.h"
7 #import "keychain/ckks/CKKSLockStateTracker.h"
8 #import "keychain/ckks/CKKSPeerProvider.h"
9 #import "keychain/ckks/CKKSProvideKeySetOperation.h"
10 #import "keychain/ckks/CKKSReachabilityTracker.h"
11 #import "keychain/ckks/CKKSNearFutureScheduler.h"
12 #import "keychain/ckks/CKKSSQLDatabaseObject.h"
13 #import "keychain/ckks/CKKSZoneModifier.h"
14 #import "keychain/analytics/CKKSLaunchSequence.h"
15 #import "keychain/ot/OctagonStateMachineHelpers.h"
16 #import "keychain/trust/TrustedPeers/TPSyncingPolicy.h"
17
18 NS_ASSUME_NONNULL_BEGIN
19
20 @interface CKKSOperationDependencies : NSObject
21
22 @property (readonly) CKRecordZoneID* zoneID;
23 @property (nullable) CKOperationGroup* ckoperationGroup;
24
25 @property (readonly) CKKSLaunchSequence* launch;
26 @property (readonly) id<OctagonStateFlagHandler> flagHandler;
27
28 @property (readonly) CKKSLockStateTracker* lockStateTracker;
29 @property (readonly) CKKSReachabilityTracker* reachabilityTracker;
30
31 // Due to CKKS's current operation scheduling model, these might be updated after object creation
32 // For example, if an operation is created and waiting to run, and trust arrives, CKKS will reach in
33 // and inject the new providers, possibly before the operation runs.
34 @property (atomic) NSArray<id<CKKSPeerProvider>>* peerProviders;
35
36 // Filled in after creation item creation
37 @property (nullable) TPSyncingPolicy* syncingPolicy;
38
39 // This is weak as, currently, the databaseProvider owns the CKKSOperationDependencies.
40 @property (readonly,weak) id<CKKSDatabaseProviderProtocol> databaseProvider;
41
42 @property CKKSZoneModifier* zoneModifier;
43
44 @property (readonly) CKKSNearFutureScheduler* notifyViewChangedScheduler;
45 @property (readonly) CKKSNearFutureScheduler* savedTLKNotifier;
46
47 // This might contain some key set provider operations. if you're an operation that knows about keysets, feel free to provide them.
48 @property NSHashTable<CKKSResultOperation<CKKSKeySetProviderOperationProtocol>*>* keysetProviderOperations;
49
50 - (instancetype)initWithZoneID:(CKRecordZoneID*)zoneID
51 zoneModifier:(CKKSZoneModifier*)zoneModifier
52 ckoperationGroup:(CKOperationGroup* _Nullable)operationGroup
53 flagHandler:(id<OctagonStateFlagHandler>)flagHandler
54 launchSequence:(CKKSLaunchSequence*)launchSequence
55 lockStateTracker:(CKKSLockStateTracker*)lockStateTracker
56 reachabilityTracker:(CKKSReachabilityTracker*)reachabilityTracker
57 peerProviders:(NSArray<id<CKKSPeerProvider>>*)peerProviders
58 databaseProvider:(id<CKKSDatabaseProviderProtocol>)databaseProvider
59 notifyViewChangedScheduler:(CKKSNearFutureScheduler*)notifyViewChangedScheduler
60 savedTLKNotifier:(CKKSNearFutureScheduler*)savedTLKNotifier;
61
62 // Convenience method to fetch the trust states from all peer providers
63 // Do not call this while on the SQL transaction queue!
64 - (NSArray<CKKSPeerProviderState*>*)currentTrustStates;
65
66 - (void)provideKeySet:(CKKSCurrentKeySet*)keyset;
67
68 @end
69
70 NS_ASSUME_NONNULL_END
71
72 #endif // OCTAGON