]> git.saurik.com Git - apple/security.git/blob - keychain/SecureObjectSync/SOSPeerRateLimiter.h
Security-59306.101.1.tar.gz
[apple/security.git] / keychain / SecureObjectSync / SOSPeerRateLimiter.h
1 //
2 // SOSPeerRateLimiter.h
3 // Security
4 //
5 #import "keychain/ckks/RateLimiter.h"
6 #include "keychain/SecureObjectSync/SOSPeer.h"
7
8 #ifndef SOSPeerRateLimiter_h
9 #define SOSPeerRateLimiter_h
10
11 enum RateLimitState{
12 RateLimitStateCanSend = 1,
13 RateLimitStateHoldMessage = 2
14 };
15
16 @interface PeerRateLimiter : RateLimiter
17 {
18 NSString *peerID;
19 }
20
21 @property (retain) NSString *peerID;
22 @property (retain) NSMutableDictionary *accessGroupRateLimitState;
23 @property (retain) NSMutableDictionary *accessGroupToTimer;
24 @property (retain) NSMutableDictionary *accessGroupToNextMessageToSend;
25
26 -(instancetype)initWithPeer:(SOSPeerRef)peer;
27 -(NSDictionary *) setUpConfigForPeer;
28 -(enum RateLimitState) stateForAccessGroup:(NSString*) accessGroup;
29 @end
30
31 @interface KeychainItem : NSObject
32 @property (atomic, retain) NSString* accessGroup;
33 -(instancetype) initWithAccessGroup:(NSString*)accessGroup;
34 @end
35
36 #endif /* SOSPeerRateLimiter_h */