Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align quality-on-demand with Commonalties regarding optional device object and error messages #326

Merged
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
255d889
Update quality-on-demand.yaml
hdamker Jul 19, 2024
d8031d4
Update quality-on-demand.yaml
hdamker Jul 19, 2024
17712dd
Update quality-on-demand.yaml
hdamker Jul 19, 2024
e23a590
Update quality-on-demand.yaml
hdamker Jul 19, 2024
654aa3c
Merge branch 'camaraproject:main' into 313-align-with-commonality-dec…
hdamker Jul 29, 2024
c8b843a
Update quality-on-demand.yaml
hdamker Jul 29, 2024
868c06c
Update quality-on-demand.yaml
hdamker Jul 29, 2024
b349cda
Update quality-on-demand.yaml
hdamker Jul 29, 2024
d6bfb32
Update quality-on-demand.yaml
hdamker Jul 29, 2024
498ff43
Update quality-on-demand.yaml
hdamker Jul 29, 2024
74d1fe9
Update quality-on-demand.yaml
hdamker Jul 29, 2024
c69ea17
Update quality-on-demand.yaml
hdamker Jul 29, 2024
5278974
Update qos-profiles.yaml
hdamker Jul 29, 2024
126fcbd
Update qos-profiles.yaml
hdamker Jul 29, 2024
45e98bb
Update code/API_definitions/quality-on-demand.yaml
hdamker Jul 31, 2024
061776d
Update quality-on-demand.yaml
hdamker Aug 1, 2024
e4941da
Update quality-on-demand.yaml
hdamker Aug 1, 2024
033602e
Update qos-profiles.yaml
hdamker Aug 1, 2024
27a7672
Update quality-on-demand.yaml
hdamker Aug 1, 2024
984e12b
Update code/API_definitions/quality-on-demand.yaml
hdamker Aug 2, 2024
8d23c56
Update quality-on-demand.yaml
hdamker Aug 2, 2024
d70cdd8
Update quality-on-demand.yaml
hdamker Aug 2, 2024
5c9bdde
Update quality-on-demand.yaml
hdamker Aug 2, 2024
1ed6e92
Update quality-on-demand.yaml
hdamker Aug 2, 2024
151abba
Update quality-on-demand.yaml
hdamker Aug 2, 2024
eb013bd
Update qos-profiles.yaml
hdamker Aug 2, 2024
55c609a
Update quality-on-demand.yaml
hdamker Aug 5, 2024
70ea70e
Update quality-on-demand.yaml
hdamker Aug 5, 2024
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
163 changes: 103 additions & 60 deletions code/API_definitions/quality-on-demand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,41 @@ info:

It is important to remark that in cases where personal user data is processed by the API, and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of 3-legged access tokens becomes mandatory. This measure ensures that the API remains in strict compliance with user privacy preferences and regulatory obligations, upholding the principles of transparency and user-centric data control.

# Identifying a device from the access token

This specification defines the `device` object field as optional in API requests, specifically in cases where the API is accessed using a 3-legged access token, and the device can be uniquely identified by the token. This approach simplifies API usage for API consumers by relying on the device information associated with the access token used to invoke the API.

## Handling of device information:

### Optional device object for 3-legged tokens:

- When using a 3-legged access token, the device associated with the access token must be considered as the device for the API request. This means that the device object is not required in the request, and if included it must identify the same device, therefore **it is recommended NOT to include it in these scenarios** to simplify the API usage and avoid additional validations.

### Validation mechanism:

- The server will extract the device identification from the access token, if available.
- If the API request additionally includes a `device` object when using a 3-legged access token, the API will validate that the device identifier provided matches the one associated with the access token.
- If there is a mismatch, the API will respond with a 403 - INVALID_TOKEN_CONTEXT error, indicating that the device information in the request does not match the token.

### Error handling for unidentifiable devices:

- If the `device` object is not included in the request and the device information cannot be derived from the 3-legged access token, the server will return a 422 `UNIDENTIFIABLE_DEVICE` error.

### Restrictions for tokens without an associated authenticated identifier:

- For scenarios which do not have a single device identifier associated to the token during the authentication flow, e.g. 2-legged access tokens, the `device` object MUST be provided in the API request. This ensures that the device identification is explicit and valid for each API call made with these tokens.

# Further info and support

(FAQs will be added in a later version of the documentation)

version: wip

license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: wip

x-camara-commonalities: 0.4.0

externalDocs:
description: Product documentation at Camara
Expand Down Expand Up @@ -106,7 +134,7 @@ paths:
- In case of a `QOS_STATUS_CHANGED` event with `qosStatus` as `UNAVAILABLE` and `statusInfo` as `NETWORK_TERMINATED` the resources of the QoS session are not directly released, but will get deleted automatically at earliest 360 seconds after the event.

This behavior allows clients which are not receiving notification events but are polling to get the session information with the `qosStatus` `UNAVAILABLE` and `statusInfo` `NETWORK_TERMINATED`. Before a client can attempt to create a new QoD session for the same device and flow period they must release the session resources with an explicit `delete` operation if not yet automatically deleted.
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user identified by the `device` parameter must also be associated with the access token.
- The access token may be either 2-legged or 3-legged. If a 3-legged access token which is associated with a device is used, it is recommended NOT to include the `device` parameter in the request (see "Handling of device information" within the API description for details).
hdamker marked this conversation as resolved.
Show resolved Hide resolved

