diff --git a/keyserver/src/socket/tunnelbroker.js b/keyserver/src/socket/tunnelbroker.js --- a/keyserver/src/socket/tunnelbroker.js +++ b/keyserver/src/socket/tunnelbroker.js @@ -53,9 +53,9 @@ const message: TBKeyserverConnectionInitializationMessage = { type: 'sessionRequest', accessToken, - deviceId: deviceID, + deviceID, deviceType: 'keyserver', - userId: userID, + userID, }; tunnelbrokerSocket.send(JSON.stringify(message)); diff --git a/lib/types/tunnelbroker-messages.js b/lib/types/tunnelbroker-messages.js --- a/lib/types/tunnelbroker-messages.js +++ b/lib/types/tunnelbroker-messages.js @@ -6,10 +6,10 @@ type TBSharedConnectionInitializationMessage = { +type: 'sessionRequest', - +deviceId: string, + +deviceID: string, +accessToken: string, +deviceAppVersion?: string, - +userId: string, + +userID: string, }; export type TBKeyserverConnectionInitializationMessage = { @@ -39,14 +39,14 @@ export type TBRefreshKeysRequest = { +type: 'RefreshKeyRequest', - +deviceId: string, + +deviceID: string, +numberOfKeys: number, }; export const refreshKeysTBMessageValidator: TInterface = tShape({ type: tString('RefreshKeyRequest'), - deviceId: t.String, + deviceID: t.String, numberOfKeys: t.Number, }); diff --git a/services/commtest/tests/tunnelbroker_integration_test.rs b/services/commtest/tests/tunnelbroker_integration_test.rs --- a/services/commtest/tests/tunnelbroker_integration_test.rs +++ b/services/commtest/tests/tunnelbroker_integration_test.rs @@ -19,8 +19,8 @@ let session_request = r#"{ "type": "sessionRequest", "accessToken": "xkdeifjsld", - "deviceId": "foo", - "userId": "alice", + "deviceID": "foo", + "userID": "alice", "deviceType": "keyserver" }"#; @@ -101,7 +101,7 @@ let session_request = r#"{ "type": "sessionRequest", "accessToken": "xkdexfjsld", - "deviceId": "bar", + "deviceID": "bar", "deviceType": "keyserver" }"#; diff --git a/shared/tunnelbroker_messages/src/messages/keys.rs b/shared/tunnelbroker_messages/src/messages/keys.rs --- a/shared/tunnelbroker_messages/src/messages/keys.rs +++ b/shared/tunnelbroker_messages/src/messages/keys.rs @@ -5,6 +5,7 @@ #[derive(Serialize, Deserialize, PartialEq, Debug)] #[serde(tag = "type", rename_all = "camelCase")] pub struct RefreshKeyRequest { + #[serde(rename = "deviceID")] pub device_id: String, pub number_of_keys: u32, } @@ -17,7 +18,7 @@ fn test_refresh_deserialization() { let example_payload = r#"{ "type": "RefreshKeyRequest", - "deviceId": "adfjEDFS", + "deviceID": "adfjEDFS", "numberOfKeys": 6 }"#; diff --git a/shared/tunnelbroker_messages/src/messages/session.rs b/shared/tunnelbroker_messages/src/messages/session.rs --- a/shared/tunnelbroker_messages/src/messages/session.rs +++ b/shared/tunnelbroker_messages/src/messages/session.rs @@ -32,8 +32,10 @@ #[derive(Serialize, Deserialize)] #[serde(tag = "type", rename_all = "camelCase")] pub struct ConnectionInitializationMessage { + #[serde(rename = "deviceID")] pub device_id: String, pub access_token: String, + #[serde(rename = "userID")] pub user_id: String, pub notify_token: Option, pub device_type: DeviceTypes, @@ -55,8 +57,8 @@ let example_payload = r#"{ "type": "sessionRequest", "accessToken": "xkdeifjsld", - "deviceId": "foo", - "userId": "alice", + "deviceID": "foo", + "userID": "alice", "deviceType": "keyserver" }"#;