Skip to content

Commit

Permalink
PresenceMap, Fallback and Syncing
Browse files Browse the repository at this point in the history
ably 0.8 spec nearly completed

artrest constructed with error cb works, needs cleaning

cleanup history test

test for artrest initwithkey works

realtime conneciton state tests

realtime ping and close

testAppStats works

half way through migrating initWithOptions

artrealtime realtimeWithOptions works

crypto tests

testconnectstates

tests tests tests

artrealtime channels

connect tests

artrest and artrealtime throw exceptions with bad options

exceptions are thrown, token is reissued

presence exceptions

presenceEnterClient

starting artstatus refactor

status moved to an object

renaming

cleanup

cleanup

fallback implemented

presenceMap and syncing
7 reds left

token expiry bug fix

untilattach test

presence unsubscribe tests

artdefaults, and bad recovery error message set. one more red

presencesync works

fixed a few tests

testClientIdPreserved

tests

presence tests

cleanup

cleanup

cleanup

clean
  • Loading branch information
thevixac committed Jun 11, 2015
1 parent 2203b24 commit 0449aa3
Show file tree
Hide file tree
Showing 67 changed files with 5,093 additions and 2,495 deletions.
23 changes: 12 additions & 11 deletions ably-ios/ARTAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

@class ARTRest;


@interface ARTTokenDetails : NSObject

@property (readonly, strong, nonatomic) NSString *token;
Expand All @@ -25,8 +26,6 @@

- (instancetype)initWithId:(NSString *)id expires:(int64_t)expires issued:(int64_t)issued capability:(NSString *)capability clientId:(NSString *)clientId;

+ (instancetype)authTokenWithId:(NSString *)id expires:(int64_t)expires issued:(int64_t)issued capability:(NSString *)capability clientId:(NSString *)clientId;

@end

@interface ARTAuthTokenParams : NSObject
Expand All @@ -44,12 +43,10 @@

- (instancetype)initWithId:(NSString *)id ttl:(int64_t)ttl capability:(NSString *)capability clientId:(NSString *)clientId timestamp:(int64_t)timestamp nonce:(NSString *)nonce mac:(NSString *)mac;

+ (instancetype)authTokenParamsWithId:(NSString *)id ttl:(int64_t)ttl capability:(NSString *)capability clientId:(NSString *)clientId timestamp:(int64_t)timestamp nonce:(NSString *)nonce mac:(NSString *)mac;

-(NSDictionary *) asDictionary;
@end

typedef id<ARTCancellable>(^ARTAuthCb)(void(^continuation)(ARTStatus,ARTTokenDetails *));
typedef id<ARTCancellable>(^ARTAuthCb)(void(^continuation)(ARTStatus *,ARTTokenDetails *));
typedef id<ARTCancellable>(^ARTSignedTokenRequestCb)(ARTAuthTokenParams *, void(^continuation)(ARTAuthTokenParams *));
typedef NS_ENUM(NSUInteger, ARTAuthMethod) {
ARTAuthMethodBasic,
Expand All @@ -65,10 +62,13 @@ typedef NS_ENUM(NSUInteger, ARTAuthMethod) {
@property (readwrite, strong, nonatomic) NSString *keySecret;
@property (readwrite, strong, nonatomic) NSString *token;
@property (readwrite, strong, nonatomic) NSString *capability;
@property (readwrite, strong, nonatomic) NSString *nonce;
@property (readwrite, assign, nonatomic) int64_t ttl;
@property (readwrite, strong, nonatomic) NSDictionary *authHeaders;
@property (readwrite, strong, nonatomic) NSString *clientId;
@property (readwrite, assign, nonatomic) BOOL queryTime;
@property (readwrite, assign, nonatomic) BOOL useTokenAuth;
@property (readwrite, assign, nonatomic) ARTTokenDetails * tokenDetails;


- (instancetype)init;
Expand All @@ -83,14 +83,15 @@ typedef NS_ENUM(NSUInteger, ARTAuthMethod) {

@interface ARTAuth : NSObject

- (instancetype)initWithRest:(ARTRest *)rest options:(ARTAuthOptions *)options;


- (ARTAuthMethod) getAuthMethod;
- (instancetype)initWithRest:(ARTRest *) rest options:(ARTAuthOptions *) options;
- (ARTAuthOptions *)getAuthOptions;
- (ARTAuthMethod)getAuthMethod;
- (id<ARTCancellable>)authHeadersUseBasic:(BOOL)useBasic cb:(id<ARTCancellable>(^)(NSDictionary *))cb;
- (id<ARTCancellable>)authParams:(id<ARTCancellable>(^)(NSDictionary *))cb;
- (id<ARTCancellable>)authToken:(id<ARTCancellable>(^)(ARTTokenDetails *))cb;
- (id<ARTCancellable>)requestToken:(id<ARTCancellable>(^)(ARTTokenDetails *))cb;
- (id<ARTCancellable>)authTokenForceReauth:(BOOL)force cb:(id<ARTCancellable>(^)(ARTTokenDetails *))cb;
- (void)attemptTokenFetch:(void (^)()) cb;
- (bool)canRequestToken;


+ (ARTSignedTokenRequestCb)defaultSignedTokenRequestCallback:(ARTAuthOptions *)authOptions rest:(ARTRest *)rest;
@end
Loading

0 comments on commit 0449aa3

Please sign in to comment.