]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OctagonPendingFlag.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / ot / OctagonPendingFlag.h
1
2 #if OCTAGON
3
4 #import <Foundation/Foundation.h>
5 #import "keychain/ot/OctagonStateMachineHelpers.h"
6
7 NS_ASSUME_NONNULL_BEGIN
8
9 // An OctagonPendingFlag asks the state machine to add a flag in the future, when some conditions are met
10
11 // Currently, this is only time-based.
12 // Future planned conditions include "device is probably unlocked" and "device has network again"
13
14 typedef NS_OPTIONS(NSUInteger, OctagonPendingConditions) {
15 OctagonPendingConditionsDeviceUnlocked = 1,
16 };
17
18 NSString* OctagonPendingConditionsToString(OctagonPendingConditions cond);
19
20 @interface OctagonPendingFlag : NSObject
21 @property (readonly) OctagonFlag* flag;
22
23 // NSDate after which this flag should become unpending
24 @property (nullable, readonly) NSDate* fireTime;
25
26 @property (readonly) OctagonPendingConditions conditions;
27
28 - (instancetype)initWithFlag:(OctagonFlag*)flag delayInSeconds:(NSTimeInterval)delay;
29 - (instancetype)initWithFlag:(OctagonFlag*)flag conditions:(OctagonPendingConditions)conditions;
30 @end
31
32 NS_ASSUME_NONNULL_END
33
34 #endif // OCTAGON