Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated authorise #679

Merged
merged 1 commit into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Source/ARTAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ NS_ASSUME_NONNULL_BEGIN
callback:(void (^)(ARTTokenDetails *_Nullable, NSError *_Nullable))callback;
- (void)requestToken:(void (^)(ARTTokenDetails *_Nullable, NSError *_Nullable))callback;

- (void)authorise:(nullable ARTTokenParams *)tokenParams options:(nullable ARTAuthOptions *)authOptions callback:(void (^)(ARTTokenDetails *_Nullable, NSError *_Nullable))callback DEPRECATED_MSG_ATTRIBUTE("method will be removed in v1.0. Use 'authorize:' method instead.");

- (void)authorize:(nullable ARTTokenParams *)tokenParams options:(nullable ARTAuthOptions *)authOptions
callback:(void (^)(ARTTokenDetails *_Nullable, NSError *_Nullable))callback;
- (void)authorize:(void (^)(ARTTokenDetails *_Nullable, NSError *_Nullable))callback;
Expand Down
6 changes: 0 additions & 6 deletions Source/ARTAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,6 @@ - (void)executeTokenRequest:(ARTTokenRequest *)tokenRequest callback:(void (^)(A
} ART_TRY_OR_REPORT_CRASH_END
}

- (void)authorise:(ARTTokenParams *)tokenParams options:(ARTAuthOptions *)authOptions callback:(void (^)(ARTTokenDetails *, NSError *))callback {
ART_TRY_OR_REPORT_CRASH_START(_rest) {
[self authorize:tokenParams options:authOptions callback:callback];
} ART_TRY_OR_REPORT_CRASH_END
}

- (void)authorize:(void (^)(ARTTokenDetails *, NSError *))callback {
ART_TRY_OR_REPORT_CRASH_START(_rest) {
[self authorize:_options.defaultTokenParams options:_options callback:callback];
Expand Down
4 changes: 2 additions & 2 deletions Source/ARTRealtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ - (void)onClosed {

- (void)onAuth {
ART_TRY_OR_MOVE_TO_FAILED_START(self) {
[self.logger info:@"R:%p server has requested an authorise", self];
[self.logger info:@"R:%p server has requested an authorize", self];
switch (self.connection.state_nosync) {
case ARTRealtimeConnecting:
case ARTRealtimeConnected:
Expand Down Expand Up @@ -821,7 +821,7 @@ - (void)transportConnectForcingNewToken:(BOOL)forceNewToken keepConnection:(BOOL
break;
}

[[weakSelf getLogger] debug:__FILE__ line:__LINE__ message:@"R:%p authorised: %@ error: %@", weakSelf, tokenDetails, error];
[[weakSelf getLogger] debug:__FILE__ line:__LINE__ message:@"R:%p authorized: %@ error: %@", weakSelf, tokenDetails, error];
if (error) {
[weakSelf handleTokenAuthError:error];
return;
Expand Down
9 changes: 1 addition & 8 deletions Spec/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3362,13 +3362,6 @@ class Auth : QuickSpec {

}

// RSA10l
it("has an alias method @RestClient#authorise@ and should use @RealtimeClient#authorize@") {
let rest = ARTRest(key: "xxxx:xxxx")
expect(rest.auth.responds(to: #selector(ARTAuth.authorise(_:options:callback:)))) == true
expect(rest.auth.responds(to: #selector(ARTAuth.authorize(_:options:callback:)))) == true
}

}

describe("TokenParams") {
Expand Down Expand Up @@ -3408,7 +3401,7 @@ class Auth : QuickSpec {
describe("Reauth") {

// RTC8
it("should use authorise({force: true}) to reauth with a token with a different set of capabilities") {
it("should use authorize({force: true}) to reauth with a token with a different set of capabilities") {
let options = AblyTests.commonAppSetup()
let initialToken = getTestToken(clientId: "tester", capability: "{\"restricted\":[\"*\"]}")
options.token = initialToken
Expand Down
2 changes: 1 addition & 1 deletion Spec/RealtimeClientConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4291,7 +4291,7 @@ class RealtimeClientConnection: QuickSpec {
}
}

it("should abort reconnection with new token if the server has requested it to authorise and after it the connection has been closed") {
it("should abort reconnection with new token if the server has requested it to authorize and after it the connection has been closed") {
let options = AblyTests.commonAppSetup()
let client = ARTRealtime(options: options)
defer { client.dispose(); client.close() }
Expand Down