diff --git a/Source/ARTNSMutableRequest+ARTPush.m b/Source/ARTNSMutableRequest+ARTPush.m index eb78bd1e8..bc0b15ddb 100644 --- a/Source/ARTNSMutableRequest+ARTPush.m +++ b/Source/ARTNSMutableRequest+ARTPush.m @@ -23,7 +23,7 @@ - (void)setDeviceAuthentication:(ARTDeviceId *)deviceId localDevice:(ARTLocalDev if ([localDevice.id isEqualToString:deviceId]) { if (localDevice.identityTokenDetails.token) { [logger debug:__FILE__ line:__LINE__ message:@"adding device authentication using local device identity token"]; - [self setValue:[localDevice.identityTokenDetails.token base64Encoded] forHTTPHeaderField:@"X-Ably-DeviceIdentityToken"]; + [self setValue:[localDevice.identityTokenDetails.token base64Encoded] forHTTPHeaderField:@"X-Ably-DeviceToken"]; } else if (localDevice.secret) { [logger debug:__FILE__ line:__LINE__ message:@"adding device authentication using local device secret"]; diff --git a/Spec/PushActivationStateMachine.swift b/Spec/PushActivationStateMachine.swift index e88538d63..e4eff66e7 100644 --- a/Spec/PushActivationStateMachine.swift +++ b/Spec/PushActivationStateMachine.swift @@ -638,7 +638,7 @@ class PushActivationStateMachine : QuickSpec { expect(url.query).to(contain(rest.device.id)) expect(rest.device.identityTokenDetails).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(deviceAuthorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } @@ -878,7 +878,7 @@ class PushActivationStateMachine : QuickSpec { expect(body.value(forKey: "formFactor")).to(beNil()) expect(body.value(forKey: "platform")).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(deviceAuthorization).to(equal(deviceIdentityToken)) } @@ -937,7 +937,7 @@ class PushActivationStateMachine : QuickSpec { expect(body.value(forKey: "formFactor")).to(beNil()) expect(body.value(forKey: "platform")).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) expect(deviceAuthorization).to(equal(deviceIdentityToken)) } @@ -1079,7 +1079,7 @@ class PushActivationStateMachine : QuickSpec { expect(body.value(forKey: "formFactor")).to(beNil()) expect(body.value(forKey: "platform")).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(deviceAuthorization).to(equal(deviceIdentityToken)) } @@ -1141,7 +1141,7 @@ class PushActivationStateMachine : QuickSpec { expect(body.value(forKey: "formFactor")).to(beNil()) expect(body.value(forKey: "platform")).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(deviceAuthorization).to(equal(deviceIdentityToken.base64Encoded())) } @@ -1310,7 +1310,7 @@ class PushActivationStateMachine : QuickSpec { expect(url.query).to(contain(rest.device.id)) expect(rest.device.identityTokenDetails).to(beNil()) expect(request.allHTTPHeaderFields?["Authorization"]).toNot(beNil()) - let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let deviceAuthorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(deviceAuthorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } diff --git a/Spec/PushAdmin.swift b/Spec/PushAdmin.swift index 6db186a16..8cd2a0fbc 100644 --- a/Spec/PushAdmin.swift +++ b/Spec/PushAdmin.swift @@ -400,7 +400,7 @@ class PushAdmin : QuickSpec { return } - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } @@ -504,7 +504,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod) == "DELETE" - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) } } @@ -529,7 +529,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod) == "PUT" - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) } @@ -565,7 +565,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod).to(equal("PUT")) - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } @@ -633,7 +633,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod) == "DELETE" - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) waitUntil(timeout: testTimeout) { done in @@ -700,7 +700,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod).to(equal("POST")) - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) } @@ -761,7 +761,7 @@ class PushAdmin : QuickSpec { return } - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } @@ -847,7 +847,7 @@ class PushAdmin : QuickSpec { } expect(request.httpMethod).to(equal("DELETE")) - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecret"]).to(beNil()) waitUntil(timeout: testTimeout) { done in @@ -893,7 +893,7 @@ class PushAdmin : QuickSpec { return } - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) } diff --git a/Spec/PushChannel.swift b/Spec/PushChannel.swift index 20c2ec225..6f4fa7abc 100644 --- a/Spec/PushChannel.swift +++ b/Spec/PushChannel.swift @@ -80,7 +80,7 @@ class PushChannel : QuickSpec { expect(body.value(forKey: "deviceId") as? String).to(equal(rest.device.id)) expect(body.value(forKey: "channel") as? String).to(equal(channel.name)) - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecrect"]).to(beNil()) } @@ -147,7 +147,7 @@ class PushChannel : QuickSpec { expect(body.value(forKey: "clientId") as? String).to(equal(rest.device.clientId)) expect(body.value(forKey: "channel") as? String).to(equal(channel.name)) - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecrect"]).to(beNil()) } } @@ -195,7 +195,7 @@ class PushChannel : QuickSpec { expect(query).to(haveParam("deviceId", withValue: rest.device.id)) expect(query).to(haveParam("channel", withValue: channel.name)) - let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"] + let authorization = request.allHTTPHeaderFields?["X-Ably-DeviceToken"] expect(authorization).to(equal(testIdentityTokenDetails.token.base64Encoded())) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecrect"]).to(beNil()) } @@ -252,7 +252,7 @@ class PushChannel : QuickSpec { expect(query).to(haveParam("clientId", withValue: rest.device.clientId!)) expect(query).to(haveParam("channel", withValue: channel.name)) - expect(request.allHTTPHeaderFields?["X-Ably-DeviceIdentityToken"]).to(beNil()) + expect(request.allHTTPHeaderFields?["X-Ably-DeviceToken"]).to(beNil()) expect(request.allHTTPHeaderFields?["X-Ably-DeviceSecrect"]).to(beNil()) } }