From ad1fb15a09bfd9e8c142a70f2d22af4fd073fbd5 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 2 Dec 2024 16:34:00 +0100 Subject: [PATCH 01/12] Added supported features default value in common operations and fixed test plan with new behavior of supported features at events --- .../testplan/api_events_service/README.md | 69 ++++++++++++++++--- .../testplan/common_operations/README.md | 4 ++ 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/doc/testing/testplan/api_events_service/README.md b/doc/testing/testplan/api_events_service/README.md index 73106b7..17ce0b3 100644 --- a/doc/testing/testplan/api_events_service/README.md +++ b/doc/testing/testplan/api_events_service/README.md @@ -264,6 +264,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE, receive the notification when AEF Send **TO** logging service result of invocations to their APIs. + If customer want to receive log information then Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -278,7 +279,7 @@ At this documentation you will have all information and related files and exampl 1. Register provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header 6. Emulate Success and Failure on API invocation of provider by Invoker, using Invocation Logs API. @@ -302,9 +303,10 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_INVOCATION_SUCCESS','SERVICE_API_INVOCATION_FAILURE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** - 7. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: + 6. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs** 2. body [log entry request body] with: 1. aefId from provider published. @@ -350,7 +352,7 @@ At this documentation you will have all information and related files and exampl 1. Register provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header 6. Provider publish new API. 7. Provider remove published API. @@ -375,6 +377,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 6. Publish new Service API at CCF: @@ -424,7 +427,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header at event subscription 6. Provider update information of Service API Published. @@ -449,6 +452,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_UPDATE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 7. Update published API at CCF: @@ -490,7 +494,7 @@ At this documentation you will have all information and related files and exampl **Execution Steps**: 1. Register Provider at CCF - 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. + 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. Enhanced_event_report active at supported features. 3. Register Invoker and Onboard Invoker at CCF 4. Update Onboarding Information at CCF with a minor change on "notificationDestination" 5. Offboard Invoker @@ -503,6 +507,7 @@ At this documentation you will have all information and related files and exampl 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: 1. events: **['API_INVOKER_ONBOARDED', 'API_INVOKER_UPDATED', 'API_INVOKER_OFFBOARDED']** + 2. supportedFeatures: binary 0100 -> string **4** 3. Use **Provider AMF Certificate** 4. Perform [invoker onboarding] 5. Update information of previously onboarded Invoker: @@ -558,7 +563,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider at CCF. 2. Publish a provider API with name **service_1**. 3. Register Invoker and Onboard Invoker at CCF. - 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. + 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. Enhanced_event_report active at supported features. 5. Discover APIs filtered by **aef_id** 6. Create Security Context for Invoker. 7. Provider Retrieve ACL @@ -573,6 +578,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['ACCESS_CONTROL_POLICY_UPDATE']** 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Provider AMF Certificate** 5. Discover published APIs 6. Create Security Context for Invoker @@ -627,7 +633,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider at CCF. 2. Publish a provider API with name **service_1**. 3. Register Invoker and Onboard Invoker at CCF. - 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. Enhanced_event_report active at supported features. 5. Discover APIs filtered by **aef_id** 6. Create Security Context for Invoker. 7. Provider Retrieve ACL. @@ -643,6 +649,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE']** 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 5. Discover published APIs 6. Create Security Context for Invoker @@ -653,7 +660,7 @@ At this documentation you will have all information and related files and exampl * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** * Use **serviceApiId** and **aefId** * Use **AEF Provider Certificate** - 3. Delete Security Context of Invoker by Provider: + 8. Delete Security Context of Invoker by Provider: * Send **DELETE** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** * Use **AEF Certificate** @@ -745,6 +752,52 @@ At this documentation you will have all information and related files and exampl 1. One Event should be **ACCESS_CONTROL_POLICY_UNAVAILABLE** without **eventDetail**. 2. One Event should be **API_INVOKER_AUTHORIZATION_REVOKED** without **eventDetail**. +--- +## Test Case 13: Creates a new individual CAPIF Event Subscription without supported features attribute. + +**Test ID**: ***capif_api_events-13*** + +**Description**: + + This test case will check error when CAPIF subscriber (Invoker or Publisher) Subscribe to Events without supported features attribute. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF + 2. Subscribe to Events without supported features + 3. Retrieve {subscriberId} and {subscriptionId} from Location Header + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + + 2. Event Subscription: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] + 1. supportedFeatures NOT PRESENT. + 3. Use **Invoker Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + + 1. Response to Event Subscription must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "supportedFeatures not present in request". + * cause with message "supportedFeatures not present". + --- [invoker onboard request body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" diff --git a/doc/testing/testplan/common_operations/README.md b/doc/testing/testplan/common_operations/README.md index 48d31a8..eb145f8 100644 --- a/doc/testing/testplan/common_operations/README.md +++ b/doc/testing/testplan/common_operations/README.md @@ -1,5 +1,9 @@ # Common Operations +## Default Supported Features + +By default all required supported features on POST Request will be present and set to "0" unless test define it with other value. Also it can be set to NONE is we want to test supported features not present. + ## Register new user In order to use OpenCAPIF we must add a new user. This new user can onboard/register any Invokers or Providers. -- GitLab From 5655ed6cb9606065040c161eeae36a6404813a9a Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 3 Dec 2024 09:48:40 +0100 Subject: [PATCH 02/12] supported default examples set to 0 and new tests 14 at publish test suite --- .../service_api_description_post_example.json | 2 +- .../event_subscription.json | 2 +- .../invoker_details_post_example.json | 2 +- .../invoker_details_put_example.json | 6 +- .../testplan/api_publish_service/README.md | 77 ++++++++++++++++++- .../service_api_description_post_example.json | 2 +- .../service_security.json | 2 +- 7 files changed, 84 insertions(+), 9 deletions(-) diff --git a/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json b/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json index b725b42..10022ce 100644 --- a/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json +++ b/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json @@ -95,7 +95,7 @@ } ], "description": "string", - "supportedFeatures": "fffff", + "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ diff --git a/doc/testing/testplan/api_events_service/event_subscription.json b/doc/testing/testplan/api_events_service/event_subscription.json index 40dc09b..6614530 100644 --- a/doc/testing/testplan/api_events_service/event_subscription.json +++ b/doc/testing/testplan/api_events_service/event_subscription.json @@ -23,7 +23,7 @@ "events": ["SERVICE_API_AVAILABLE", "API_INVOKER_ONBOARDED"], "notificationDestination": "http://robot.testing", "requestTestNotification": true, - "supportedFeatures": "aaa", + "supportedFeatures": "0", "websockNotifConfig": { "requestWebsocketUri": true, "websocketUri": "websocketUri" diff --git a/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json b/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json index c306a17..8eb7514 100644 --- a/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json +++ b/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://host.docker.internal:8086/netapp_callback", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "apiInvokerInformation": "ROBOT_TESTING_INVOKER", "websockNotifConfig": { "requestWebsocketUri": true, diff --git a/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json b/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json index 37a1eef..e96aa03 100644 --- a/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json +++ b/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://host.docker.internal:8086/netapp_new_callback", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "apiInvokerInformation": "ROBOT_TESTING_INVOKER", "websockNotifConfig": { "requestWebsocketUri": true, @@ -21,7 +21,7 @@ "capifProvDoms": ["capifProvDoms", "capifProvDoms"], "isShareable": true }, - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "description": "description", "apiSuppFeats": "fffffff", "apiId": "apiId", @@ -209,7 +209,7 @@ "capifProvDoms": ["capifProvDoms", "capifProvDoms"], "isShareable": true }, - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "description": "description", "apiSuppFeats": "fffffff", "apiId": "apiId", diff --git a/doc/testing/testplan/api_publish_service/README.md b/doc/testing/testplan/api_publish_service/README.md index 928c95e..86b8c67 100644 --- a/doc/testing/testplan/api_publish_service/README.md +++ b/doc/testing/testplan/api_publish_service/README.md @@ -606,7 +606,7 @@ At this documentation you will have all information and related files and exampl ## Test Case 13: Delete APIs Published by NON Authorised apfId -**Test ID**: ***capif_api_publish_service-12*** +**Test ID**: ***capif_api_publish_service-13*** **Description**: @@ -646,6 +646,81 @@ At this documentation you will have all information and related files and exampl * detail with message "User not authorized". * cause with message "Certificate not authorized". +## Test Case 14: Check Two Published APIs with different APFs are removed when Provider is deleted + +**Test ID**: ***capif_api_publish_service-13*** + +**Description**: + + This test case will check that a Provider registered with two APFs, with one API published with each APF are removed properly when provider is removed. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority). + +**Execution Steps**: + + 1. Register Provider with 2 APFs at CCF and store certificates. + 2. Publish **service_1** API with **APF_1** + 3. Publish **service_2** API with **APF_2** + 4. Retrieve APIs published by **APF_1** + 5. Retrieve APIs published by **APF_2** + 6. Remove Provider by **AMF** + +**Information of Test**: + + 1. Perform [Provider Registration] and [Invoker Onboarding] + + 2. Publish **service_1** Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis** + * body [service api description] with apiName **service_1** + * Get apiId + * Use **APF_1 Certificate** + 3. Publish **service_2** Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId2}/service-apis** + * body [service api description] with apiName **service_2** + * Get apiId + * Use **APF_2 Certificate** + 4. Retrieve all published APIs by **APF_1**: + * Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis** + * Use **APF_1 Certificate** + 5. Retrieve all published APIs by **APF_2**: + * Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId2}/service-apis** + * Use **APF_2 Certificate** + 6. Get Number of services published by superadmin: + 1. Store value obtained in **services_present_on_ccf_after_publish** + 7. Delete registered provider: + * Send **DELETE** **https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}** + * Use AMF Certificate. + 8. Get Number of services published by superadmin: + 1. Store value obtained in **services_present_on_ccf_after_delete_provider** + + +**Expected Result**: + + 1. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + 1. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId1}/service-apis/{serviceApiId}** + 2. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId2}/service-apis/{serviceApiId}** + 3. Response to Retrieve all published APIs by **APF_1**: + 1. **200 OK** + 2. Response body must return an array of **ServiceAPIDescription** data. + 3. Array must contain all previously published APIs by **APF_1**. + 4. Response to Retrieve all published APIs by **APF_2**: + 1. **200 OK** + 2. Response body must return an array of **ServiceAPIDescription** data. + 3. Array must contain all previously published APIs by **APF_2**. + 5. Delete Provider: + 1. **204 No Content** response. + 6. Check two APIs where removed after remove provider: + 1. **services_present_on_ccf_after_publish** - **services_present_on_ccf_after_delete_provider** = 2 + [service api description]: ./service_api_description_post_example.json "Service API Description Request" [publisher register body]: ./publisher_register_body.json "Publish register Body" diff --git a/doc/testing/testplan/api_publish_service/service_api_description_post_example.json b/doc/testing/testplan/api_publish_service/service_api_description_post_example.json index b725b42..10022ce 100644 --- a/doc/testing/testplan/api_publish_service/service_api_description_post_example.json +++ b/doc/testing/testplan/api_publish_service/service_api_description_post_example.json @@ -95,7 +95,7 @@ } ], "description": "string", - "supportedFeatures": "fffff", + "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ diff --git a/doc/testing/testplan/api_security_service/service_security.json b/doc/testing/testplan/api_security_service/service_security.json index ad7bc1a..2798067 100644 --- a/doc/testing/testplan/api_security_service/service_security.json +++ b/doc/testing/testplan/api_security_service/service_security.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://robot.testing", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "securityInfo": [{ "authenticationInfo": "authenticationInfo", "authorizationInfo": "authorizationInfo", -- GitLab From 087a8498698f174d0b21524424661c1ed7f97ede Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 3 Dec 2024 13:38:56 +0100 Subject: [PATCH 03/12] New tests on events test plan --- doc/releasenotes.md | 42 ++ .../testplan/api_events_service/README.md | 517 +++++++++++++++++- 2 files changed, 556 insertions(+), 3 deletions(-) diff --git a/doc/releasenotes.md b/doc/releasenotes.md index 7ea641d..87b6740 100644 --- a/doc/releasenotes.md +++ b/doc/releasenotes.md @@ -1,3 +1,45 @@ +## **Release 2.0.0** + +### **New Features** + +#### 3GPP CAPIF release 18 + +- Added new endpoints included in new release 18. + - New logic for PATCH endpoints. +- New logic to support Vendor Extensibility + - 9 new tests to check this logic. +- New logic to support API Status feature +- Supported Features now are mandatory for all POST Requests as is described on TS 29.222. + - Possible Breaking change, all POST request now must include supported features attribute, default can me set to "0" to keep all features inactive. + - Possible Breaking change on Events API, if you need eventDetails information on notification you must activate Enhanced Event Report on supported features. +- New 8 tests on Events API to check supported features support. + + +### **Technical Debt Solved** + +#### **Issues** + +- REDIS scheduled on start to allow receive notification since service is deployed. +- Problem removing service APIs published is provider register more than one APF. +- Superadmin problem deleting service API published through helper service if provider is not present. + +#### Scripts upgraded + +- New local scripts +- New remote scripts + +### **Documentation** + +#### New test included on documentation + +- New 9 test on Vendor Extensibility test plan. +- New 8 tests on Events API test plan. +- Test plan updated with default supported features for all request set to "0" (all inactive by default). + + + +--->>>> must be included - New tests to check PATCH request + ## **Release 1.0.0** ### **New Features** diff --git a/doc/testing/testplan/api_events_service/README.md b/doc/testing/testplan/api_events_service/README.md index 17ce0b3..bad8fba 100644 --- a/doc/testing/testplan/api_events_service/README.md +++ b/doc/testing/testplan/api_events_service/README.md @@ -264,7 +264,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE, receive the notification when AEF Send **TO** logging service result of invocations to their APIs. - If customer want to receive log information then Enhanced Event Report feature must be active. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -338,7 +338,8 @@ At this documentation you will have all information and related files and exampl **Description**: - This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -413,6 +414,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to SERVICE_API_UPDATE, receive the notification when AEF Update some information on API Published. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -483,6 +485,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Provider subscribed to API Invoker events (API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED), receive the notifications when Invoker is onboarded, updated and removed respectively. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -548,6 +551,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE receive a notification when ACL Changes. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -619,6 +623,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to ACCESS_CONTROL_POLICY_UNAVAILABLE will receive the notification when AEF remove Security Context created previously. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -694,6 +699,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to API_INVOKER_AUTHORIZATION_REVOKED and ACCESS_CONTROL_POLICY_UNAVAILABLE receive both notification when AEF revoke invoker's authorization. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -708,7 +714,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider at CCF. 2. Publish a provider API with name **service_1**. 3. Register Invoker and Onboard Invoker at CCF. - 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** events. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** events. Enhanced_event_report active at supported features. 5. Discover APIs filtered by **aef_id** 6. Create Security Context for Invoker. 7. Revoke Authorization by Provider. @@ -723,6 +729,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE','API_INVOKER_AUTHORIZATION_REVOKED']** 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 5. Discover published APIs 6. Create Security Context for Invoker @@ -800,6 +807,510 @@ At this documentation you will have all information and related files and exampl --- +## Test Case 14: Invoker receives Service API Invocation events without Enhanced Event Report + +**Test ID**: ***capif_api_events-14***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE, receive the notification when AEF Send **TO** logging service result of invocations to their APIs. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * API Provider had a Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header + 6. Emulate Success and Failure on API invocation of provider by Invoker, using Invocation Logs API. + +**Information of Test**: + + 1. Perform [provider registration] + 2. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Store **serviceApiId** + * Use **APF Certificate** + + 3. Perform [invoker onboarding] + 4. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 5. Event Subscription to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_INVOCATION_SUCCESS','SERVICE_API_INVOCATION_FAILURE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 6. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs** + 2. body [log entry request body] with: + 1. aefId from provider published. + 2. apiInvokerId from invoker onboarded. + 3. apiId of published API + 4. apiName of published API + 5. 200 and 400 results in two logs. + 3. Use **AEF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to creation of log entry on CCF must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/api-invocation-logs/{apiVersion}/{aefId}/subscriptions/{logId}** + 3. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_INVOCATION_SUCCESS** related with **200** result at Log. + 2. The other one must be **SERVICE_API_INVOCATION_FAILURE** related with **400** result at Log. + +--- +## Test Case 15: Invoker subscribe to Service API Available and Unavailable events without Enhanced Event Report + +**Test ID**: ***capif_api_events-15***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header + 6. Provider publish new API. + 7. Provider remove published API. + +**Information of Test**: + + 1. Perform [provider registration] + 2. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Store **serviceApiId** + * Use **APF Certificate** + + 3. Perform [invoker onboarding] + 4. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 5. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 6. Publish new Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_2** + * Store **serviceApiId** + * Use **APF Certificate** + + 7. Remove published Service API at CCF: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + + 2. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of **service_2** published API. + 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of **service_1** published API. + +--- +## Test Case 16: Invoker subscribe to Service API Update without Enhanced Event Report + +**Test ID**: ***capif_api_events-16***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_UPDATE, receive the notification when AEF Update some information on API Published. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * API Provider had a Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header at event subscription + 6. Provider update information of Service API Published. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Use ***APF Certificate*** + * Store **serviceApiId** + + 4. Perform [invoker onboarding] + 5. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 6. Event Subscription to SERVICE_API_UPDATE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_UPDATE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 7. Update published API at CCF: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}** + * body [service api description] with overrided **apiName** to **service_1**_modified** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to Update Published Service API: + 1. **200 OK** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiName **service_1**_modified** + 3. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received events follow **EventNotification** data structure, with **serviceAPIDescriptions** in **eventDetail** parameter. + 1. Event should be **SERVICE_API_UPDATE** with **eventDetail** with modified **apiName**. + +--- +## Test Case 17: Provider subscribe to API Invoker events without Enhanced Event Report + +**Test ID**: ***capif_api_events-17***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Provider subscribed to API Invoker events (API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED), receive the notifications when Invoker is onboarded, updated and removed respectively. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF + 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. Enhanced_event_report inactive at supported features. + 3. Register Invoker and Onboard Invoker at CCF + 4. Update Onboarding Information at CCF with a minor change on "notificationDestination" + 5. Offboard Invoker + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Event Subscription to API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED events: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['API_INVOKER_ONBOARDED', 'API_INVOKER_UPDATED', 'API_INVOKER_OFFBOARDED']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Provider AMF Certificate** + 4. Perform [invoker onboarding] + 5. Update information of previously onboarded Invoker: + * Send **PUT** to **https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}** + * Reference Request Body is: [put invoker onboarding body] + * "notificationDestination": "**http://host.docker.internal:8086/netapp_new_callback**", + 6. Offboard: + * Send **DELETE** to **https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 3. Response to Update Request (PUT) with minor change must contain: + 1. **200 OK** response. + 2. notificationDestination on response must contain the new value + 4. Response to Offboard Request (DELETE) must contain: + 1. **204 No Content** + 5. Mock Server received messages must accomplish: + 1. **Three Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **API_INVOKER_ONBOARDED** + 2. One Event should be **API_INVOKER_UPDATED** + 3. One Event should be **API_INVOKER_OFFBOARDED** +--- +## Test Case 18: Provider subscribed to ACL update event without Enhanced Event Report + +**Test ID**: ***capif_api_events-18***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE receive a notification when ACL Changes. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * API Invoker had a Security Context for the Service API published by provider. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. Enhanced_event_report inactive at supported features. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Provider Retrieve ACL + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UPDATE** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UPDATE']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Provider AMF Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Provider Retrieve ACL + * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** + * Use **serviceApiId** and **aefId** + * Use AEF Provider Certificate + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 3. ACL Response: + 1. **200 OK** Response. + 2. body returned must accomplish **AccessControlPolicyList** data structure. + 3. apiInvokerPolicies must: + 1. contain only one object. + 2. apiInvokerId must match apiInvokerId registered previously. + 4. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UPDATE**. + +--- +## Test Case 19: Provider receives an ACL unavailable event when invoker remove Security Context without Enhanced Event Report + +**Test ID**: ***capif_api_events-19***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to ACCESS_CONTROL_POLICY_UNAVAILABLE will receive the notification when AEF remove Security Context created previously. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. Enhanced_event_report inactive at supported features. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Provider Retrieve ACL. + 8. Remove Security Context for Invoker. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Provider Retrieve ACL + * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** + * Use **serviceApiId** and **aefId** + * Use **AEF Provider Certificate** + 8. Delete Security Context of Invoker by Provider: + * Send **DELETE** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * Use **AEF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 3. ACL Response: + 1. **200 OK** Response. + 2. body returned must accomplish **AccessControlPolicyList** data structure. + 3. apiInvokerPolicies must: + 1. contain only one object. + 2. apiInvokerId must match apiInvokerId registered previously. + 4. Delete security context: + 1. **204 No Content** response. + 5. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UNAVAILABLE** without **eventDetail**. +--- +## Test Case 20: Invoker receives an Invoker Authorization Revoked and ACL unavailable event when Provider revoke Invoker Authorization without Enhanced Event Report + +**Test ID**: ***capif_api_events-20***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to API_INVOKER_AUTHORIZATION_REVOKED and ACCESS_CONTROL_POLICY_UNAVAILABLE receive both notification when AEF revoke invoker's authorization. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** events. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Revoke Authorization by Provider. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE','API_INVOKER_AUTHORIZATION_REVOKED']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. Use **Invoker Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Revoke Authorization by Provider: + * Send **POST** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/delete** + * body [security notification body] + * Using **AEF Certificate**. + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 4. Revoke Authorization: + 1. **204 No Content** response. + 5. Mock Server received messages must accomplish: + 1. **Two Events has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UNAVAILABLE** without **eventDetail**. + 2. One Event should be **API_INVOKER_AUTHORIZATION_REVOKED** without **eventDetail**. + +--- + + [invoker onboard request body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" [event subscription request body]: ./event_subscription.json "Event Subscription Request" [invoker onboarding]: ../common_operations/README.md#onboard-an-invoker "Invoker Onboarding" -- GitLab From 715f0adad365907eaf5b603499352fe619fa92b8 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 11 Dec 2024 17:00:23 +0100 Subject: [PATCH 04/12] Adding new apiStatus feature test suite --- doc/testing/testplan/README.md | 1 + doc/testing/testplan/api_status/README.md | 97 +++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 doc/testing/testplan/api_status/README.md diff --git a/doc/testing/testplan/README.md b/doc/testing/testplan/README.md index 33301ea..11b19c8 100644 --- a/doc/testing/testplan/README.md +++ b/doc/testing/testplan/README.md @@ -14,3 +14,4 @@ List of Common API Services implemented: ## Features * [Vendor Extensibility](./vendor_extensibility/README.md) +* [Api Status](./api_status/README.md) diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md new file mode 100644 index 0000000..d096a9f --- /dev/null +++ b/doc/testing/testplan/api_status/README.md @@ -0,0 +1,97 @@ +# Test Plan for API Status Feature +At this documentation you will have all information and related files and examples of test plan for this feature. + +## Test Case 1: Publish without apiStatus feature receive eventDetails with serviceAPIDescription + +**Test ID**: ***api_status-1*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds and serviceAPIDescription at eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 3. Register Provider at CCF with 2 aefs. + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 3. Perform [Provider Registration] with 2 aefs + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * apiName service_1 and aefId1 + * apiName service_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** containing **apiIds** and **serviceAPIDescription** parameters. + 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** containing **apiIds** and **serviceAPIDescription** parameters. + + + [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API **Description** Request" + [publisher register body]: ../api_publish_service/publisher_register_body.json "Publish register Body" + [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" + [provider request body]: ../api_provider_management/provider_details_post_example.json "API Provider Enrolment Request" + [provider request patch body]: ../api_provider_management/provider_details_enrolment_details_patch_example.json "API Provider Enrolment Patch Request" + + [invoker onboarding]: ../common_operations/README.md#onboard-an-invoker "Invoker Onboarding" + [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" + [event subscription request body]: ../api_events_service/event_subscription.json "Event Subscription Request" -- GitLab From 591a35e7ffca8570d8b4cc60a4835cb2a4f44a10 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 16 Dec 2024 10:53:54 +0100 Subject: [PATCH 05/12] Adding api-status 2 and 3 at apiStatus test suite --- doc/testing/testplan/api_status/README.md | 181 +++++++++++++++++++++- 1 file changed, 175 insertions(+), 6 deletions(-) diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index d096a9f..5ea2cd8 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -18,8 +18,8 @@ At this documentation you will have all information and related files and exampl **Execution Steps**: 1. Register Invoker and Onboard Invoker at CCF. - 2. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) - 3. Register Provider at CCF with 2 aefs. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) 4. Publish Service API at CCF: 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) 2. This API not includes "API Status" information at **service API Description**. @@ -30,13 +30,13 @@ At this documentation you will have all information and related files and exampl **Information of Test**: 1. Perform [Invoker Onboarding] - 2. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** - 3. Perform [Provider Registration] with 2 aefs 4. Publish Service API at CCF: * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. @@ -68,8 +68,8 @@ At this documentation you will have all information and related files and exampl 2. Response Body must follow **ServiceAPIDescription** data structure with: * apiId * 2 profiles with: - * apiName service_1 and aefId1 - * apiName service_2 and aefId2 + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: @@ -86,6 +86,175 @@ At this documentation you will have all information and related files and exampl 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** containing **apiIds** and **serviceAPIDescription** parameters. + +## Test Case 2: Publish without apiStatus feature receive eventDetails without serviceAPIDescription + +**Test ID**: ***api_status-2*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds at eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** at supported features (binary 0100-> string **4**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** containing **apiIds** parameter. + 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** containing **apiIds** parameter. + +## Test Case 3: Publish without apiStatus feature receive eventDetails without eventDetails (apiMonitoringStatus active) + +**Test ID**: ***api_status-3*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***apiStatusMonitoring*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1000 -> string **8** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API without **eventDetails**. + 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API without **eventDetails**. + [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API **Description** Request" [publisher register body]: ../api_publish_service/publisher_register_body.json "Publish register Body" [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" -- GitLab From f871977cc9507eb28ac3a48d91baaec615257b68 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 18 Dec 2024 15:20:10 +0100 Subject: [PATCH 06/12] New test at apiStatus features --- ...service_api_description_patch_example.json | 336 ++++++++++++++++++ doc/testing/testplan/api_status/README.md | 285 ++++++++++++++- 2 files changed, 620 insertions(+), 1 deletion(-) create mode 100644 doc/testing/testplan/api_publish_service/service_api_description_patch_example.json diff --git a/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json b/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json new file mode 100644 index 0000000..482d064 --- /dev/null +++ b/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json @@ -0,0 +1,336 @@ +{ + "apiStatus": { + "aefIds": [ + "string" + ] + }, + "aefProfiles": [ + { + "aefId": "string", + "versions": [ + { + "apiVersion": "string", + "expiry": "2024-12-18T13:36:19.754Z", + "resources": [ + { + "resourceName": "string", + "commType": "REQUEST_RESPONSE", + "uri": "string", + "custOpName": "string", + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "PSK", + "string" + ], + "domainName": "string", + "interfaceDescriptions": [ + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + } + ], + "aefLocation": { + "civicAddr": { + "country": "string", + "A1": "string", + "A2": "string", + "A3": "string", + "A4": "string", + "A5": "string", + "A6": "string", + "PRD": "string", + "POD": "string", + "STS": "string", + "HNO": "string", + "HNS": "string", + "LMK": "string", + "LOC": "string", + "NAM": "string", + "PC": "string", + "BLD": "string", + "UNIT": "string", + "FLR": "string", + "ROOM": "string", + "PLC": "string", + "PCN": "string", + "POBOX": "string", + "ADDCODE": "string", + "SEAT": "string", + "RD": "string", + "RDSEC": "string", + "RDBR": "string", + "RDSUBBR": "string", + "PRM": "string", + "POM": "string", + "usageRules": "string", + "method": "string", + "providedBy": "string" + }, + "geoArea": { + "shape": "POINT", + "point": { + "lon": 180, + "lat": 90 + } + }, + "dcId": "string" + }, + "serviceKpis": { + "maxReqRate": 0, + "maxRestime": 0, + "availability": 0, + "avalComp": "string", + "avalGraComp": "string", + "avalMem": "string", + "avalStor": "string", + "conBand": 0 + }, + "ueIpRange": { + "ueIpv4AddrRanges": [ + { + "start": "198.51.100.1", + "end": "198.51.100.1" + } + ], + "ueIpv6AddrRanges": [ + { + "start": "2001:db8:85a3::8a2e:370:7334", + "end": "2001:db8:85a3::8a2e:370:7334" + } + ] + } + }, + { + "aefId": "string", + "versions": [ + { + "apiVersion": "string", + "expiry": "2024-12-18T13:36:19.754Z", + "resources": [ + { + "resourceName": "string", + "commType": "REQUEST_RESPONSE", + "uri": "string", + "custOpName": "string", + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "PSK", + "string" + ], + "domainName": "string", + "interfaceDescriptions": [ + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + } + ], + "aefLocation": { + "civicAddr": { + "country": "string", + "A1": "string", + "A2": "string", + "A3": "string", + "A4": "string", + "A5": "string", + "A6": "string", + "PRD": "string", + "POD": "string", + "STS": "string", + "HNO": "string", + "HNS": "string", + "LMK": "string", + "LOC": "string", + "NAM": "string", + "PC": "string", + "BLD": "string", + "UNIT": "string", + "FLR": "string", + "ROOM": "string", + "PLC": "string", + "PCN": "string", + "POBOX": "string", + "ADDCODE": "string", + "SEAT": "string", + "RD": "string", + "RDSEC": "string", + "RDBR": "string", + "RDSUBBR": "string", + "PRM": "string", + "POM": "string", + "usageRules": "string", + "method": "string", + "providedBy": "string" + }, + "geoArea": { + "shape": "POINT", + "point": { + "lon": 180, + "lat": 90 + } + }, + "dcId": "string" + }, + "serviceKpis": { + "maxReqRate": 0, + "maxRestime": 0, + "availability": 0, + "avalComp": "string", + "avalGraComp": "string", + "avalMem": "string", + "avalStor": "string", + "conBand": 0 + }, + "ueIpRange": { + "ueIpv4AddrRanges": [ + { + "start": "198.51.100.1", + "end": "198.51.100.1" + } + ], + "ueIpv6AddrRanges": [ + { + "start": "2001:db8:85a3::8a2e:370:7334", + "end": "2001:db8:85a3::8a2e:370:7334" + } + ] + } + } + ], + "description": "string", + "shareableInfo": { + "isShareable": true, + "capifProvDoms": [ + "string" + ] + }, + "serviceAPICategory": "string", + "apiSuppFeats": "string", + "pubApiPath": { + "ccfIds": [ + "string" + ] + }, + "ccfId": "string" +} \ No newline at end of file diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index 5ea2cd8..42fe326 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -255,7 +255,290 @@ At this documentation you will have all information and related files and exampl 1. One should be **SERVICE_API_AVAILABLE** apiId of published API without **eventDetails**. 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API without **eventDetails**. - [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API **Description** Request" + +## ------------------------------------- + + +## Test Case 12: Update published API without apiStatus and apiStatusMonitoring inactive + +**Test ID**: ***api_status-12*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to not present. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus Not present + 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus not present. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription updated. + +## Test Case 13: Update published API with apiStatus empty and apiStatusMonitoring inactive + +**Test ID**: ***api_status-13*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array qith **ApiStatusMonitoring inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with empty aefIds array. + 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus not present. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription updated. + + +## -------------------- + +## Test Case 17: Patch published (apiStatusMonitoring active) API with apiStatus only aefId2 + +**Test ID**: ***api_status-17*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring active), containing eventDetails, and SERVICE_API_UPDATE after patch with apfId2 in apiStatus array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + + + + [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API Description Request" + [service api description patch]: ../api_publish_service/service_api_description_patch_example.json "Service API Description Patch Request" [publisher register body]: ../api_publish_service/publisher_register_body.json "Publish register Body" [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" [provider request body]: ../api_provider_management/provider_details_post_example.json "API Provider Enrolment Request" -- GitLab From 19e918b8d466151a3d512211c379364715f02a99 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 18 Dec 2024 17:50:11 +0100 Subject: [PATCH 07/12] New apiStatus tests --- doc/testing/testplan/api_status/README.md | 275 +++++++++++++++++++++- 1 file changed, 272 insertions(+), 3 deletions(-) diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index 42fe326..1b19117 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -294,7 +294,7 @@ At this documentation you will have all information and related files and exampl 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: - 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** 4. Publish Service API at CCF: @@ -386,7 +386,7 @@ At this documentation you will have all information and related files and exampl 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: - 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** 4. Publish Service API at CCF: @@ -480,7 +480,7 @@ At this documentation you will have all information and related files and exampl 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: - 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** 4. Publish Service API at CCF: @@ -535,6 +535,275 @@ At this documentation you will have all information and related files and exampl 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. +## Test Case 18: Patch published (apiStatusMonitoring active) API with apiStatus aef1 and aef2 + +**Test ID**: ***api_status-18*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring active), containing eventDetails, and SERVICE_API_UPDATE after patch with apfId1 and apfId2 in apiStatus array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId1 and aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + +## Test Case 19: Patch published (apiStatusMonitoring inactive) API with apiStatus aefId1 and aefId2 + +**Test ID**: ***api_status-19*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring inactive), containing eventDetails, and **NO SERVICE_API_UPDATE** after patch with apfId1 and apfId2 in apiStatus array, because **apiStatusMonitoring** in publish is inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0000 0000 -> string **000**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId1 and aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + +## Test Case 20: Patch published without aefs available API with apiStatus only aef2 + +**Test ID**: ***api_status-20*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_UNAVAILABLE in mockserver when api is published by a provider (with **apiStatusMonitoring** active), containing eventDetails, and SERVICE_API_UPDATE and SERVICE_API_AVAILABLE after patch with apfId1 and apfId2 in apiStatus array, becasue change from unavailable to available and also serviceAPIDescription is updated. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus empty array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId1 and aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response without **"apiStatus"** parameter. + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + 3. Last one should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + + [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API Description Request" -- GitLab From 9e450b587b2eb8d8fbb74d3bb091fbc4f4ba0d03 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Sat, 21 Dec 2024 08:53:00 +0100 Subject: [PATCH 08/12] minor fix on api status test case --- doc/testing/testplan/api_status/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index 1b19117..5397455 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -711,7 +711,6 @@ At this documentation you will have all information and related files and exampl 1. **Two Events have been received**. 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. - 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. ## Test Case 20: Patch published without aefs available API with apiStatus only aef2 -- GitLab From 8841e3d3c44ab41ef26eacafdded6b28085cc1af Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 10 Jan 2025 15:29:21 +0100 Subject: [PATCH 09/12] api status test plan fix --- doc/testing/testplan/api_status/README.md | 64 ++++++++++++----------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index 5397455..2f6b294 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -357,7 +357,7 @@ At this documentation you will have all information and related files and exampl **Description**: - This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array qith **ApiStatusMonitoring inactive. + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array qith **ApiStatusMonitoring** inactive. **Pre-Conditions**: @@ -377,7 +377,7 @@ At this documentation you will have all information and related files and exampl 1. includes filter by query parameter **aef-id** 6. Update Published API: 1. apiStatus present with empty aefIds array. - 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + 2. apiStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) **Information of Test**: @@ -406,7 +406,7 @@ At this documentation you will have all information and related files and exampl * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. * supportedFeatures **0** * 2 profiles, one with each aef. - * apiStatus not present. + * apiStatus present with empty aefIds array. **Expected Result**: @@ -434,14 +434,21 @@ At this documentation you will have all information and related files and exampl 2. Response body must follow **DiscoveredAPIs** data structure: * Check if DiscoveredAPIs contains the API Published previously * Check if contains the **apiStatus** with aefId1 - 5. Response to Update published Service API at CCF: + + 5. Response to Publish request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + 6. Mock Server received messages must accomplish: - 1. **Two Events have been received**. + 1. **Three Events have been received**. 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. - 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription updated. ## -------------------- @@ -668,15 +675,15 @@ At this documentation you will have all information and related files and exampl * 2 profiles, one with each aef. * apiStatus with aefId1 inside array * Use **APF Certificate** - 5. Request Discover Published APIs: + + **Expected Result**: @@ -690,27 +697,24 @@ At this documentation you will have all information and related files and exampl 1. **201 Created** 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: - 1. **201 Created** - 2. Response Body must follow **ServiceAPIDescription** data structure with: - * apiId - * 2 profiles with: - * resourceName resource_1 and aefId1 - * resourceName resource_2 and aefId2 - 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + 4. Response to Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains the API Published previously - * Check if contains the **apiStatus** with aefId1 - 5. Response to Patch published Service API at CCF: - 1. **200 OK** - 2. Store response with updated serviceAPIDescription. - 6. Mock Server received messages must accomplish: - 1. **Two Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 1. **404 Not Found** response. + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 404 + * title with message "Not Found" + * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". + * cause with message "No API Published accomplish filter conditions". + 5. Mock Server received messages must accomplish: + 1. **No Events have been received**. ## Test Case 20: Patch published without aefs available API with apiStatus only aef2 -- GitLab From d03030e877dbd6e849418b372655bd5b04ebf3dc Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Mon, 13 Jan 2025 17:55:01 +0100 Subject: [PATCH 10/12] New api status tests --- doc/releasenotes.md | 4 +- .../testplan/api_events_service/README.md | 2 +- doc/testing/testplan/api_status/README.md | 1150 +++++++++++++++-- .../testplan/vendor_extensibility/README.md | 11 +- 4 files changed, 1067 insertions(+), 100 deletions(-) diff --git a/doc/releasenotes.md b/doc/releasenotes.md index 87b6740..d45151e 100644 --- a/doc/releasenotes.md +++ b/doc/releasenotes.md @@ -221,5 +221,5 @@ This Release also includes a Robot Test Suite for all those services and a Postm [OCF Event test plan documentation]: https://ocf.etsi.org/documentation/latest/testing/testplan/api_events_service/ "OCF Event test plan documentation" [OCF Registration Flow]: https://ocf.etsi.org/documentation/latest/testing/testplan/common_operations/ "OCF Registration Flow" [New Registration Demo]: https://www.youtube.com/watch?v=sn-tN6eRvv8 "New Registration Demo" -[CICD Wiki]: [https://](https://labs.etsi.org/rep/ocf/community/-/wikis/OCF-CICD) "CI/CD Wiki" -[Upgrade Release 17 to 18 Wiki]: [https://](https://labs.etsi.org/rep/ocf/community/-/wikis/?¿?¿?¿?¿?) "Upgrade Release 17 to 18 Wiki" +[CICD Wiki]: https://labs.etsi.org/rep/ocf/community/-/wikis/OCF-CICD "CI/CD Wiki" +[Upgrade Release 17 to 18 Wiki]: https://labs.etsi.org/rep/ocf/community/-/wikis/?¿?¿?¿?¿? "Upgrade Release 17 to 18 Wiki" diff --git a/doc/testing/testplan/api_events_service/README.md b/doc/testing/testplan/api_events_service/README.md index bad8fba..6ecb183 100644 --- a/doc/testing/testplan/api_events_service/README.md +++ b/doc/testing/testplan/api_events_service/README.md @@ -1318,6 +1318,6 @@ At this documentation you will have all information and related files and exampl [log entry request body]: ../api_logging_service/invocation_log.json "Log Request Body" [put register body]: ./invoker_details_put_example.json "API Invoker Update Request" [service security body]: ../api_security_service/service_security.json "Service Security Request" -[security notification body]: ./security_notification.json "Security Notification Request" +[security notification body]: ../api_security_service/security_notification.json "Security Notification Request" [Return To All Test Plans]: ../README.md diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md index 2f6b294..4938884 100644 --- a/doc/testing/testplan/api_status/README.md +++ b/doc/testing/testplan/api_status/README.md @@ -1,6 +1,7 @@ # Test Plan for API Status Feature At this documentation you will have all information and related files and examples of test plan for this feature. +--- ## Test Case 1: Publish without apiStatus feature receive eventDetails with serviceAPIDescription **Test ID**: ***api_status-1*** @@ -17,11 +18,860 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 2: Publish without apiStatus feature receive eventDetails without serviceAPIDescription + +**Test ID**: ***api_status-2*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds at eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** at supported features (binary 0100-> string **4**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 3: Publish without apiStatus feature receive eventDetails without eventDetails (apiMonitoringStatus active) + +**Test ID**: ***api_status-3*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***apiStatusMonitoring*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1000 -> string **8** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 4: Publish without apiStatus feature receive eventDetails without eventDetails + +**Test ID**: ***api_status-4*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** not active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 0000-> string **0**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 5: Publish with apiStatus present but apiStatusMonitoring inactive receive bad Request + +**Test ID**: ***api_status-5*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** not active, receive Bad Request when api is published by a provider. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** and ***Enhanced_event_report*** **inactive** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + 4. Response to Discover Request By Invoker: + 1. **404 Not Found** response. + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 404 + * title with message "Not Found" + * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". + * cause with message "No API Published accomplish filter conditions". + 5. Mock Server received messages must accomplish: + 1. **No Events have been received**. + +--- +## Test Case 6: Publish with apiStatus feature active receive eventDetails with serviceAPIDescription + +**Test ID**: ***api_status-6*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification including apiIds and serviceAPIDescriptions. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 7: Publish with apiStatus active feature receive eventDetails without serviceAPIDescription + +**Test ID**: ***api_status-7*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** inactive and ***Enhanced_event_report*** active, receive event notification including only apiIds. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** and ***apiStatusMonitoring*** **inactive** at supported features (binary 0100-> string **4**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with only **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 8: Publish with apiStatus active feature receive eventDetails without eventDetails with apiStatus (apiMonitoringStatus active) + +**Test ID**: ***api_status-8*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** active and ***Enhanced_event_report*** inactive, receive event notification without eventDetails. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **inactive** and ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1000 -> string **8** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 9: Publish with apiStatus active feature receive eventDetails without eventDetails + +**Test ID**: ***api_status-9*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** inactive, receive event notification without eventDetails. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **inactive** at supported features (binary 0000-> string **0**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 10: Publish with apiStatus feature active no aefId active receive eventDetails with serviceAPIDescription with apiStatus empty array + +**Test ID**: ***api_status-10*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification **SERVICE_API_UNAVAILABLE** including apiIds and serviceAPIDescriptions when API is published containing ***apiStatus*** with empty array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty aefIds array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with empty aefIds array. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. Only one **SERVICE_API_UNAVAILABLE** event. + +--- +## Test Case 11: Publish with apiStatus not present but apiStatusMonitoring feature active receive eventDetails with serviceAPIDescription without apiStatus + +**Test ID**: ***api_status-11*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** including apiIds and serviceAPIDescriptions when API is published wihtout ***apiStatus***. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. - 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) 4. Publish Service API at CCF: - 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) 2. This API not includes "API Status" information at **service API Description**. 5. Discover Service APIs by Invoker 1. includes filter by query parameter **aef-id** @@ -40,8 +890,9 @@ At this documentation you will have all information and related files and exampl 4. Publish Service API at CCF: * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. - * supportedFeatures **000** + * supportedFeatures **020** * 2 profiles, one with each aef. + * apiStatus not present. * Use **APF Certificate** 5. Request Discover Published APIs: * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** @@ -71,29 +922,27 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: * Check if DiscoveredAPIs contains the API Published previously - * Check if **NOT** contains the **apiStatus** keys + * Check if contains the **apiStatus** key. 5. Response to Remove published Service API at CCF: 1. **204 No Content** 6. Mock Server received messages must accomplish: 1. **Two Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** containing **apiIds** and **serviceAPIDescription** parameters. - 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** containing **apiIds** and **serviceAPIDescription** parameters. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. First **SERVICE_API_AVAILABLE** event. + 2. Other with **SERVICE_API_UNAVAILABLE** event. +--- +## Test Case 12: Update published API without apiStatus and apiStatusMonitoring inactive - -## Test Case 2: Publish without apiStatus feature receive eventDetails without serviceAPIDescription - -**Test ID**: ***api_status-2*** +**Test ID**: ***api_status-12*** **Description**: - This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds at eventDetails, and the same when api is unpublished. + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to not present. **Pre-Conditions**: @@ -103,15 +952,18 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. - 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** at supported features (binary 0100-> string **4**) + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) 4. Publish Service API at CCF: - 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) - 2. This API not includes "API Status" information at **service API Description**. + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. 5. Discover Service APIs by Invoker 1. includes filter by query parameter **aef-id** - 6. Provider remove published API. + 6. Update Published API: + 1. apiStatus Not present + 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) **Information of Test**: @@ -120,22 +972,27 @@ At this documentation you will have all information and related files and exampl 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: - 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** - 2. supportedFeatures: binary 0100 -> string **4** + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** 4. Publish Service API at CCF: * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. - * supportedFeatures **000** + * supportedFeatures **020** * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array * Use **APF Certificate** 5. Request Discover Published APIs: * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** * Param api-invoker-id is mandatory * Use **Invoker Certificate** - 6. Remove published Service API: - * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus not present. **Expected Result**: @@ -157,27 +1014,28 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: * Check if DiscoveredAPIs contains the API Published previously - * Check if **NOT** contains the **apiStatus** keys - 5. Response to Remove published Service API at CCF: - 1. **204 No Content** + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. 6. Mock Server received messages must accomplish: 1. **Two Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** containing **apiIds** parameter. - 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** containing **apiIds** parameter. + 2. Validate received events follow **EventNotification** data structure, with **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetail** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetail** containing serviceAPIDescription updated. -## Test Case 3: Publish without apiStatus feature receive eventDetails without eventDetails (apiMonitoringStatus active) +--- +## Test Case 13: Update published API with apiStatus empty and apiStatusMonitoring inactive -**Test ID**: ***api_status-3*** +**Test ID**: ***api_status-13*** **Description**: - This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***apiStatusMonitoring*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array with **ApiStatusMonitoring** inactive. **Pre-Conditions**: @@ -187,15 +1045,18 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. - 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) 4. Publish Service API at CCF: - 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) - 2. This API not includes "API Status" information at **service API Description**. + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. 5. Discover Service APIs by Invoker 1. includes filter by query parameter **aef-id** - 6. Provider remove published API. + 6. Update Published API: + 1. apiStatus present with empty aefIds array. + 2. apiStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) **Information of Test**: @@ -204,22 +1065,27 @@ At this documentation you will have all information and related files and exampl 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: - 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** - 2. supportedFeatures: binary 1000 -> string **8** + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** 3. Use **Invoker Certificate** 4. Publish Service API at CCF: * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. - * supportedFeatures **000** + * supportedFeatures **020** * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array * Use **APF Certificate** 5. Request Discover Published APIs: * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** * Param api-invoker-id is mandatory * Use **Invoker Certificate** - 6. Remove published Service API: - * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus present with empty aefIds array. **Expected Result**: @@ -241,31 +1107,33 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: * Check if DiscoveredAPIs contains the API Published previously - * Check if **NOT** contains the **apiStatus** keys - 5. Response to Remove published Service API at CCF: - 1. **204 No Content** - 6. Mock Server received messages must accomplish: - 1. **Two Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API without **eventDetails**. - 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of published API without **eventDetails**. - + * Check if contains the **apiStatus** with aefId1 -## ------------------------------------- + 5. Response to Update request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + 6. Mock Server received messages must accomplish: + 1. **One Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. -## Test Case 12: Update published API without apiStatus and apiStatusMonitoring inactive +--- +## Test Case 14: Update published API with apiStatus empty and apiStatusMonitoring active -**Test ID**: ***api_status-12*** +**Test ID**: ***api_status-14*** **Description**: - This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to not present. + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, SERVICE_API_UPDATE and SERVICE_API_UNAVAILABLE after update apiStatus to empty aefIds array with **ApiStatusMonitoring** active. **Pre-Conditions**: @@ -275,6 +1143,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -284,8 +1153,8 @@ At this documentation you will have all information and related files and exampl 5. Discover Service APIs by Invoker 1. includes filter by query parameter **aef-id** 6. Update Published API: - 1. apiStatus Not present - 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + 1. apiStatus present with empty aefIds array. + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) **Information of Test**: @@ -312,9 +1181,9 @@ At this documentation you will have all information and related files and exampl * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** * Use **APF Certificate** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. - * supportedFeatures **0** + * supportedFeatures **20** * 2 profiles, one with each aef. - * apiStatus not present. + * apiStatus present with empty aefIds array. **Expected Result**: @@ -336,7 +1205,6 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: @@ -346,18 +1214,20 @@ At this documentation you will have all information and related files and exampl 1. **200 OK** 2. Store response with updated serviceAPIDescription. 6. Mock Server received messages must accomplish: - 1. **Two Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. - 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription updated. + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. One should be **SERVICE_API_UPDATE**. + 3. One should be **SERVICE_API_UNAVAILABLE**. -## Test Case 13: Update published API with apiStatus empty and apiStatusMonitoring inactive +--- +## Test Case 15: Update published API with apiStatus only aef2 and apiStatusMonitoring active -**Test ID**: ***api_status-13*** +**Test ID**: ***api_status-15*** **Description**: - This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array qith **ApiStatusMonitoring** inactive. + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails and SERVICE_API_UPDATE after update apiStatus to aefId2 array with **ApiStatusMonitoring** active. **Pre-Conditions**: @@ -367,6 +1237,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -377,7 +1248,7 @@ At this documentation you will have all information and related files and exampl 1. includes filter by query parameter **aef-id** 6. Update Published API: 1. apiStatus present with empty aefIds array. - 2. apiStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) **Information of Test**: @@ -404,9 +1275,9 @@ At this documentation you will have all information and related files and exampl * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** * Use **APF Certificate** * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. - * supportedFeatures **0** + * supportedFeatures **20** * 2 profiles, one with each aef. - * apiStatus present with empty aefIds array. + * apiStatus present with aefId2 in aefIds array. **Expected Result**: @@ -428,31 +1299,120 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: * Check if DiscoveredAPIs contains the API Published previously * Check if contains the **apiStatus** with aefId1 - - 5. Response to Publish request must accomplish: - 1. **400 Bad Request** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 400 - * title with message "Bad Request" - * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". - * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". - + 2. Store response with updated serviceAPIDescription. 6. Mock Server received messages must accomplish: - 1. **Three Events have been received**. - 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. - 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. One should be **SERVICE_API_UPDATE**. + +--- +## Test Case 16: Published API without aefs available updated to one aef available + +**Test ID**: ***api_status-16*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_UNAVAILABLE in mockserver when api is published with apiStatus empty by a provider containing eventDetails, SERVICE_API_UPDATE and SERVICE_API_AVAILABLE after update apiStatus to aefId2 array with **ApiStatusMonitoring** active, and SERVICE_API_UNAVAILABLE when API is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty aefIds array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with aefId2 in aefIds array. + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) + 7. Provider remove published API. + +**Information of Test**: + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with empty aefIds array. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **20** + * 2 profiles, one with each aef. + * apiStatus present with aefId2 in aefIds array. + 7. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** -## -------------------- +**Expected Result**: + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_UNAVAILABLE** aefIds array inside apiStatus empty. + 2. One should be **SERVICE_API_UPDATE** aefIds array inside apiStatus contains apfId2. + 3. One should be **SERVICE_API_AVAILABLE** aefIds array inside apiStatus contains apfId2. + 4. One should be **SERVICE_API_UNAVAILABLE** aefIds array inside apiStatus contains apfId2. + +--- ## Test Case 17: Patch published (apiStatusMonitoring active) API with apiStatus only aefId2 **Test ID**: ***api_status-17*** @@ -469,6 +1429,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -527,7 +1488,6 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: @@ -542,6 +1502,7 @@ At this documentation you will have all information and related files and exampl 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. +--- ## Test Case 18: Patch published (apiStatusMonitoring active) API with apiStatus aef1 and aef2 **Test ID**: ***api_status-18*** @@ -558,6 +1519,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -616,7 +1578,6 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: @@ -631,6 +1592,7 @@ At this documentation you will have all information and related files and exampl 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. +--- ## Test Case 19: Patch published (apiStatusMonitoring inactive) API with apiStatus aefId1 and aefId2 **Test ID**: ***api_status-19*** @@ -647,6 +1609,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -675,15 +1638,11 @@ At this documentation you will have all information and related files and exampl * 2 profiles, one with each aef. * apiStatus with aefId1 inside array * Use **APF Certificate** - - + * Use **Invoker Certificate** + **Expected Result**: @@ -716,6 +1675,7 @@ At this documentation you will have all information and related files and exampl 5. Mock Server received messages must accomplish: 1. **No Events have been received**. +--- ## Test Case 20: Patch published without aefs available API with apiStatus only aef2 **Test ID**: ***api_status-20*** @@ -732,6 +1692,7 @@ At this documentation you will have all information and related files and exampl * **Mock Server is clean.** **Execution Steps**: + 1. Register Invoker and Onboard Invoker at CCF. 2. Register Provider at CCF with 2 aefs. 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) @@ -790,7 +1751,6 @@ At this documentation you will have all information and related files and exampl * resourceName resource_1 and aefId1 * resourceName resource_2 and aefId2 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** - 4. Response without **"apiStatus"** parameter. 4. Response to Discover Request By Invoker: 1. **200 OK** response. 2. Response body must follow **DiscoveredAPIs** data structure: diff --git a/doc/testing/testplan/vendor_extensibility/README.md b/doc/testing/testplan/vendor_extensibility/README.md index 4cf359c..11697f9 100644 --- a/doc/testing/testplan/vendor_extensibility/README.md +++ b/doc/testing/testplan/vendor_extensibility/README.md @@ -1,6 +1,7 @@ # Test Plan for Vendor Extensibility Feature At this documentation you will have all information and related files and examples of test plan for this feature. +--- ## Test Case 1: Published API with vendor extensibility **Test ID**: ***vendor_extensibility-1*** @@ -61,6 +62,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if contains the **vendorSpecific** keys +--- ## Test Case 2: Published API with vendor extensibility and discover with VendSpecQueryParams disabled **Test ID**: ***vendor_extensibility-2*** @@ -121,6 +123,7 @@ At this documentation you will have all information and related files and exampl * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". * cause with message "No API Published accomplish filter conditions". +--- ## Test Case 3: Publish API with vendorExt active and discover without supported features filter **Test ID**: ***vendor_extensibility-3*** @@ -179,6 +182,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check **NOT** contains the **vendorSpecific** keys +--- ## Test Case 4: Publish API with vendorExt active but without vendorSpecifics **Test ID**: ***vendor_extensibility-4*** @@ -222,6 +226,7 @@ At this documentation you will have all information and related files and exampl * detail with message "If and only if VendorExt feature is enabled, then vendor-specific fields should be defined". * cause with message "Vendor extensibility misconfiguration". +--- ## Test Case 5: Publish API with vendorExt inactive but with vendorSpecifics **Test ID**: ***vendor_extensibility-5*** @@ -265,7 +270,7 @@ At this documentation you will have all information and related files and exampl * detail with message "If and only if VendorExt feature is enabled, then vendor-specific fields should be defined". * cause with message "Vendor extensibility misconfiguration". - +--- ## Test Case 6: Published API without vendor extensibility discover with VendSpecQueryParams enabled **Test ID**: ***vendor_extensibility-6*** @@ -328,6 +333,7 @@ At this documentation you will have all information and related files and exampl * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". * cause with message "No API Published accomplish filter conditions". +--- ## Test Case 7: Published API without vendor extensibility and discover with vendSpecQueryParams disabled **Test ID**: ***vendor_extensibility-7*** @@ -388,7 +394,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if **NOT** contains any **vendorSpecific** keys - +--- ## Test Case 8: Published API without vendor extensibility and discover without supported-features query parameter **Test ID**: ***vendor_extensibility-8*** @@ -449,6 +455,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if **NOT** contains any **vendorSpecific** keys +--- ## Test Case 9: Publish API without supportedFeatures **Test ID**: ***vendor_extensibility-9*** -- GitLab From 51f40a7663a11538b9d2a8dc767aee5299d6a23a Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 14 Jan 2025 18:08:06 +0100 Subject: [PATCH 11/12] added some notes --- doc/releasenotes.md | 82 ++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/doc/releasenotes.md b/doc/releasenotes.md index d45151e..99c3299 100644 --- a/doc/releasenotes.md +++ b/doc/releasenotes.md @@ -4,41 +4,77 @@ #### 3GPP CAPIF release 18 -- Added new endpoints included in new release 18. - - New logic for PATCH endpoints. -- New logic to support Vendor Extensibility - - 9 new tests to check this logic. -- New logic to support API Status feature -- Supported Features now are mandatory for all POST Requests as is described on TS 29.222. - - Possible Breaking change, all POST request now must include supported features attribute, default can me set to "0" to keep all features inactive. - - Possible Breaking change on Events API, if you need eventDetails information on notification you must activate Enhanced Event Report on supported features. -- New 8 tests on Events API to check supported features support. - +- New endpoints included in new release 18 with new logic. +- New logic to support Vendor Extensibility on Publish Service. +- New logic to support API Status feature on Publish and Events Services. +- Supported Features now are mandatory for all POST and PUT Requests as is described on TS 29.222. + - **Possible Breaking change**, all POST request now must include supported features attribute, default can me set to "0" to keep all features inactive. + - **Possible Breaking change** on Events API, if you need eventDetails information on notification you must activate **Enhanced Event Report** feature by setting properly the supported features flag. ### **Technical Debt Solved** -#### **Issues** +#### **Api Status feature** -- REDIS scheduled on start to allow receive notification since service is deployed. -- Problem removing service APIs published is provider register more than one APF. -- Superadmin problem deleting service API published through helper service if provider is not present. +- Events API: + - Event internal notifications between services improved to accomplish specification. + - On event subscription **SupportedFeatures** is readed and stored in db to accomplish specification. + - Also **SupportedFeatures** is checked before send event notification, in order to accomplish specification, sending **eventDetails** and related information according to ***enhanced_event_report*** and ***apiStatusMonitoring*** supported features activated. -#### Scripts upgraded +#### **Issues** -- New local scripts -- New remote scripts +- Solved issue to gert ready REDIS on deployment: REDIS scheduled on start to allow receive notification since service is deployed. +- Solved problem removing service APIs published is provider register more than one APF. +- Solved Superadmin problem deleting service API published through helper service if provider is not present. +- Increased the overall stability, fixing some corner cases. +- Location headers now are filled in same way at all services that needs it. +- Security issues solved. +- Base docker images present on ETSI registry. +- Robot image uploaded to ETSI Registry. + +#### Local Scripts + +- All scripts were reviewed and improved. +- New scripts to manage users on local deployment added: + - create_users.sh: helps developer to create new users in local deployment. + - remove_users.sh: helps developer to remove users from db in local deployment. + +#### Remote Scripts + +New scripts developed to help on remote deployment, configuration and testing. All this script are stored under helm/scripts in capif repository. + +***variables.sh*** contains all configuration that will be used on remote operation. This file must be filled carefully before run remote scripts. + +- Deployment Scripts: + - ***install_vault.sh***: This script will configure and execute helm install of vault chart. This script also execute job to configure vault. + - ***install_monitoring.sh***: This script will configure and execute helm install of monitoring chart. + - ***install_capif.sh***: This script will configure and execute helm install of capif component chart. + - ***uninstall_vault.sh***: This script uninstall vault component from remote environment. + - ***uninstall_monitoring.sh***: This script uninstall monitoring components from remote environment. + - ***uninstall_capif.sh***: This script uninstall capif components from remote environment. + +- Manage remote users: + - ***create_remote_users.sh*** + - ***remove_remote_users.sh*** + - ***remove_remote_users_by_prefix.sh*** +- Execute robot tests over remote deployment. + - ***run_remote_capif_tests.sh*** + +- Other helpful scripts: + - ***get_ingress.sh***: returns all ingress of a k8s namespace with ip to put on /etc/hosts to have a fixed DNS local resolution. + - ***set_ingress.sh***: Is the same than get_ingress.sh but it also add those fixed dns local resolution to /etc/hosts + - ***populate_create_remote_dummy_users.sh***: This script is created mainly for testing remote deployment with dummy information, onboarding invokers, providers, publishing apis and creating security context for all of them. + - ***populate_remove_remote_dummy_users.sh***: This scripts remove all dummy information loaded. ### **Documentation** #### New test included on documentation -- New 9 test on Vendor Extensibility test plan. -- New 8 tests on Events API test plan. -- Test plan updated with default supported features for all request set to "0" (all inactive by default). +- New Vendor Extensibility test suite with 9 tests. [Api Events Service](./testing/testplan/vendor_extensibility/README.md) +- New [API Status feature](./testing/testplan/api_status/README.md) test suite. +- Improved [Events test suite](./testing/testplan/api_events_service/README.md) with 8 new tests. +- Test plan updated with default supported features for all request set to "0" (all inactive by default) [See common operations](./testing/testplan/common_operations/README.md). - - ---->>>> must be included - New tests to check PATCH request +--- ## **Release 1.0.0** -- GitLab From 78f7160d41dde558ac0fd86e1252d6024d4d9b59 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Wed, 15 Jan 2025 16:09:02 +0100 Subject: [PATCH 12/12] release note updated --- doc/releasenotes.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/doc/releasenotes.md b/doc/releasenotes.md index 99c3299..b0a7aad 100644 --- a/doc/releasenotes.md +++ b/doc/releasenotes.md @@ -5,8 +5,8 @@ #### 3GPP CAPIF release 18 - New endpoints included in new release 18 with new logic. -- New logic to support Vendor Extensibility on Publish Service. -- New logic to support API Status feature on Publish and Events Services. +- New logic to support ***Vendor Extensibility*** on Publish Service. +- New logic to support ***API Status*** feature on Publish and Events Services. - Supported Features now are mandatory for all POST and PUT Requests as is described on TS 29.222. - **Possible Breaking change**, all POST request now must include supported features attribute, default can me set to "0" to keep all features inactive. - **Possible Breaking change** on Events API, if you need eventDetails information on notification you must activate **Enhanced Event Report** feature by setting properly the supported features flag. @@ -22,7 +22,7 @@ #### **Issues** -- Solved issue to gert ready REDIS on deployment: REDIS scheduled on start to allow receive notification since service is deployed. +- Solved issue to get ready REDIS on deployment: REDIS scheduled on start to allow receive notification since service is deployed. - Solved problem removing service APIs published is provider register more than one APF. - Solved Superadmin problem deleting service API published through helper service if provider is not present. - Increased the overall stability, fixing some corner cases. @@ -45,25 +45,29 @@ New scripts developed to help on remote deployment, configuration and testing. A ***variables.sh*** contains all configuration that will be used on remote operation. This file must be filled carefully before run remote scripts. - Deployment Scripts: - - ***install_vault.sh***: This script will configure and execute helm install of vault chart. This script also execute job to configure vault. - - ***install_monitoring.sh***: This script will configure and execute helm install of monitoring chart. - - ***install_capif.sh***: This script will configure and execute helm install of capif component chart. - - ***uninstall_vault.sh***: This script uninstall vault component from remote environment. - - ***uninstall_monitoring.sh***: This script uninstall monitoring components from remote environment. - - ***uninstall_capif.sh***: This script uninstall capif components from remote environment. + - ***install_vault.sh***: Deploy Vault component from k8s cluster, only needed if vault is not previously deployed. If it’s deployed you can setup vault token on variables.sh. + - ***install_monitoring.sh***: Deploy monitoring on k8s cluster. + - ***install_capif.sh***: Deploy OpenCAPIF on k8s cluster. It will be deployed on configured namespace with domain and hostnames configured under variables.sh. + - ***uninstall_vault.sh***: Rollback Vault component from k8s cluster. + - ***uninstall_monitoring.sh***: Rollback monitoring components from k8s cluster. + - ***uninstall_capif.sh***: Rollback OpenCAPIF from k8s cluster. - Manage remote users: - - ***create_remote_users.sh*** - - ***remove_remote_users.sh*** - - ***remove_remote_users_by_prefix.sh*** + - ***create_remote_users.sh***: This script create users setup by parameters on deployed OpenCAPIF. Those users are created by administrator. + - ***remove_remote_users.sh***: This script removes user from deployed OpenCAPIF. + - ***remove_remote_users_by_prefix.sh***:: This script removes users by prefix. + +- Configuration of bastion machine, this simplify DNS fixed resolution: + - ***get_ingress.sh***: This create a configuration for dns fixed resolution for ingress configured in namespace passed by parameters. + - ***set_ingress.sh***: This scripts adds to /etc/hosts the fixed DNS resolution for ingress setup for namespace passed by parameters. + - Execute robot tests over remote deployment. - - ***run_remote_capif_tests.sh*** + - ***run_remote_capif_tests.sh***: This scripts launch Robot Test docker image on current machine to reach deployed OpenCAPIF. Is useful to launch with “--include smoke” in order to ensure all is deployed properly. + +- Just for testing, next scripts upload dummy information to deployed OpenCAPIF: + - ***populate_create_remote_dummy_users.sh***: : Create Dummy providers and invokers, publish service APIs and creates security context for invokers. + - ***populate_remove_remote_dummy_users.sh***: Remove dummy information created. -- Other helpful scripts: - - ***get_ingress.sh***: returns all ingress of a k8s namespace with ip to put on /etc/hosts to have a fixed DNS local resolution. - - ***set_ingress.sh***: Is the same than get_ingress.sh but it also add those fixed dns local resolution to /etc/hosts - - ***populate_create_remote_dummy_users.sh***: This script is created mainly for testing remote deployment with dummy information, onboarding invokers, providers, publishing apis and creating security context for all of them. - - ***populate_remove_remote_dummy_users.sh***: This scripts remove all dummy information loaded. ### **Documentation** -- GitLab