Skip to content
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
6 changes: 3 additions & 3 deletions code/API_definitions/qos-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

# Identifying the device from the access token

The two operations defined by this API (`getQosProfile` and `retrieveQoSProfiles`) both allow the API consumer to use a three-legged access token to specify a target device as a query filter. When provided, only profiles available to the specified target device will be returned. Additionally, when a two-legged access token is used, the operation `retrieveQoSProfiles` allows the API consumer to optionally specify the target device in the request body.
The two operations defined by this API (`getQosProfile` and `retrieveQosProfiles`) both allow the API consumer to use a three-legged access token to specify a target device as a query filter. When provided, only profiles available to the specified target device will be returned. Additionally, when a two-legged access token is used, the operation `retrieveQosProfiles` allows the API consumer to optionally specify the target device in the request body.

Hence, for the `retrieveQoSProfiles` operation:
Hence, for the `retrieveQosProfiles` operation:
- When invoked using a two-legged access token, the optional input device object will be used as filter if present.

- When invoked using a three-legged access token, this optional identifier in the request body MUST NOT be provided, as the device to filter will be uniquely identified from the access token.
Expand All @@ -45,7 +45,7 @@
# Multi-SIM scenario handling

In multi-SIM scenarios where more than one mobile device is associated with a phone number (e.g. a smartphone with an associated smartwatch), it might not be possible to uniquely identify a single device from that phone number. When filtering QoS profiles by device in such scenarios, one of the following options should be used:
- Use the authorisation code flow to obtain a 3-legged access token, which will automatically identify the intended device

Check warning on line 48 in code/API_definitions/qos-profiles.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

info.description mandatory template content drift

[P-027] info.description template 'additional-error-responses' has drifted from canonical at paragraph 3. canonical: Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable C... found: Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable C... Re-copy the BEGIN..END block from 'code/common/info-description-templates.yaml'. | Suggestion: Re-copy the BEGIN..END block from code/common/info-description-templates.yaml to replace the drifted content; the message identifies the first differing paragraph.
- Identify the intended device from a unique identifier for that device, such as its source IP address and port
- Check with the SIM provider whether a unique "secondary" phone number is already associated with each device, and use the secondary phone number to identify the intended device if available

Expand Down Expand Up @@ -107,7 +107,7 @@
security:
- openId:
- qos-profiles:read
operationId: retrieveQoSProfiles
operationId: retrieveQosProfiles
parameters:
- $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator"
requestBody:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQosProfiles
# Input to be provided by the implementation to the tester
#
# Implementation indications:
Expand All @@ -15,7 +15,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
# unless the path points to "../common/CAMARA_common.yaml", in which case the
# schema is the one synced from CAMARA Commonalities.

Background: Common retrieveQoSProfiles setup
Background: Common retrieveQosProfiles setup
Given an environment at "apiRoot"
And the resource "/qos-profiles/vwip/retrieve-qos-profiles"
And the header "Content-Type" is set to "application/json"
Expand All @@ -26,33 +26,33 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

############################ Happy Path Scenarios #############################################

@qos_profiles_retrieveQoSProfiles_01_generic_success_scenario
@qos_profiles_retrieveQosProfiles_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid testing device and default request body compliant with the schema
Given a request body compliant with the schema at "/components/schemas/QosProfileDeviceRequest"
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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 each item of the response array, if any, complies with the OAS schema at "/components/schemas/QosProfile"
# TBC: Add additional constraints, such as max* properties must be higher than min* equivalent properties, etc

@qos_profiles_retrieveQoSProfiles_02_filter_by_name_only
@qos_profiles_retrieveQosProfiles_02_filter_by_name_only
Scenario: Retrieve QoS profiles only by name
Given the request body property "$.name" is set to an existing QoS profile name
And the request body properties "$.device" and "$.status" are not included
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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 array has only one item which complies with the OAS schema at "/components/schemas/QosProfile"
And the response property "$[0].name" value is equal to the request body property "$.name"

