Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
openapi: 3.0.3
info:
title: Media Streaming Rate
title: Device Media Streaming Rate
version: wip
x-camara-commonalities: wip
description: |
The Media Streaming Rate API allows an application developer to retrieve the maximum
The Device Media Streaming Rate API allows an application developer to retrieve the maximum
downstream media streaming rate that the network allows for a given device.

# Introduction
Expand Down Expand Up @@ -49,7 +49,7 @@ info:

The diagram below illustrates this workflow:

![Media Streaming Rate API Sequence Diagram](https://raw.githubusercontent.com/camaraproject/DeviceMediaStreamingRate/main/documentation/SupportingDocuments/media-rate-sequence-flow.png)
![Device Media Streaming Rate API Sequence Diagram](https://raw.githubusercontent.com/camaraproject/DeviceMediaStreamingRate/main/documentation/SupportingDocuments/media-rate-sequence-flow.png)

<!-- CAMARA:MANDATORY:authorization-and-authentication:BEGIN -->

Expand Down Expand Up @@ -105,14 +105,14 @@ externalDocs:
url: https://github.com/camaraproject/DeviceMediaStreamingRate

servers:
- url: "{apiRoot}/media-streaming-rate/vwip"
- url: "{apiRoot}/device-media-streaming-rate/vwip"
variables:
apiRoot:
default: http://localhost:9091
description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath`

tags:
- name: Media Streaming Rate
- name: Device Media Streaming Rate
description: |
Retrieve the maximum downstream media streaming rate permitted for a given device.

Expand All @@ -121,9 +121,9 @@ paths:
post:
security:
- openId:
- media-streaming-rate:retrieve-maximum-downstream-media-rate
- device-media-streaming-rate:retrieve-maximum-downstream-media-rate
tags:
- Media Streaming Rate
- Device Media Streaming Rate
summary: Get maximum downstream media streaming rate
description: |
Retrieve the maximum downstream media streaming rate that the network permits for a device.
Expand All @@ -141,7 +141,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/MediaStreamingRateRequest"
$ref: "#/components/schemas/DeviceMediaStreamingRateRequest"
required: true
responses:
"200":
Expand All @@ -152,7 +152,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/MediaStreamingRateResponse"
$ref: "#/components/schemas/DeviceMediaStreamingRateResponse"
"400":
$ref: "#/components/responses/Generic400"
"401":
Expand Down Expand Up @@ -357,14 +357,14 @@ components:
message: Rate limit reached.

schemas:
MediaStreamingRateRequest:
DeviceMediaStreamingRateRequest:
type: object
description: Request body identifying the device for which the permitted media streaming rate is retrieved.
properties:
device:
$ref: "../common/CAMARA_common.yaml#/components/schemas/Device"

MediaStreamingRateResponse:
DeviceMediaStreamingRateResponse:
type: object
description: The maximum downstream media streaming rate permitted for the device.
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownstreamMediaRate
Feature: CAMARA Device Media Streaming Rate API, vwip - Operation retrieveMaximumDownstreamMediaRate

# Input to be provided by the implementation to the tester
#
Expand All @@ -17,64 +17,64 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
# Note: Unless a scenario states otherwise, request bodies are assumed to be otherwise
# valid, with only the property under test deviating.
#
# References to OAS spec schemas refer to schemas specified in media-streaming-rate.yaml
# References to OAS spec schemas refer to schemas specified in device-media-streaming-rate.yaml
# or, for referenced common schemas, in CAMARA_common.yaml

Background: Common Media Streaming Rate setup
Background: Common Device Media Streaming Rate setup
Given an environment at "apiRoot"
And the resource "/media-streaming-rate/vwip/retrieve-maximum-downstream-media-rate"
And the resource "/device-media-streaming-rate/vwip/retrieve-maximum-downstream-media-rate"
And the header "Content-Type" is set to "application/json"
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
And the request body is set by default to a request body compliant with the schema at "#/components/schemas/MediaStreamingRateRequest"
And the request body is set by default to a request body compliant with the schema at "#/components/schemas/DeviceMediaStreamingRateRequest"

##########################
# Happy path scenarios
##########################

@media_streaming_rate_01_two_legged_device_in_body
@device_media_streaming_rate_01_two_legged_device_in_body
Scenario: Retrieve the maximum downstream media streaming rate with a two-legged access token
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 a valid device supported by the implementation
When the request "retrieveMaximumDownstreamMediaRate" 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 body complies with the OAS schema at "#/components/schemas/MediaStreamingRateResponse"
And the response body complies with the OAS schema at "#/components/schemas/DeviceMediaStreamingRateResponse"
And the response property "$.maxDownstreamMediaRate.value" is an integer greater than or equal to 0
And the response property "$.maxDownstreamMediaRate.unit" is one of "bps", "kbps", "Mbps", "Gbps" or "Tbps"
And the response property "$.device", if present, contains a single device identifier that was included in the request

@media_streaming_rate_02_three_legged_device_from_token
@device_media_streaming_rate_02_three_legged_device_from_token
Scenario: Retrieve the maximum downstream media streaming rate with a three-legged access token
Given the header "Authorization" is set to a valid access token identifying a device
And the request body property "$.device" is not included
When the request "retrieveMaximumDownstreamMediaRate" 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 body complies with the OAS schema at "#/components/schemas/MediaStreamingRateResponse"
And the response body complies with the OAS schema at "#/components/schemas/DeviceMediaStreamingRateResponse"
And the response property "$.maxDownstreamMediaRate.value" is an integer greater than or equal to 0
And the response property "$.maxDownstreamMediaRate.unit" is one of "bps", "kbps", "Mbps", "Gbps" or "Tbps"
And the response property "$.device" is not present

@media_streaming_rate_03_multiple_device_identifiers
@device_media_streaming_rate_03_multiple_device_identifiers
Scenario: Retrieve the maximum downstream media streaming rate providing more than one device identifier
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body property "$.device" includes more than one identifier type, all identifying the same valid device
When the request "retrieveMaximumDownstreamMediaRate" 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 body complies with the OAS schema at "#/components/schemas/MediaStreamingRateResponse"
And the response body complies with the OAS schema at "#/components/schemas/DeviceMediaStreamingRateResponse"
And the response property "$.device" is present
And the response property "$.device" contains a single device identifier that was included in the request

##########################
# 400 - Request body validation
##########################

@media_streaming_rate_400.1_no_request_body
@device_media_streaming_rate_400.1_no_request_body
Scenario: Missing request body
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body is not included
Expand All @@ -84,7 +84,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_400.2_empty_request_body
@device_media_streaming_rate_400.2_empty_request_body
Scenario: Empty object as request body
Given the header "Authorization" is set to a valid access token which does not identify a single device
And the request body is set to "{}"
Expand All @@ -95,7 +95,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.message" contains a user friendly text

# Request body strictness: undeclared properties are rejected at any nesting level
@media_streaming_rate_400.3_unknown_property
@device_media_streaming_rate_400.3_unknown_property
Scenario Outline: A request body with an undeclared property is rejected
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 a valid device supported by the implementation
Expand All @@ -115,7 +115,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
# Device identifier errors (Commonalities C01)
##########################

@media_streaming_rate_C01.01_device_empty
@device_media_streaming_rate_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 @@ -125,7 +125,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_C01.02_device_identifiers_not_schema_compliant
@device_media_streaming_rate_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 @@ -143,7 +143,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
| $.device.networkAccessIdentifier | #/components/schemas/NetworkAccessIdentifier |

# This scenario may happen e.g. with 2-legged access tokens, which do not identify a single device.
@media_streaming_rate_C01.03_device_not_found
@device_media_streaming_rate_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 @@ -153,7 +153,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "IDENTIFIER_NOT_FOUND"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_C01.04_unnecessary_device
@device_media_streaming_rate_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 @@ -163,7 +163,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "UNNECESSARY_IDENTIFIER"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_C01.05_missing_device
@device_media_streaming_rate_C01.05_missing_device
Scenario: Device not included and cannot be deduced from the access token
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 not included
Expand All @@ -173,7 +173,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "MISSING_IDENTIFIER"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_C01.06_unsupported_device
@device_media_streaming_rate_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 @@ -185,7 +185,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
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.
@media_streaming_rate_C01.07_device_not_supported
@device_media_streaming_rate_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 @@ -199,7 +199,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
# 401 - Authentication errors
##########################

@media_streaming_rate_401.1_no_authorization_header
@device_media_streaming_rate_401.1_no_authorization_header
Scenario: No Authorization header
Given the header "Authorization" is removed
And the request body property "$.device" is set to a valid device supported by the implementation
Expand All @@ -209,7 +209,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_401.2_expired_access_token
@device_media_streaming_rate_401.2_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
And the request body property "$.device" is set to a valid device supported by the implementation
Expand All @@ -219,7 +219,7 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@media_streaming_rate_401.3_invalid_access_token
@device_media_streaming_rate_401.3_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
And the request body property "$.device" is set to a valid device supported by the implementation
Expand All @@ -233,9 +233,9 @@ Feature: CAMARA Media Streaming Rate API, vwip - Operation retrieveMaximumDownst
# 403 - Authorization errors
##########################

@media_streaming_rate_403.1_missing_access_token_scope
@device_media_streaming_rate_403.1_missing_access_token_scope
Scenario: Access token does not include the required scope
Given the header "Authorization" is set to a valid access token which does not include the scope "media-streaming-rate:retrieve-maximum-downstream-media-rate"
Given the header "Authorization" is set to a valid access token which does not include the scope "device-media-streaming-rate:retrieve-maximum-downstream-media-rate"
And the request body property "$.device" is set to a valid device supported by the implementation
When the request "retrieveMaximumDownstreamMediaRate" is sent
Then the response status code is 403
Expand Down