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

Update error responses and test cases to comply with Commonalities 0.5.0 #391

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6147be3
Update quality-on-demand.yaml
eric-murray Jan 9, 2025
0890191
Update qos-profiles.yaml
eric-murray Jan 9, 2025
b4d6908
Update qod-provisioning.yaml
eric-murray Jan 9, 2025
44fbcdd
Update quality-on-demand.yaml
eric-murray Jan 9, 2025
4eb09eb
Update qos-profiles.yaml
eric-murray Jan 9, 2025
67d317e
Update qod-provisioning.yaml
eric-murray Jan 9, 2025
9022747
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 9, 2025
9568741
Update qod-provisioning-deleteProvisioning.feature
eric-murray Jan 9, 2025
b201f09
Update qod-provisioning-getProvisioningById.feature
eric-murray Jan 9, 2025
9edbf0b
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 9, 2025
fcee50e
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 9, 2025
fc9e3f7
Update qod-provisioning-deleteProvisioning.feature
eric-murray Jan 9, 2025
9839871
Update qod-provisioning-getProvisioningById.feature
eric-murray Jan 9, 2025
4a63f7a
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 9, 2025
cc80d92
Update qos-profiles-getQosProfile.feature
eric-murray Jan 9, 2025
0871500
Update qos-profiles-retrieveQoSProfiles.feature
eric-murray Jan 9, 2025
6a797e3
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 9, 2025
a2549ba
Update quality-on-demand-createSession.feature
eric-murray Jan 9, 2025
14f4ef9
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 9, 2025
2de4ea5
Update qod-provisioning-deleteProvisioning.feature
eric-murray Jan 9, 2025
79ef0d0
Update qod-provisioning-getProvisioningById.feature
eric-murray Jan 9, 2025
9da7ebb
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 9, 2025
1606547
Update qod-provisioning-deleteProvisioning.feature
eric-murray Jan 9, 2025
e56f610
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 9, 2025
2c302c6
Update qos-profiles-getQosProfile.feature
eric-murray Jan 9, 2025
836f1b0
Update qos-profiles-retrieveQoSProfiles.feature
eric-murray Jan 9, 2025
143b99c
Update quality-on-demand-deleteSession.feature
eric-murray Jan 9, 2025
0f17774
Update quality-on-demand-extendQosSessionDuration.feature
eric-murray Jan 9, 2025
fce4fe2
Update quality-on-demand-getSession.feature
eric-murray Jan 9, 2025
88e6691
Update quality-on-demand-retrieveSessionsByDevice.feature
eric-murray Jan 9, 2025
7dc71f7
Update quality-on-demand-createSession.feature
eric-murray Jan 10, 2025
c746460
Update qod-provisioning.yaml
eric-murray Jan 10, 2025
7e85ec6
Update qos-profiles.yaml
eric-murray Jan 10, 2025
45c891d
Update quality-on-demand.yaml
eric-murray Jan 10, 2025
05c2bf9
Update qod-provisioning.yaml
eric-murray Jan 10, 2025
d64e9a3
Update qod-provisioning.yaml
eric-murray Jan 13, 2025
62b0ffa
Update qos-profiles.yaml
eric-murray Jan 13, 2025
4baab8a
Update quality-on-demand.yaml
eric-murray Jan 13, 2025
15090f2
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 14, 2025
d4aafd9
Update quality-on-demand-createSession.feature
eric-murray Jan 14, 2025
6fc3275
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 14, 2025
08370f0
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 14, 2025
edd2c51
Update quality-on-demand-createSession.feature
eric-murray Jan 14, 2025
b76fb95
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 14, 2025
a281bf8
Update qod-provisioning-deleteProvisioning.feature
eric-murray Jan 14, 2025
3c2066b
Update qod-provisioning-getProvisioningById.feature
eric-murray Jan 14, 2025
14a90ad
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 14, 2025
9c8997b
Update qos-profiles-getQosProfile.feature
eric-murray Jan 14, 2025
28edd70
Update qos-profiles-retrieveQoSProfiles.feature
eric-murray Jan 14, 2025
da4d45d
Update quality-on-demand-deleteSession.feature
eric-murray Jan 14, 2025
8757a40
Update quality-on-demand-extendQosSessionDuration.feature
eric-murray Jan 14, 2025
0800211
Update quality-on-demand-getSession.feature
eric-murray Jan 14, 2025
93c0f79
Update quality-on-demand-retrieveSessionsByDevice.feature
eric-murray Jan 14, 2025
8b4622b
Update qod-provisioning-createProvisioning.feature
eric-murray Jan 14, 2025
cd9cf41
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 14, 2025
8f4cc13
Update qos-profiles-retrieveQoSProfiles.feature
eric-murray Jan 14, 2025
a077bdf
Update quality-on-demand-createSession.feature
eric-murray Jan 14, 2025
ec20f6a
Update quality-on-demand-createSession.feature
eric-murray Jan 14, 2025
5ffeee4
Update quality-on-demand-retrieveSessionsByDevice.feature
eric-murray Jan 14, 2025
a6b827c
Update qod-provisioning-retrieveProvisioningByDevice.feature
eric-murray Jan 14, 2025
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
269 changes: 150 additions & 119 deletions code/API_definitions/qod-provisioning.yaml