@qos_profiles_retrieveQoSProfiles_03_filter_by_status_only
@qos_profiles_retrieveQosProfiles_03_filter_by_status_only
Scenario Outline: Retrieve QoS profiles only by status
Given the request body property "$.status" is set to the value <status>
And the request body properties "$.device" and "$.name" are not included
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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"
Expand All @@ -65,34 +65,34 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
| INACTIVE |
| DEPRECATED |

@qos_profiles_retrieveQoSProfiles_04_return_restricted_profiles
@qos_profiles_retrieveQosProfiles_04_return_restricted_profiles
Scenario: Return QoS Profiles restricted to certain devices
Given that implementation has QoS Profiles restricted to certain devices
And a device suitable for the restricted QoS Profiles is provided in the request body or identified by the access token
And the request body properties "$.name" and "$.status" are not included
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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 each item of the response array complies with the OAS schema at "/components/schemas/QosProfile"
And the restricted QoS Profiles are returned in the response

@qos_profiles_retrieveQoSProfiles_05_not_return_restricted_profiles
@qos_profiles_retrieveQosProfiles_05_not_return_restricted_profiles
Scenario: Do not return restricted QoS Profiles restricted to certain devices
Given that implementation has QoS Profiles restricted to certain devices
And no device is provided in the request body or identified by the access token
And the request body properties "$.name" and "$.status" are not included
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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 each item of the response array complies with the OAS schema at "/components/schemas/QosProfile"
And no restricted QoS Profile is included in the response

@qos_profiles_retrieveQoSProfiles_06_device_qos_profiles_not_found
@qos_profiles_retrieveQosProfiles_06_device_qos_profiles_not_found
Scenario: Device has no QoS profiles associated
Given a device for which the service is not applicable, provided in the request body or identified by the access token
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status 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"
Expand All @@ -102,7 +102,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

# Error scenarios for management of input parameter device (C01)

@qos_profiles_retrieveQoSProfiles_C01.01_device_empty
@qos_profiles_retrieveQosProfiles_C01.01_device_empty
Scenario: The device value is an empty object
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body property "$.device" is set to: {}
Expand All @@ -114,7 +114,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@qos_profiles_retrieveQoSProfiles_C01.02_device_identifiers_not_schema_compliant
@qos_profiles_retrieveQosProfiles_C01.02_device_identifiers_not_schema_compliant
Scenario Outline: Some device identifier value does not comply with the schema
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body property "<device_identifier>" does not comply with the OAS schema at "<oas_spec_schema>"
Expand All @@ -134,7 +134,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
| $.device.networkAccessIdentifier | ../common/CAMARA_common.yaml#/components/schemas/NetworkAccessIdentifier |

# This scenario may happen e.g. with 2-legged access tokens, which do not identify a single device.
@qos_profiles_retrieveQoSProfiles_C01.03_device_not_found
@qos_profiles_retrieveQosProfiles_C01.03_device_not_found
Scenario: Some identifier cannot be matched to a device
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body property "$.device" is compliant with the schema but does not identify a valid device
Expand All @@ -146,7 +146,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
And the response property "$.code" is "IDENTIFIER_NOT_FOUND"
And the response property "$.message" contains a user friendly text

@qos_profiles_retrieveQoSProfiles_C01.04_unnecessary_device
@qos_profiles_retrieveQosProfiles_C01.04_unnecessary_device
Scenario: Device not to be included when it can be deduced from the access token
Given the header "Authorization" is set to a valid access token identifying a device
And the request body property "$.device" is set to a valid device
Expand All @@ -158,7 +158,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
And the response property "$.code" is "UNNECESSARY_IDENTIFIER"
And the response property "$.message" contains a user-friendly text

@qos_profiles_retrieveQoSProfiles_C01.06_unsupported_device
@qos_profiles_retrieveQosProfiles_C01.06_unsupported_device
Scenario: None of the provided device identifiers is supported by the implementation
Given that some types of device identifiers are not supported by the implementation
And the header "Authorization" is set to a valid access token which does not identify a single device
Expand All @@ -172,7 +172,7 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
And the response property "$.message" contains a user-friendly text

