From ff6f72e05870e8e952722ce20d47e2f282ecbf5e Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 13:38:08 +0100 Subject: [PATCH 01/11] feat: update response to support multi-connection of reachability --- .../device-reachability-status.yaml | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/code/API_definitions/device-reachability-status.yaml b/code/API_definitions/device-reachability-status.yaml index 099b77f..a3e951b 100644 --- a/code/API_definitions/device-reachability-status.yaml +++ b/code/API_definitions/device-reachability-status.yaml @@ -117,15 +117,23 @@ paths: Connected-With-SMS: value: lastStatusTime: "2024-02-20T10:41:38.657Z" - reachabilityStatus: CONNECTED_SMS + reachable: true + connectivity: ["SMS"] Connected-With-DATA: value: lastStatusTime: "2024-02-20T10:41:38.657Z" - reachabilityStatus: CONNECTED_DATA - Not-Connected: + reachable: true + connectivity: ["DATA"] + + Connected-With-DATA-And-SMS: + value: + lastStatusTime: "2024-02-20T10:41:38.657Z" + reachable: true + connectivity: ["DATA","SMS"] + Not-Reachable: value: lastStatusTime: "2024-02-20T10:41:38.657Z" - reachabilityStatus: NOT_CONNECTED + reachable: false "400": $ref: "#/components/responses/Generic400" "401": @@ -178,24 +186,27 @@ components: ReachabilityStatusResponse: type: object required: - - reachabilityStatus + - reachable properties: lastStatusTime: $ref: "#/components/schemas/LastStatusTime" - reachabilityStatus: - $ref: "#/components/schemas/ReachabilityStatus" - ReachabilityStatus: + reachable: + description: Indicates overall device reachability + type: boolean + connectivity: + type: array + items: + $ref: "#/components/schemas/ConnectivityType" + ConnectivityType: description: | - CONNECTED_DATA: The device is connected to the network for Data usage (regardless of the SMS reachability) + DATA: The device is connected to the network for Data usage (regardless of the SMS reachability) - CONNECTED_SMS: The device is connected to the network only for SMS usage + SMS: The device is connected to the network only for SMS usage - NOT_CONNECTED: The device is not connected type: string enum: - - CONNECTED_DATA - - CONNECTED_SMS - - NOT_CONNECTED + - DATA + - SMS Device: description: | End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. From 2f1731e0396d6bdcde5352730971cb1865b20ba0 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 13:46:49 +0100 Subject: [PATCH 02/11] feat: update description --- code/API_definitions/device-reachability-status.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/API_definitions/device-reachability-status.yaml b/code/API_definitions/device-reachability-status.yaml index a3e951b..c745952 100644 --- a/code/API_definitions/device-reachability-status.yaml +++ b/code/API_definitions/device-reachability-status.yaml @@ -15,10 +15,9 @@ info: * **Device**: A device refers to any physical entity that can connect to a network and participate in network communication. At least one identifier for the device (user equipment) out of four options: IPv4 address, IPv6 address, Phone number, or Network Access Identifier assigned by the mobile network operator for the device. - * **Reachability** : Reachability status. - - `CONNECTED_SMS`, if device is connected to the network only via SMS usage - - `CONNECTED_DATA`, if device is connected to the network via data usage (regardless of the SMS reachability) - - `NOT_CONNECTED`, if device is not connected to the network + * **Reachability:** Indicates the device's network connectivity status. + - `reachable: true`, the device is reachable from the network. The specific connectivity types (DATA, SMS, or both) are detailed in the `connectivity` array. + - `reachable: false`, the device is not reachable from the network. * **LastStatusTime** : This property specifies the time when the status was last updated. Its presence in the response indicates the freshness of the information, while its absence implies the information may be outdated or its freshness is uncertain. From 4b5f348caa91391def0cd13282467503a31a566e Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 13:58:19 +0100 Subject: [PATCH 03/11] feat: update device-reachability-status.feature --- .../device-reachability-status.feature | 76 ++++++++++--------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 094ac36..bf18bc9 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -13,49 +13,57 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi ############# Happy Path Scenarios ################## - @device_reachability_status_01_reachabilityStatusConnectedSms + @device_reachability_status_01_reachableAndConnectedSms Scenario: Check the reachability status if device is connected with SMS - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is connected with sms and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.message" contains a user friendly text - And the response property "$.reachabilityStatus" is "CONNECTED_SMS" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["SMS"] - @device_reachability_status_02_reachabilityStatusConnectedData + @device_reachability_status_02_reachableAndConnectedData Scenario: Check the reachability status if device is connected with DATA - Given a valid devicestatus request body + Given a valid device reachability status request body + And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service + When the request "getReachabilityStatus" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["DATA"] + + @device_reachability_status_03_reachableAndConnectedDataAndSms + Scenario: Check the reachability status if device is connected with DATA + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.reachabilityStatus" is "CONNECTED_DATA" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["DATA","SMS"] - @device_reachability_status_03_reachabilityStatusDeviceNotConnected - Scenario: Check the reachability status for DeviceNotConnected - Given a valid devicestatus request body + @device_reachability_status_04_notReachable + Scenario: Check the reachability status for an unreachable device + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is not connected and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.reachabilityStatus" is "NOT_CONNECTED" + And the response property "$.reachable" is false + And the response property "$.connectivity" is not returned #############Error Response Scenarios################## - @device_reachability_status_04_deviceStatus_with_invalid_parameter + @device_reachability_status_05_deviceStatus_with_invalid_parameter Scenario: Device reachability status request with invalid parameter Given the request body is not compliant with the schema "/components/schemas/RequestReachabilityStatus" When the request "getReachabilityStatus" is sent @@ -64,9 +72,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @device_reachability_status_05_expired_access_token + @device_reachability_status_06_expired_access_token Scenario: Expired access token - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" is set to expired token When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -74,9 +82,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_06_no_authorization_header + @device_reachability_status_07_no_authorization_header Scenario: No Authorization header - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" is not available When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -84,9 +92,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_07_invalid_access_token + @device_reachability_status_08_invalid_access_token Scenario: Invalid access token - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" set to an invalid access token When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -95,10 +103,10 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_08_deviceStatus_inconsistent_access_token + @device_reachability_status_09_deviceStatus_inconsistent_access_token Scenario: Inconsistent access token context for the device # To test this, a token has to be obtained for a different device - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device supported by the service And header "Authorization" set to access token referring different device When the request "getReachabilityStatus" is sent @@ -107,10 +115,10 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "INVALID_TOKEN_CONTEXT" And the response property "$.message" contains a user friendly text - @device_reachability_status_09_deviceStatusWithIdentifiersMismatch + @device_reachability_status_10_deviceStatusWithIdentifiersMismatch Scenario: Device reachabilityidentifiers mismatch # To test this, at least 2 types of identifiers have to be provided, e.g. a phoneNumber and the IP address of a Device reachability associated to a different phoneNumber - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" includes several identifiers, each of them identifying a valid but different device When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -118,9 +126,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "DEVICE_IDENTIFIERS_MISMATCH" And the response property "$.message" contains a user friendly text - @device_reachability_status_10_deviceStatus_NotApplicable + @device_reachability_status_11_deviceStatus_NotApplicable Scenario: Device reachability not applicable - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" refers to an unknown device When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -128,9 +136,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "DEVICE_NOT_APPLICABLE" And the response property "$.message" contains a user friendly text - @device_reachability_status_11_unable_to_provide_reachability_status + @device_reachability_status_12_unable_to_provide_reachability_status Scenario: Unable to provide reachability status for a device - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" refers to a device having network issue When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -138,9 +146,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNABLE_TO_PROVIDE_REACHABILITY_STATUS" And the response property "$.message" contains a user friendly text - @device_reachability_status_12_unsupported_device_identifiers + @device_reachability_status_13_unsupported_device_identifiers Scenario: Unsupported device identifiers - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" set to unsupported identifiers value for the service When the request "getReachabilityStatus" is sent Then the response status code is 422 From d8ddeb47ee154e18ab4f0de82436f208f17f18db Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 14:05:20 +0100 Subject: [PATCH 04/11] fix: whitespace after "," in array --- code/API_definitions/device-reachability-status.yaml | 2 +- code/Test_definitions/device-reachability-status.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/device-reachability-status.yaml b/code/API_definitions/device-reachability-status.yaml index c745952..6c3dca0 100644 --- a/code/API_definitions/device-reachability-status.yaml +++ b/code/API_definitions/device-reachability-status.yaml @@ -128,7 +128,7 @@ paths: value: lastStatusTime: "2024-02-20T10:41:38.657Z" reachable: true - connectivity: ["DATA","SMS"] + connectivity: ["DATA", "SMS"] Not-Reachable: value: lastStatusTime: "2024-02-20T10:41:38.657Z" diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index bf18bc9..848f5ef 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -47,7 +47,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" And the response property "$.reachable" is true - And the response property "$.connectivity" is ["DATA","SMS"] + And the response property "$.connectivity" is ["DATA", "SMS"] @device_reachability_status_04_notReachable Scenario: Check the reachability status for an unreachable device From d31234d5997a7c64df1417d9f7efa537ecbbef65 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 14:22:50 +0100 Subject: [PATCH 05/11] fix: update description --- code/API_definitions/device-reachability-status.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/API_definitions/device-reachability-status.yaml b/code/API_definitions/device-reachability-status.yaml index 6c3dca0..a5963c0 100644 --- a/code/API_definitions/device-reachability-status.yaml +++ b/code/API_definitions/device-reachability-status.yaml @@ -15,9 +15,9 @@ info: * **Device**: A device refers to any physical entity that can connect to a network and participate in network communication. At least one identifier for the device (user equipment) out of four options: IPv4 address, IPv6 address, Phone number, or Network Access Identifier assigned by the mobile network operator for the device. - * **Reachability:** Indicates the device's network connectivity status. - - `reachable: true`, the device is reachable from the network. The specific connectivity types (DATA, SMS, or both) are detailed in the `connectivity` array. - - `reachable: false`, the device is not reachable from the network. + * **Reachable:** Indicates, if the device is reachable from the network or not. + + * **Connectivity:** Indicates the connectivity types (DATA, SMS or both) through which the device is reachable from the network. * **LastStatusTime** : This property specifies the time when the status was last updated. Its presence in the response indicates the freshness of the information, while its absence implies the information may be outdated or its freshness is uncertain. From 1401e3fb8ce4f6f3f936608efa6129af2abb2142 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:25:31 +0100 Subject: [PATCH 06/11] Update code/Test_definitions/device-reachability-status.feature Co-authored-by: Eric Murray --- code/Test_definitions/device-reachability-status.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 848f5ef..ee366a8 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -35,7 +35,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" And the response property "$.reachable" is true - And the response property "$.connectivity" is ["DATA"] + And the response property "$.connectivity" includes "DATA" @device_reachability_status_03_reachableAndConnectedDataAndSms Scenario: Check the reachability status if device is connected with DATA From 9d758b2599fc7fcf24e9ce93e8badb3296f287f4 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:25:36 +0100 Subject: [PATCH 07/11] Update code/Test_definitions/device-reachability-status.feature Co-authored-by: Eric Murray --- code/Test_definitions/device-reachability-status.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index ee366a8..2012104 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -40,7 +40,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi @device_reachability_status_03_reachableAndConnectedDataAndSms Scenario: Check the reachability status if device is connected with DATA Given a valid device reachability status request body - And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service + And the request body property "$.device" is set to a valid testing device which is connected with both data and sms, and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" From 7ae2a35041ea3f90db0b4ea9942cda428ca716b5 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:25:42 +0100 Subject: [PATCH 08/11] Update code/Test_definitions/device-reachability-status.feature Co-authored-by: Eric Murray --- code/Test_definitions/device-reachability-status.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 2012104..c6d25da 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -38,7 +38,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.connectivity" includes "DATA" @device_reachability_status_03_reachableAndConnectedDataAndSms - Scenario: Check the reachability status if device is connected with DATA + Scenario: Check the reachability status if device is connected with DATA and SMS Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is connected with both data and sms, and supported by the service When the request "getReachabilityStatus" is sent From afd5c2ea3415f079911d33ce811fe482cf77de75 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:26:25 +0100 Subject: [PATCH 09/11] Update code/Test_definitions/device-reachability-status.feature Co-authored-by: Eric Murray --- code/Test_definitions/device-reachability-status.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index c6d25da..61dc7b4 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -23,7 +23,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" And the response property "$.reachable" is true - And the response property "$.connectivity" is ["SMS"] + And the response property "$.connectivity" includes "SMS" @device_reachability_status_02_reachableAndConnectedData Scenario: Check the reachability status if device is connected with DATA From e1fcfcc08ffe5cfabd3bd8c907244e549622a2f8 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:27:07 +0100 Subject: [PATCH 10/11] Update code/Test_definitions/device-reachability-status.feature Co-authored-by: Eric Murray --- code/Test_definitions/device-reachability-status.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 61dc7b4..2cb639f 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -47,7 +47,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" And the response property "$.reachable" is true - And the response property "$.connectivity" is ["DATA", "SMS"] + And the response property "$.connectivity" includes both "DATA" and "SMS" @device_reachability_status_04_notReachable Scenario: Check the reachability status for an unreachable device From 1b3075b6c0fc99f0646769b46bd90683792fd424 Mon Sep 17 00:00:00 2001 From: Maximilian Laue <112983658+maxl2287@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:49:10 +0100 Subject: [PATCH 11/11] update basepath version --- code/API_definitions/device-reachability-status.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/device-reachability-status.yaml b/code/API_definitions/device-reachability-status.yaml index a5963c0..f1ce763 100644 --- a/code/API_definitions/device-reachability-status.yaml +++ b/code/API_definitions/device-reachability-status.yaml @@ -75,7 +75,7 @@ externalDocs: url: https://github.com/camaraproject/ servers: - - url: "{apiRoot}/device-reachability-status/v0.6" + - url: "{apiRoot}/device-reachability-status/vwip" variables: apiRoot: default: http://localhost:9091