operationId: createSession
security:
Expand Down Expand Up @@ -195,24 +223,6 @@ paths:
status: 400
code: INVALID_ARGUMENT
message: "Expected property is missing: device"
InsufficientDeviceProperties:
hdamker marked this conversation as resolved.
Show resolved Hide resolved
summary: Device must be identified by at least one parameter
value:
status: 400
code: INVALID_ARGUMENT
message: "Insufficient properties specified: device"
InconsistentDeviceProperties:
summary: Device parameters provided identify different devices
value:
status: 400
code: INVALID_ARGUMENT
message: "Multiple inconsistent parameters specified: device"
CannotIdentifyDevice:
summary: No device can be identified from provided parameters
value:
status: 400
code: INVALID_ARGUMENT
message: "Unable to identify device from specified parameters: device"
InvalidDevicePublicPortValue:
hdamker marked this conversation as resolved.
Show resolved Hide resolved
summary: Invalid port specified for device public port
value:
Expand Down Expand Up @@ -249,12 +259,12 @@ paths:
$ref: "#/components/responses/Generic403"
"409":
$ref: "#/components/responses/SessionInConflict409"
"422":
$ref: "#/components/responses/Generic422"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"501":
$ref: "#/components/responses/Generic501"
"503":
$ref: "#/components/responses/Generic503"

Expand All @@ -267,7 +277,7 @@ paths:
Querying for QoS session resource information details

**NOTES:**
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token.
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user (and device) associated with the session must also be associated with the access token.

operationId: getSession
security:
Expand Down Expand Up @@ -324,7 +334,7 @@ paths:
There will be no notification event if the `qosStatus` was already `UNAVAILABLE`.

**NOTES:**
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token.
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user (and device) associated with the session must also be associated with the access token.

operationId: deleteSession
security:
Expand Down Expand Up @@ -373,7 +383,7 @@ paths:
- New overall session duration: 50,000 seconds (the maximum allowed)

**NOTES:**
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token.
- The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user (and device) associated with the session must also be associated with the access token.

operationId: extendQosSessionDuration
security:
Expand Down Expand Up @@ -506,7 +516,6 @@ components:
example: "c8974e592c2fa383d4a3960714"
description: Authentication token for callback API
required:
- device
- applicationServer
- qosProfile

Expand Down Expand Up @@ -727,7 +736,8 @@ components:
* `phoneNumber`
* `networkAccessIdentifier`

NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device
NOTE1: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device
hdamker marked this conversation as resolved.
Show resolved Hide resolved
NOTE2: for the Commonalities release v0.4, we are enforcing that the networkAccessIdentifier is only part of the schema for future-proofing, and CAMARA does not currently allow its use. After the CAMARA meta-release work is concluded and the relevant issues are resolved, its use will need to be explicitly documented in the guidelines.
type: object
properties:
phoneNumber:
Expand Down Expand Up @@ -871,46 +881,73 @@ components:

responses:
Generic400:
description: Invalid input
description: Bad Request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 400
code: INVALID_ARGUMENT
message: "Schema validation failed at ..."
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param.
GENERIC_400_OUT_OF_RANGE:
description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.

Generic401:
description: Unauthorized
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 401
code: UNAUTHENTICATED
message: "Authorization failed: ..."
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
value:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials.
GENERIC_401_AUTHENTICATION_REQUIRED:
description: New authentication is needed, authentication is no longer valid
value:
status: 401
code: AUTHENTICATION_REQUIRED
message: New authentication is required.

Generic403:
description: Forbidden
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 403
code: PERMISSION_DENIED
message: "Operation not allowed: ..."
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information in some field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."

SessionNotFound404:
hdamker marked this conversation as resolved.
Show resolved Hide resolved
description: Session not found
Expand Down Expand Up @@ -940,6 +977,29 @@ components:
code: CONFLICT
message: Conflict with an existing session for the same device.

Generic422:
hdamker marked this conversation as resolved.
Show resolved Hide resolved
description: Unprocessable Content
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_422_DEVICE_IDENTIFIERS_MISMATCH:
description: Inconsistency between device identifiers not pointing to the same device
value:
status: 422
code: DEVICE_IDENTIFIERS_MISMATCH
message: Provided device identifiers are not consistent.
GENERIC_422_DEVICE_NOT_APPLICABLE:
description: Service is not available for the provided device
value:
status: 422
code: DEVICE_NOT_APPLICABLE
message: The service is not available for the provided device.

Generic429:
description: Too Many Requests
headers:
Expand Down Expand Up @@ -977,23 +1037,6 @@ components:
code: INTERNAL
message: "Internal server error: ..."

Generic501:
description: Not Implemented
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_501_NOT_IMPLEMENTED:
description: Service not implemented. The use of this code should be avoided as far as possible to get the objective to reach aligned implementations
value:
status: 501
code: NOT_IMPLEMENTED
message: This functionality is not implemented yet.

Generic503:
description: Service Unavailable
headers:
Expand Down