# When the service is only offered to certain types of devices or subscriptions, e.g. IoT, B2C, etc.
@qos_profiles_retrieveQoSProfiles_C01.07_device_not_supported
@qos_profiles_retrieveQosProfiles_C01.07_device_not_supported
Scenario: Service not available for the device
Given that the service is not available for all devices commercialized by the operator
And a valid device, identified by the token or provided in the request body, for which the service is not applicable
Expand All @@ -186,21 +186,21 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

# Syntax Error scenarios

@qos_profiles_retrieveQoSProfiles_400.01_schema_not_compliant
@qos_profiles_retrieveQosProfiles_400.01_schema_not_compliant
Scenario: Invalid Argument. Generic Syntax Exception
Given the request body is set to any value which is not compliant with the schema at "/components/schemas/QosProfileDeviceRequest"
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 400
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@qos_profiles_retrieveQoSProfiles_400.02_no_request_body
@qos_profiles_retrieveQosProfiles_400.02_no_request_body
Scenario: Missing request body
Given the request body is not included
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 400
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
Expand All @@ -212,10 +212,10 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
# QosProfileDeviceRequest has no required properties, so an empty object is a
# valid request returning all profiles (see scenario 05_not_return_restricted_profiles)

@qos_profiles_retrieveQoSProfiles_400.03_invalid_x-correlator
@qos_profiles_retrieveQosProfiles_400.03_invalid_x-correlator
Scenario: Invalid x-correlator header
Given the header "x-correlator" does not comply with the schema at "../common/CAMARA_common.yaml#/components/schemas/XCorrelator"
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
Expand All @@ -227,11 +227,11 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

# Generic 401 errors

@qos_profiles_retrieveQoSProfiles_401.01_no_authorization_header
@qos_profiles_retrieveQosProfiles_401.01_no_authorization_header
Scenario: Error response for no header "Authorization"
Given the header "Authorization" is not sent
And the request body is set to a valid request body
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 401
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
Expand All @@ -240,23 +240,23 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles
And the response property "$.message" contains a user friendly text

# In this case both codes could make sense depending on whether the access token can be refreshed or not
@qos_profiles_retrieveQoSProfiles_401.02_expired_access_token
@qos_profiles_retrieveQosProfiles_401.02_expired_access_token
Scenario: Error response for expired access token
Given the header "Authorization" is set to an expired access token
And the request body is set to a valid request body
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 401
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@qos_profiles_retrieveQoSProfiles_401.03_invalid_access_token
@qos_profiles_retrieveQosProfiles_401.03_invalid_access_token
Scenario: Error response for invalid access token
Given the header "Authorization" is set to an invalid access token
And the request body is set to a valid request body
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 401
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
Expand All @@ -266,10 +266,10 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

# Generic 403 errors

@qos_profiles_retrieveQoSProfiles_403.01_missing_access_token_scope
@qos_profiles_retrieveQosProfiles_403.01_missing_access_token_scope
Scenario: Missing access token scope
Given the header "Authorization" is set to an access token that does not include scope "qos-profiles:read"
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 403
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response header "Content-Type" is "application/json"
Expand All @@ -279,13 +279,13 @@ Feature: CAMARA QoS Profiles API, vwip - Operation retrieveQoSProfiles

# Generic 429 errors

@qos_profiles_retrieveQoSProfiles_429.01_too_many_requests
@qos_profiles_retrieveQosProfiles_429.01_too_many_requests
# To test this scenario the environment has to be configured to reject requests reaching the threshold limit set.
Scenario: Request is rejected due to threshold policy
Given a valid request for "retrieveQoSProfiles"
Given a valid request for "retrieveQosProfiles"
And the header "Authorization" is set to a valid access token
And the threshold of requests has been reached
When the request "retrieveQoSProfiles" is sent
When the request "retrieveQosProfiles" is sent
Then the response status code is 429
And the response property "$.status" is 429
And the response property "$.code" is "TOO_MANY_REQUESTS"
Expand Down