Large diffs are not rendered by default.

194 changes: 111 additions & 83 deletions code/API_definitions/qos-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,19 @@ 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
# Identifying the 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.
This API requires the API consumer to identify a device as the subject of the API as follows:
- When the API is invoked using a two-legged access token, the subject will be identified from the optional `device` object, which therefore MUST be provided.

## Handling of device information:
- When a three-legged access token is used however, this optional identifier MUST NOT be provided, as the subject will be uniquely identified from the access token.

### Optional device object for 3-legged tokens:
This approach simplifies API usage for API consumers using a three-legged access token to invoke the API by relying on the information that is associated with the access token and was identified during the authentication process.

- 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.
## Error handling:
- If the subject cannot be identified from the access token and the optional `device` object is not included in the request, then the server will return an error with the `422 MISSING_IDENTIFIER` error code.

### 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.
- If the subject can be identified from the access token and the optional `device` object is also included in the request, then the server will return an error with the `422 UNNECESSARY_IDENTIFIER` error code. This will be the case even if the same device is identified by these two methods, as the server is unable to make this comparison.

# Multi-SIM scenario handling

Expand All @@ -63,7 +53,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: wip
x-camara-commonalities: 0.4.0
x-camara-commonalities: 0.5


externalDocs:
Expand Down Expand Up @@ -132,10 +122,6 @@ paths:
$ref: "#/components/responses/Generic422"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"

/qos-profiles/{name}:
get:
Expand Down Expand Up @@ -179,10 +165,6 @@ paths:
$ref: "#/components/responses/Generic404"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"

components:
securitySchemes:
Expand Down Expand Up @@ -541,7 +523,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
- OUT_OF_RANGE
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
Expand All @@ -564,7 +556,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 401
code:
enum:
- UNAUTHENTICATED
- AUTHENTICATION_REQUIRED
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
Expand All @@ -587,20 +589,23 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
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."

Generic404:
description: Not found
Expand All @@ -610,7 +615,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
Expand All @@ -627,7 +641,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- NOT_FOUND
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
Expand All @@ -639,7 +663,7 @@ components:
description: Device identifier not found
value:
status: 404
code: DEVICE_NOT_FOUND
code: IDENTIFIER_NOT_FOUND
message: Device identifier not found.

Generic422:
Expand All @@ -650,26 +674,51 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 422
code:
enum:
- IDENTIFIER_MISMATCH
- SERVICE_NOT_APPLICABLE
- MISSING_IDENTIFIER
- UNSUPPORTED_IDENTIFIER
- UNNECESSARY_IDENTIFIER
examples:
GENERIC_422_DEVICE_IDENTIFIERS_MISMATCH:
description: Inconsistency between device identifiers not pointing to the same device
GENERIC_422_IDENTIFIER_MISMATCH:
description: Inconsistency between 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
code: IDENTIFIER_MISMATCH
message: Provided identifiers are not consistent.
GENERIC_422_SERVICE_NOT_APPLICABLE:
description: Service not applicable for the provided identifier
value:
status: 422
code: DEVICE_NOT_APPLICABLE
message: The service is not available for the provided device.
GENERIC_422_UNIDENTIFIABLE_DEVICE:
description: Service is not available for the provided device
code: SERVICE_NOT_APPLICABLE
message: The service is not available for the provided identifier.
GENERIC_422_MISSING_IDENTIFIER:
description: An identifier is not included in the request and the device or phone number identification cannot be derived from the access token
value:
status: 422
code: UNIDENTIFIABLE_DEVICE
code: MISSING_IDENTIFIER
message: The device cannot be identified.
GENERIC_422_UNSUPPORTED_IDENTIFIER:
description: None of the provided identifiers is supported by the implementation
value:
status: 422
code: UNSUPPORTED_IDENTIFIER
message: The identifier provided is not supported.
GENERIC_422_UNNECESSARY_IDENTIFIER:
description: An explicit identifier is provided when a device or phone number has already been identified from the access token
value:
status: 422
code: UNNECESSARY_IDENTIFIER
message: The device is already identified by the access token.

Generic429:
description: Too Many Requests
Expand All @@ -679,7 +728,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 429
code:
enum:
- QUOTA_EXCEEDED
- TOO_MANY_REQUESTS
examples:
GENERIC_429_QUOTA_EXCEEDED:
description: Request is rejected due to exceeding a business quota limit
Expand All @@ -693,34 +752,3 @@ components:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate limiting.

Generic500:
description: Internal server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 500
code: INTERNAL
message: "Internal server error: ..."

Generic503:
description: Service Unavailable
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_503_UNAVAILABLE:
description: Service is not available. Temporary situation usually related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
message: Service Unavailable.
Loading
Loading