diff --git a/README.md b/README.md index 577a12d15416e9625e5a89ffa647c10596548e72..a43067e45667c01fce5e61ea8a691d45d14e15e4 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,28 @@ # Common API Framework (CAPIF) - [Common API Framework (CAPIF)](#common-api-framework-capif) -- [Repository structure](#repository-structure) - [CAPIF\_API\_Services](#capif_api_services) +- [Documentation](#documentation) - [How to run CAPIF services in this Repository](#how-to-run-capif-services-in-this-repository) - [Run All CAPIF Services locally with Docker images](#run-all-capif-services-locally-with-docker-images) - [Run All CAPIF Services locally with Docker images and deploy monitoring stack](#run-all-capif-services-locally-with-docker-images-and-deploy-monitoring-stack) - [Run each service using Docker](#run-each-service-using-docker) - [Run each service using Python](#run-each-service-using-python) -- [How to test CAPIF APIs](#how-to-test-capif-apis) - - [Test Plan Documentation](#test-plan-documentation) - - [Robot Framework](#robot-framework) - - [Using Curl](#using-curl) - - [Using PostMan](#using-postman) - [Important urls:](#important-urls) - [Mongo CAPIF's DB Dashboard](#mongo-capifs-db-dashboard) - [Mongo Register's DB Dashboard](#mongo-registers-db-dashboard) - [FAQ Documentation](#faq-documentation) -- [CAPIF Release 0](#capif-release-0) -# Repository structure - -``` -CAPIF_API_Services -└───docs -│ └───test_plan -│ └───testing_with_postman -└───services -└───tests -└───tools - └───robot - └───open_api_script -``` -* **services**: Services developed following CAPIF API specifications. Also, other complementary services (e.g., NGINX and JWTauth services for the authentication of API consuming entities). -* **tools**: Auxiliary tools. Robot Framework related code and OpenAPI scripts. -* **test**: Tests developed using Robot Framework. - -* **docs**: Documents related to the code in the repository. - * images: images used in the repository - * test_plan: test plan descriptions for each API service referring to the test that are executed with the Robot Framework. - * testing_with_postman: auxiliary JSON file needed for the Postman-based examples. # CAPIF_API_Services This repository has the python-flask Mockup servers created with openapi-generator related with CAPIF APIS defined here: [Open API Descriptions of 3GPP 5G APIs] +# Documentation + +Please refer to [OCF Documentation] for more detailed information. + ## How to run CAPIF services in this Repository Capif services are developed under /service/ folder. @@ -147,29 +124,6 @@ pip3 install -r requirements.txt python3 -m ``` -# How to test CAPIF APIs -The above APIs can be tested either with "curl" command, POSTMAN tool or running developed tests with Robot Framework. -## Test Plan Documentation - -Complete documentation of tests is here: [Test Plan Directory] -## Robot Framework - -In order to ensure modifications over CAPIF services still accomplish the required functionality, Robot Framework test suite must be success. - -Test suite implemented accomplish requirements described under test plan at [Test Plan Directory] folder. - -Please go to [Testing with Robot Framework] Section - -## Using Curl - -Please go to [Testing Using Curl] section. - -## Using PostMan -You can test the CAPIF flow using the Postman tool. To do this, we have created a collection with some examples of CAPIF requests with everything necessary to carry them out. - -For more information on how to test the APIs with POSTMAN, follow this [Document](docs/testing_with_postman/README.md). -Also you have here the [POSTMAN Collection](docs/testing_with_postman/CAPIF.postman_collection.json) - # Important urls: ## Mongo CAPIF's DB Dashboard @@ -194,24 +148,11 @@ http://:8083/ (if accessed from another host) Frequently asked questions can be found here: [FAQ Directory] -# CAPIF Release 0 - -The APIs included in release 0 are: -- JWT Authentication APIs -- CAPIF Invoker Management API -- CAPIF Publish API -- CAPIF Discover API -- CAPIF Security API -- CAPIF Events API -- CAPIF Provider Management API - -Testing Suite of all services with robot. -Also Postman suite to a simple test. - - [Open API Descriptions of 3GPP 5G APIs]: https://forge.3gpp.org/rep/all/5G_APIs "Open API Descriptions of 3GPP 5G APIs" [Test Plan Directory]: ./docs/test_plan/README.md "Test Plan Directory" [Testing Using Curl]: ./docs/testing_with_curl/README.md "Testing Using Curl" [Testing with Robot Framework]: ./docs/testing_with_robot/README.md "Testing with Robot Framework" -[FAQ Directory]: ./FAQ.md "FAQ directory" \ No newline at end of file +[FAQ Directory]: https://ocf.etsi.org/documentation/latest/FAQ/ "FAQ Url" +[OCF Documentation]: https://ocf.etsi.org/documentation/latest/ "OCF Documentation" + diff --git a/docs/images/flows/01 - Register of AEF.png b/docs/images/flows/01 - Register of AEF.png deleted file mode 100644 index 391cb43fe8657f9965c66391f716cfc06a5e9eb0..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/01 - Register of AEF.png and /dev/null differ diff --git a/docs/images/flows/01a - Register (Only) AEF.png b/docs/images/flows/01a - Register (Only) AEF.png deleted file mode 100644 index 5b6d17b181408b74fb3e15bc8276d79bf1290c39..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/01a - Register (Only) AEF.png and /dev/null differ diff --git a/docs/images/flows/01b - Register of AEF GetAuth.png b/docs/images/flows/01b - Register of AEF GetAuth.png deleted file mode 100644 index 8cb5cb75839e340aeedf3349c8032fcae1fc3ce4..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/01b - Register of AEF GetAuth.png and /dev/null differ diff --git a/docs/images/flows/02 - AEF API Provider registration.png b/docs/images/flows/02 - AEF API Provider registration.png deleted file mode 100644 index 3b42e21185ae36c97f3c6504624757a80e282ef6..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/02 - AEF API Provider registration.png and /dev/null differ diff --git a/docs/images/flows/03 - AEF Publish.png b/docs/images/flows/03 - AEF Publish.png deleted file mode 100644 index dfe3a3e09ff3183fa93eab95e1df107a2dfa9638..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/03 - AEF Publish.png and /dev/null differ diff --git a/docs/images/flows/04 - Invoker Register.png b/docs/images/flows/04 - Invoker Register.png deleted file mode 100644 index 571f2af8098ba390a31cf5676ba0cd180b55d983..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/04 - Invoker Register.png and /dev/null differ diff --git a/docs/images/flows/04a - Invoker (Only) Register.png b/docs/images/flows/04a - Invoker (Only) Register.png deleted file mode 100644 index 535d8b5baf23f43060231d20ca82c077e0959bab..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/04a - Invoker (Only) Register.png and /dev/null differ diff --git a/docs/images/flows/04b - Invoker Register GetAuth.png b/docs/images/flows/04b - Invoker Register GetAuth.png deleted file mode 100644 index 2cb2349e0378c18f874da9442852ca1eb79deb6b..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/04b - Invoker Register GetAuth.png and /dev/null differ diff --git a/docs/images/flows/05 - Invoker Onboarding.png b/docs/images/flows/05 - Invoker Onboarding.png deleted file mode 100644 index 9cd4b2d9fc99daa0f285a0f9e5cf77d9c51ea17c..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/05 - Invoker Onboarding.png and /dev/null differ diff --git a/docs/images/flows/06 - Invoker Discover AEF.png b/docs/images/flows/06 - Invoker Discover AEF.png deleted file mode 100644 index 20b2f04f94444833bbea04832620434593f89bc0..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/06 - Invoker Discover AEF.png and /dev/null differ diff --git a/docs/images/flows/07 - Invoker Create Security Context.png b/docs/images/flows/07 - Invoker Create Security Context.png deleted file mode 100644 index bb655e0e38e8394b3aaa024ada0f13c2f21c2b4c..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/07 - Invoker Create Security Context.png and /dev/null differ diff --git a/docs/images/flows/08 - Invoker Get Token.png b/docs/images/flows/08 - Invoker Get Token.png deleted file mode 100644 index 2e39f52a3d12efa8c19ea3032957e9f48d890d0e..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/08 - Invoker Get Token.png and /dev/null differ diff --git a/docs/images/flows/09 - Invoker Send Request to AEF Service API.png b/docs/images/flows/09 - Invoker Send Request to AEF Service API.png deleted file mode 100644 index 1e4a87c54b04d2d6524da2617fa615dab7318dc7..0000000000000000000000000000000000000000 Binary files a/docs/images/flows/09 - Invoker Send Request to AEF Service API.png and /dev/null differ diff --git a/docs/images/robot_log_example.png b/docs/images/robot_log_example.png deleted file mode 100644 index 6c15a031e26eae47fed53b21a1e69e2f7bfa89db..0000000000000000000000000000000000000000 Binary files a/docs/images/robot_log_example.png and /dev/null differ diff --git a/docs/images/robot_report_example.png b/docs/images/robot_report_example.png deleted file mode 100644 index 1cf36d8766753d08938be73c87e958f4c8d56068..0000000000000000000000000000000000000000 Binary files a/docs/images/robot_report_example.png and /dev/null differ diff --git a/docs/test_plan/README.md b/docs/test_plan/README.md deleted file mode 100644 index d25099756a27c799848098e6e343564298a2f0c2..0000000000000000000000000000000000000000 --- a/docs/test_plan/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[**[Return To Main]**] - -# Testplans -List of Common API Services implemented: -* [Api Invoker Management](./api_invoker_management/README.md) -* [Api Provider Management](./api_provider_management/README.md) -* [Api Publish Service](./api_publish_service/README.md) -* [Api Discover Service](./api_discover_service/README.md) -* [Api Events Service](./api_events_service/README.md) -* [Api Security Service](./api_security_service/README.md) -* [Api Logging Service](./api_logging_service/README.md) -* [Api Auditing Service](./api_auditing_service/README.md) -* [Api Access Control Policy](./api_access_control_policy/README.md) - - - [Return To Main]: ../../README.md#test-plan-documentation \ No newline at end of file diff --git a/docs/test_plan/api_access_control_policy/README.md b/docs/test_plan/api_access_control_policy/README.md deleted file mode 100644 index 05a9e63227702c7972790a6ea248d6f9a1dea864..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_access_control_policy/README.md +++ /dev/null @@ -1,813 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Access Control Policy](#test-plan-for-capif-api-access-control-policy) -- [Tests](#tests) - - [Test Case 1: Retrieve ACL](#test-case-1-retrieve-acl) - - [Test Case 2: Retrieve ACL with 2 Service APIs published](#test-case-2-retrieve-acl-with-2-service-apis-published) - - [Test Case 3: Retrieve ACL with security context created by two different Invokers](#test-case-3-retrieve-acl-with-security-context-created-by-two-different-invokers) - - [Test Case 4: Retrieve ACL filtered by api-invoker-id](#test-case-4-retrieve-acl-filtered-by-api-invoker-id) - - [Test Case 5: Retrieve ACL filtered by supported-features](#test-case-5-retrieve-acl-filtered-by-supported-features) - - [Test Case 6: Retrieve ACL with aef-id not valid](#test-case-6-retrieve-acl-with-aef-id-not-valid) - - [Test Case 7: Retrieve ACL with service-id not valid](#test-case-7-retrieve-acl-with-service-id-not-valid) - - [Test Case 8: Retrieve ACL with service-api-id and aef-id not valid](#test-case-8-retrieve-acl-with-service-api-id-and-aef-id-not-valid) - - [Test Case 9: Retrieve ACL without SecurityContext created previously by Invoker](#test-case-9-retrieve-acl-without-securitycontext-created-previously-by-invoker) - - [Test Case 10: Retrieve ACL filtered by api-invoker-id not present](#test-case-10-retrieve-acl-filtered-by-api-invoker-id-not-present) - - [Test Case 11: Retrieve ACL with APF Certificate](#test-case-11-retrieve-acl-with-apf-certificate) - - [Test Case 12: Retrieve ACL with AMF Certificate](#test-case-12-retrieve-acl-with-amf-certificate) - - [Test Case 13: Retrieve ACL with Invoker Certificate](#test-case-13-retrieve-acl-with-invoker-certificate) - - [Test Case 14: No ACL for invoker after be removed](#test-case-14-no-acl-for-invoker-after-be-removed) - - - - -# Test Plan for CAPIF Api Access Control Policy -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Retrieve ACL -* **Test ID**: ***capif_api_acl-1*** -* **Description**: - - This test case will check that an API Provider can retrieve ACL from CAPIF -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. 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 - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. 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. - - -## Test Case 2: Retrieve ACL with 2 Service APIs published -* **Test ID**: ***capif_api_acl-2*** -* **Description**: - - This test case will check that an API Provider can retrieve ACL from CAPIF for 2 different serviceApis published. -* **Pre-Conditions**: - - * API Provider had two Service API Published on CAPIF - * API Invoker had a Security Context for both Service APIs published. - -* **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. 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_2 - * Store *serviceApiId* - * Use APF Certificate - - 4. Perform [Invoker Onboarding] store apiInvokerId - 5. Discover published APIs - 6. Create Security Context for this Invoker for both published APIs - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 7. Provider Retrieve ACL for serviceApiId1 - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use AEF Provider Certificate - - 8. Provider Retrieve ACL for serviceApiId2 - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId2}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 and service_2 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information for service_1. - 7. Provider Get ACL information for service_2. - -* **Expected Result**: - - 1. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. contain one object. - 2. apiInvokerId must match apiInvokerId registered previously. - -## Test Case 3: Retrieve ACL with security context created by two different Invokers -* **Test ID**: ***capif_api_acl-3*** -* **Description**: - - This test case will check that an API Provider can retrieve ACL from CAPIF containing 2 objects. -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * Two API Invokers had a Security Context for same Service API published by provider. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker for both published APIs - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Repeat previous 3 steps in order to have a new Invoker. - - 7. Provider Retrieve ACL for serviceApiId - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 and service_2 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. Contain two objects. - 2. One object must match with apiInvokerId1 and the other one with apiInvokerId2 an registered previously. - -## Test Case 4: Retrieve ACL filtered by api-invoker-id -* **Test ID**: ***capif_api_acl-4*** -* **Description**: - - This test case will check that an API Provider can retrieve ACL filtering by apiInvokerId from CAPIF containing 1 objects. -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * Two API Invokers had a Security Context for same Service API published by provider. - -* **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 - - 4. Perform [Invoker Onboarding] store apiInvokerId - 6. Discover published APIs - 7. Create Security Context for this Invoker for both published APIs - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 8. Repeat previous 3 steps in order to have a new Invoker. - - 9. Provider Retrieve ACL for serviceApiId - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}&api-invoker-id={apiInvokerId1}* - * Use *serviceApiId*, *aefId* and apiInvokerId1 - * Use AEF Provider Certificate - - 10. Provider Retrieve ACL for serviceApiId - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}&api-invoker-id={apiInvokerId2}* - * Use *serviceApiId*, *aefId* and apiInvokerId2 - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 and service_2 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information with query parameter indicating first api-invoker-id. - 7. Provider Get ACL information with query parameter indicating second api-invoker-id. - -* **Expected Result**: - - 1. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. Contain one objects. - 2. Object must match with apiInvokerId1. - - 2. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. Contain one objects. - 2. Object must match with apiInvokerId2. - -## Test Case 5: Retrieve ACL filtered by supported-features -* **Test ID**: ***capif_api_acl-5*** -* **Description**: - **CURRENTLY NOT SUPPORTED FEATURE** - - This test case will check that an API Provider can retrieve ACL filtering by supportedFeatures from CAPIF containing 1 objects. - -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * Two API Invokers had a Security Context for same Service API published by provider. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker for both published APIs - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Repeat previous 3 steps in order to have a new Invoker. - - 7. Provider Retrieve ACL for serviceApiId - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}&supported-features={apiInvokerId1}* - * Use *serviceApiId*, *aefId* and apiInvokerId1 - * Use AEF Provider Certificate - - 8. Provider Retrieve ACL for serviceApiId - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId1}?aef-id=${aef_id}&supported-features={apiInvokerId2}* - * Use *serviceApiId*, *aefId* and apiInvokerId2 - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 and service_2 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information with query parameter indicating first supported-features. - 7. Provider Get ACL information with query parameter indicating second supported-features. - -* **Expected Result**: - - 1. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. Contain one objects. - 2. Object must match with supportedFeatures1. - - 2. ACL Response: - 1. **200 OK** Response. - 2. body returned must accomplish **AccessControlPolicyList** data structure. - 3. apiInvokerPolicies must: - 1. Contain one objects. - 2. Object must match with supportedFeatures1. - - -## Test Case 6: Retrieve ACL with aef-id not valid -* **Test ID**: ***capif_api_acl-6*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF if aef-id is not valid -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${AEF_ID_NOT_VALID}* - * Use *serviceApiId* and *AEF_ID_NOT_VALID* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {service_api_id}, aef_id: {aef_id}, invoker: {api_invoker_id} and supportedFeatures: {supported_features}". - * cause with message "Wrong id". - - -## Test Case 7: Retrieve ACL with service-id not valid -* **Test ID**: ***capif_api_acl-7*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF if service-api-id is not valid -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${NOT_VALID_SERVICE_API_ID}?aef-id=${aef_id}* - * Use *NOT_VALID_SERVICE_API_ID* and *aef_id* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {service_api_id}, aef_id: {aef_id}, invoker: {api_invoker_id} and supportedFeatures: {supported_features}". - * cause with message "Wrong id". - -## Test Case 8: Retrieve ACL with service-api-id and aef-id not valid -* **Test ID**: ***capif_api_acl-8*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF if service-api-id and aef-id are not valid -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${NOT_VALID_SERVICE_API_ID}?aef-id=${AEF_ID_NOT_VALID}* - * Use *NOT_VALID_SERVICE_API_ID* and *aef_id* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {NOT_VALID_SERVICE_API_ID}, aef_id: {AEF_ID_NOT_VALID}, invoker: {api_invoker_id} and supportedFeatures: {supported_features}". - * cause with message "Wrong id". - - -## Test Case 9: Retrieve ACL without SecurityContext created previously by Invoker -* **Test ID**: ***capif_api_acl-9*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL if no invoker had requested Security Context to CAPIF -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker created but no Security Context for Service API published had been requested. - -* **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] store apiInvokerId - 4. Discover published APIs - - 5. 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 - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {NOT_VALID_SERVICE_API_ID}, aef_id: {AEF_ID_NOT_VALID}, invoker: {api_invoker_id} and supportedFeatures: {supported_features}". - * cause with message "Wrong id". - -## Test Case 10: Retrieve ACL filtered by api-invoker-id not present -* **Test ID**: ***capif_api_acl-10*** -* **Description**: - - This test case will check that an API Provider get not found response if filter by not valid api-invoker-id doesn't match any registered ACL. -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}&api-invoker-id={NOT_VALID_API_INVOKER_ID}* - * Use *serviceApiId*, *aefId* and *NOT_VALID_API_INVOKER_ID* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {NOT_VALID_SERVICE_API_ID}, aef_id: {AEF_ID_NOT_VALID}, invoker: {api_invoker_id} and supportedFeatures: {supported_features}". - * cause with message "Wrong id". - -## Test Case 11: Retrieve ACL with APF Certificate -* **Test ID**: ***capif_api_acl-11*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF using APF Certificate -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use APF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. Response to Logging Service must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 401 - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "Certificate not authorized". - -## Test Case 12: Retrieve ACL with AMF Certificate -* **Test ID**: ***capif_api_acl-12*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF using AMF Certificate -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use AMF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. Response to Logging Service must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 401 - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "Certificate not authorized". - -## Test Case 13: Retrieve ACL with Invoker Certificate -* **Test ID**: ***capif_api_acl-13*** -* **Description**: - - This test case will check that an API Provider can't retrieve ACL from CAPIF using Invoker Certificate -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published. - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}* - * Use *serviceApiId* and *aefId* - * Use Invoker Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information. - -* **Expected Result**: - - 1. Response to Logging Service must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 401 - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "Certificate not authorized". - -## Test Case 14: No ACL for invoker after be removed -* **Test ID**: ***capif_api_acl-14*** -* **Description**: - - This test case will check that ACLs are removed after invoker is removed. -* **Pre-Conditions**: - - * API Provider had a Service API Published on CAPIF - * API Invoker had a Security Context for Service API published and ACL is present - -* **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] store apiInvokerId - 4. Discover published APIs - 5. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - - 6. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}&api-invoker-id={api-invoker-id}* - * Use *serviceApiId*, *aefId* and *api-invoker-id* - * Use AEF Provider Certificate - 7. Remove Invoker from CAPIF - 8. Provider Retrieve ACL - * Send GET *https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}&api-invoker-id={api-invoker-id}* - * Use *serviceApiId*, *aefId* and *api-invoker-id* - * Use AEF Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Provider at CCF. - 2. Publish a provider API with name service_1 - 3. Register and onboard Invoker at CCF - 4. Store signed Certificate - 5. Create Security Context - 6. Provider Get ACL information of invoker. - 7. Remove Invoker from CAPIF. - 8. Provider Get ACL information of invoker. - -* **Expected Result**: - 1. 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. - - 2. ACL Response: - 1. **404 Not Found** Response. - 2. body returned must accomplish **Problem Details** data structure. - 3. apiInvokerPolicies must: - * status **404** - * title with message "Not Found" - * detail with message "No ACLs found for the requested service: {NOT_VALID_SERVICE_API_ID}, aef_id: {AEF_ID_NOT_VALID}, invoker: None and supportedFeatures: None". - * cause with message "Wrong id". - - - -[Return To All Test Plans]: ../README.md - -[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" -[service security body]: ./service_security.json "Service Security Request" -[security notification body]: ./security_notification.json "Security Notification Request" -[access token req body]: ./access_token_req.json "Access Token Request" -[example]: ./access_token_req.json "Access Token Request Example" -[invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" -[provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" diff --git a/docs/test_plan/api_access_control_policy/service_api_description_post_example.json b/docs/test_plan/api_access_control_policy/service_api_description_post_example.json deleted file mode 100644 index b725b428629509bf39a79c030f1bf93f4b6f18f6..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_access_control_policy/service_api_description_post_example.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "apiName": "service_1", - "aefProfiles": [ - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - }, - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -} \ No newline at end of file diff --git a/docs/test_plan/api_auditing_service/README.md b/docs/test_plan/api_auditing_service/README.md deleted file mode 100644 index bd3204c0aa3cc0eeb63b3f85f6f6629914957aa4..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_auditing_service/README.md +++ /dev/null @@ -1,244 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Auditing Service](#test-plan-for-capif-api-auditing-service) -- [Tests](#tests) - - [Test Case 1: Get a CAPIF Log Entry.](#test-case-1-creates-a-new-individual-capif-log-entry) - - -# Test Plan for CAPIF Api Auditing Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Get CAPIF Log Entry. -* Test ID: ***capif_api_auditing-1*** -* Description: - - This test case will check that a CAPIF AMF can get log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid AMF cert from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - * Log Entry exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding], [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Create Log Entry: - - Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - - body [log entry request body] - - Use AEF Certificate - - 4. Get Log: - 1. Send GET to *https://{CAPIF_HOSTNAME}/logs/v1/apiInvocationLogs?aef-id={aefId}&api-invoker-id={api-invoker-id}* - 2. Use AMF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - 4. Get Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **200 OK** - 2. Response Body must follow **InvocationLog** data structure with: - * aefId - * apiInvokerId - * logs - -## Test Case 2: Get CAPIF Log Entry With no Log entry in CAPIF. -* Test ID: ***capif_api_auditing-2*** -* Description: - - This test case will check that a CAPIF AEF can create log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid AMF cert from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - - -* Information of Test: - - 1. Perform [provider onboarding], [invoker onboarding] - - 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 - - Use APF Certificate - - 4. Get Log: - 1. Send GET to *https://{CAPIF_HOSTNAME}/logs/v1/apiInvocationLogs?aef-id={aefId}&api-invoker-id={api-invoker-id}* - 2. Use AMF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Get Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found Log Entry in CAPIF". - * cause with message "Not Exist Logs with the filters applied". - - -## Test Case 3: Get CAPIF Log Entry without aef-id and api-invoker-id. -* Test ID: ***capif_api_auditing-3*** -* Description: - - This test case will check that a CAPIF AEF can create log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is no pre-authorised (has no valid AMF cert from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - * Log Entry exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding], [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Create Log Entry: - - Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - - body [log entry request body] - - Use AEF Certificate - - 4. Get Log: - 1. Send GET to *https://{CAPIF_HOSTNAME}/logs/v1/apiInvocationLogs - 2. Use AMF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - 4. Get Log Entry - -* Expected Result: - - 1. Response to Logging Service 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 "aef_id and api_invoker_id parameters are mandatory". - * cause with message "Mandatory parameters missing". - - -## Test Case 4: Get CAPIF Log Entry with filtter api-version. -* Test ID: ***capif_api_auditing-4*** -* Description: - - This test case will check that a CAPIF AMF can get log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid AMF cert from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - * Log Entry exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding], [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Create Log Entry: - - Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - - body [log entry request body] - - Use AEF Certificate - - 4. Get Log: - 1. Send GET to *https://{CAPIF_HOSTNAME}/logs/v1/apiInvocationLogs?aef-id={aefId}&api-invoker-id={api-invoker-id}&api-version={v1}* - 2. Use AMF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - 4. Get Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **200 OK** - 2. Response Body must follow **InvocationLog** data structure with: - * aefId - * apiInvokerId - * logs - - -## Test Case 5: Get CAPIF Log Entry with filter api-version but not exist in log entry. -* Test ID: ***capif_api_auditing-4*** -* Description: - - This test case will check that a CAPIF AMF can get log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid AMF cert from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - * Log Entry exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding], [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Create Log Entry: - - Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - - body [log entry request body] - - Use AEF Certificate - - 4. Get Log: - 1. Send GET to *https://{CAPIF_HOSTNAME}/logs/v1/apiInvocationLogs?aef-id={aefId}&api-invoker-id={api-invoker-id}&api-version={v58}* - 2. Use AMF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - 4. Get Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * detail with message "Parameters do not match any log entry" - * cause with message "No logs found". - - - -[log entry request body]: ../api_logging_service/invocation_log.json "Log Request Body" - -[invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - -[provider onboarding]: ../common_operations/README.md#register-a-provider "Provider Onboarding" - -[Return To All Test Plans]: ../README.md \ No newline at end of file diff --git a/docs/test_plan/api_discover_service/README.md b/docs/test_plan/api_discover_service/README.md deleted file mode 100644 index 3125c888c96eadcbda6a7b6a688aa721f2714000..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_discover_service/README.md +++ /dev/null @@ -1,336 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Discover Service](#test-plan-for-capif-discover-service) -- [Tests](#tests) - - [Test Case 1: Discover Published service APIs by Authorised API Invoker](#test-case-1-discover-published-service-apis-by-authorised-api-invoker) - - [Test Case 2: Discover Published service APIs by Non Authorised API Invoker](#test-case-2-discover-published-service-apis-by-non-authorised-api-invoker) - - [Test Case 3: Discover Published service APIs by not registered API Invoker](#test-case-3-discover-published-service-apis-by-not-registered-api-invoker) - - [Test Case 4: Discover Published service APIs by registered API Invoker with 1 result filtered](#test-case-4-discover-published-service-apis-by-registered-api-invoker-with-1-result-filtered) - - [Test Case 5: Discover Published service APIs by registered API Invoker filtered with no match](#test-case-5-discover-published-service-apis-by-registered-api-invoker-filtered-with-no-match) - - [Test Case 6: Discover Published service APIs by registered API Invoker not filtered](#test-case-6-discover-published-service-apis-by-registered-api-invoker-not-filtered) - - -# Test Plan for CAPIF Discover Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Discover Published service APIs by Authorised API Invoker -* **Test ID**: ***capif_api_discover_service-1*** -* **Description**: - - This test case will check if NetApp (Invoker) can discover published service APIs. -* **Pre-Conditions**: - * Service APIs are published. - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 3. Request Discover Published APIs: - * Send GET to *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Use Invoker Certificate - -* **Execution Steps**: - - 1. Register Provider at CCF, store certificates and Publish Service API at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by Invoker - -* **Expected Result**: - - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 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 Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains the API Published previously - - -## Test Case 2: Discover Published service APIs by Non Authorised API Invoker -* **Test ID**: ***capif_api_discover_service-2*** -* **Description**: - - This test case will check that an API Publisher can't discover published APIs because is not authorized. - -* **Pre-Conditions**: - * Service APIs are published. - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 3. Request Discover Published APIs by no invoker entity: - * Send GET to *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Use not Invoker Certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by no invoker entity - -* **Expected Result**: - - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 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 Discover Request By no invoker entity: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 401 - * title with message "Unauthorized" - * detail with message "User not authorized". - * cause with message "Certificate not authorized". - - -## Test Case 3: Discover Published service APIs by not registered API Invoker -* **Test ID**: ***capif_api_discover_service-3*** -* **Description**: - - This test case will check that a not registered invoker is forbidden to discover published APIs. - -* **Pre-Conditions**: - * Service APIs are published. - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 3. Request Discover Published APIs with not valid apiInvoker: - * Send GET to *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={INVOKER_NOT_REGISTERED}* - * Param api-invoker-id is mandatory - * Using invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by Publisher - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 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 Discover Request By Invoker: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "API Invoker does not exist". - * cause with message "API Invoker id not found". - - -## Test Case 4: Discover Published service APIs by registered API Invoker with 1 result filtered -* **Test ID**: ***capif_api_discover_service-4*** -* **Description**: - - This test case will check if NetApp (Invoker) can discover published service APIs. -* **Pre-Conditions**: - * At least 2 Service APIs are published. - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 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_2 - * Use APF Certificate - 4. Request Discover Published APIs filtering by api-name: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api-name=service_1* - * Param api-invoker-id is mandatory - * Using invoker certificate - * filter by api-name service_1 - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 and service_2 at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Discover filtered by api-name service_1 Service APIs by Invoker - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - 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 Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains previously registered Service APIs published. - 4. Response to Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains only Service API published with api-name service_1 - - -## Test Case 5: Discover Published service APIs by registered API Invoker filtered with no match -* **Test ID**: ***capif_api_discover_service-5*** -* **Description**: - This test case will check if NetApp (Invoker) can discover published service APIs. -* **Pre-Conditions**: - * At least 2 Service APIs are published. - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 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_2 - * Use APF Certificate - 4. Request Discover Published APIs filtering by api-name not published: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api-name=NOT_VALID_NAME* - * Param api-invoker-id is mandatory - * Using invoker certificate - * filter by api-name NOT_VALID_NAME - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 and service_2 at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Discover filtered by api-name not published Service APIs by Invoker - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - 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 Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains previously registered Service APIs published. - 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". - - -## Test Case 6: Discover Published service APIs by registered API Invoker not filtered -* **Test ID**: ***capif_api_discover_service-6*** -* **Description**: - - This test case will check if NetApp (Invoker) can discover published service APIs. -* **Pre-Conditions**: - * 2 Service APIs are published. - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 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_2 - * Use APF Certificate - 4. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 and service_2 at CCF - 2. Register Invoker and Onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Discover without filter by Invoker - -* **Expected Result**: - - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 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 Discover Request By Invoker: - 1. **200 OK** response. - 2. Response body must follow **DiscoveredAPIs** data structure: - * Check if DiscoveredAPIs contains the 2 previously registered Service APIs published. - - - - [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" - [invoker register body]: ../api_invoker_management/invoker_register_body.json "Invoker Register Body" - [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" - [provider getauth body]: ../api_provider_management/provider_getauth_example.json "Get Auth Example" - [invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" - - -[Return To All Test Plans]: ../README.md diff --git a/docs/test_plan/api_events_service/README.md b/docs/test_plan/api_events_service/README.md deleted file mode 100644 index 417c1aa623671fde54b4e894b8e359ee03dd9d36..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_events_service/README.md +++ /dev/null @@ -1,265 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Events Service](#test-plan-for-capif-api-events-service) -- [Tests](#tests) - - [Test Case 1: Creates a new individual CAPIF Event Subscription.](#test-case-1-creates-a-new-individual-capif-event-subscription) - - [Test Case 2: Creates a new individual CAPIF Event Subscription with Invalid SubscriberId](#test-case-2-creates-a-new-individual-capif-event-subscription-with-invalid-subscriberid) - - [Test Case 3: Deletes an individual CAPIF Event Subscription](#test-case-3-deletes-an-individual-capif-event-subscription) - - [Test Case 4: Deletes an individual CAPIF Event Subscription with invalid SubscriberId](#test-case-4-deletes-an-individual-capif-event-subscription-with-invalid-subscriberid) - - [Test Case 5: Deletes an individual CAPIF Event Subscription with invalid SubscriptionId](#test-case-5-deletes-an-individual-capif-event-subscription-with-invalid-subscriptionid) - - - -# Test Plan for CAPIF Api Events Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Creates a new individual CAPIF Event Subscription. -* Test ID: ***capif_api_events-1*** -* Description: - - This test case will check that a CAPIF subscriber (Invoker or Publisher) can Subscribe to Events -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) - -* 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] - 3. Use Invoker Certificate - -* Execution Steps: - - 1. Register Invoker and Onboard Invoker at CCF - 2. Subscribe to Events - 3. Retrieve {subscriberId} and {subscriptionId} from Location Header - -* 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. Event Subscriptions are stored in CAPIF Database - - -## Test Case 2: Creates a new individual CAPIF Event Subscription with Invalid SubscriberId -* Test ID: ***capif_api_events-2*** -* Description: - - This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Subscribe to Events without valid SubcriberId -* Pre-Conditions: - - * CAPIF subscriber is not pre-authorised (has invalid InvokerId or apfId) - -* Information of Test: - - 1. Perform [Invoker Onboarding] - - 2. Event Subscription: - 1. Send POST to *https://{CAPIF_HOSTNAME}/capif-events/v1/{SUBSCRIBER_NOT_REGISTERED}/subscriptions* - 2. body [event subscription request body] - 3. Use Invoker Certificate - -* Execution Steps: - - 1. Register Invoker and Onboard Invoker at CCF - 2. Subscribe to Events - -* 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. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Invoker or APF or AEF or AMF Not found". - * cause with message "Subscriber Not Found". - - 3. Event Subscriptions are not stored in CAPIF Database - - -## Test Case 3: Deletes an individual CAPIF Event Subscription -* Test ID: ***capif_api_events-3*** -* Description: - - This test case will check that a CAPIF subscriber (Invoker or Publisher) can Delete an Event Subscription -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) - -* 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] - 3. Use Invoker Certificate - - 3. Remove Event Subscription: - 1. Send DELETE to *https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions* - 2. Use Invoker Certificate - -* Execution Steps: - - 1. Register Invoker and Onboard Invoker at CCF - 2. Subscribe to Events - 3. Retrieve {subscriberId} and {subscriptionId} from Location Header - 4. Remove Event Subscription - -* 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. Event Subscriptions are stored in CAPIF Database - 4. Remove Event Subscription: - 1. **204 No Content** - - 5. Event Subscription is not present at CAPIF Database. - - -## Test Case 4: Deletes an individual CAPIF Event Subscription with invalid SubscriberId -* Test ID: ***capif_api_events-4*** -* Description: - - This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Delete to Events without valid SubcriberId -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId). - * CAPIF subscriber is subscribed to Events. - -* 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] - 3. Use Invoker Certificate - - 3. Remove Event Subcription with not valid subscriber: - 1. Send DELETE to to https://{CAPIF_HOSTNAME}/capif-events/v1/{SUBSCRIBER_ID_NOT_VALID}/subscriptions/{subcriptionId} - 2. Use Invoker Certificate - -* Execution Steps: - - 1. Register Invoker and Onboard Invoker at CCF - 2. Subscribe to Events - 3. Retrieve Location Header with subscriptionId. - 4. Remove Event Subscribed with not valid Subscriber. - -* 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. Event Subscriptions are stored in CAPIF Database - 4. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Invoker or APF or AEF or AMF Not found". - * cause with message "Subscriber Not Found". - - -## Test Case 5: Deletes an individual CAPIF Event Subscription with invalid SubscriptionId -* Test ID: ***capif_api_events-5*** -* Description: - - This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Delete an Event Subscription without valid SubscriptionId -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has invalid InvokerId or apfId). - * CAPIF subscriber is subscribed to Events. - -* 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] - 3. Use Invoker Certificate - - 3. Remove Event Subcription with not valid subscriber: - 1. Send DELETE to to https://{CAPIF_HOSTNAME}/capif-events/v1/{subcriberId}/subscriptions/{SUBSCRIPTION_ID_NOT_VALID} - 2. Use Invoker Certificate - -* Execution Steps: - - 1. Register Invoker and Onboard Invoker at CCF - 2. Subscribe to Events - 3. Retrieve Location Header with subscriptionId. - 4. Remove Event Subscribed with not valid Subscriber. - -* 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. Event Subscriptions are stored in CAPIF Database - 4. Remove Event Subscription with not valid subscriber: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * detail with message "Service API not existing". - * cause with message "Event API subscription id not found". - - - - -[invoker register body]: ../api_invoker_management/invoker_register_body.json "Invoker Register Body" -[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#register-an-invoker "Invoker Onboarding" - - -[Return To All Test Plans]: ../README.md diff --git a/docs/test_plan/api_events_service/event_subscription.json b/docs/test_plan/api_events_service/event_subscription.json deleted file mode 100644 index 40dc09bb1ca5236fa9cb23ff1a25ad5dccd28844..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_events_service/event_subscription.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "eventFilters": [ - { - "aefIds": ["aefIds", "aefIds"], - "apiIds": ["apiIds", "apiIds"], - "apiInvokerIds": ["apiInvokerIds", "apiInvokerIds"] - }, - { - "aefIds": ["aefIds", "aefIds"], - "apiIds": ["apiIds", "apiIds"], - "apiInvokerIds": ["apiInvokerIds", "apiInvokerIds"] - } - ], - "eventReq": { - "grpRepTime": 5, - "immRep": true, - "maxReportNbr": 0, - "monDur": "2000-01-23T04:56:07+00:00", - "partitionCriteria": ["string1", "string2"], - "repPeriod": 6, - "sampRatio": 15 - }, - "events": ["SERVICE_API_AVAILABLE", "API_INVOKER_ONBOARDED"], - "notificationDestination": "http://robot.testing", - "requestTestNotification": true, - "supportedFeatures": "aaa", - "websockNotifConfig": { - "requestWebsocketUri": true, - "websocketUri": "websocketUri" - } -} diff --git a/docs/test_plan/api_invoker_management/README.md b/docs/test_plan/api_invoker_management/README.md deleted file mode 100644 index 9846c960d9e8fda5d84676a2242f820aa54f53cf..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_invoker_management/README.md +++ /dev/null @@ -1,306 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Invoker Management](#test-plan-for-capif-api-invoker-management) -- [Tests](#tests) - - [Test Case 1: Onboard NetApp](#test-case-1-onboard-netapp) - - [Test Case 2: Onboard NetApp Already onboarded](#test-case-2-onboard-netapp-already-onboarded) - - [Test Case 3: Update Onboarded NetApp](#test-case-3-update-onboarded-netapp) - - [Test Case 4: Update Not Onboarded NetApp](#test-case-4-update-not-onboarded-netapp) - - [Test Case 5: Offboard NetApp](#test-case-5-offboard-netapp) - - [Test Case 6: Offboard Not previsouly Onboarded NetApp](#test-case-6-offboard-not-previsouly-onboarded-netapp) - - [Test Case 7: Update Onboarded NetApp Certificate](#test-case-7-update-onboarded-netapp-certificate) - - -# Test Plan for CAPIF Api Invoker Management -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Onboard NetApp -* **Test ID**: ***capif_api_invoker_management-1*** -* **Description**: - - This test will try to register new NetApp at CAPIF Core. -* **Pre-Conditions**: - - * NetApp was not registered previously - * NetApp was not onboarded previously - -* **Information of Test**: - - 1. Create public and private key at invoker - - 2. Register of Invoker at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [invoker register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [invoker getauth body] - - 4. Onboard Invoker: - * Send POST to *https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers* - * Reference Request Body: [invoker onboarding body] - * "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker. - * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token}) - -* **Execution Steps**: - 1. Register Invoker at CCF - 2. Onboard Invoker at CCF - 3. Store signed 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}* - - -## Test Case 2: Onboard NetApp Already onboarded - -* **Test ID**: ***capif_api_invoker_management-2*** -* **Description**: - - This test will check second onboard of same NetApp is not allowed. - -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was onboarded previously - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. Repeat Onboard Invoker: - * Send POST to *https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers* - * Reference Request Body: [invoker onboarding body] - * "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker. - * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token}) - -* **Execution Steps**: - 1. Register NetApp at CCF - 2. Onboard NetApp at CCF - 3. Store signed Certificate at NetApp - 4. Onboard Again the NetApp at CCF - -* **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 Second Onboard of NetApp must accomplish: - 1. **403 Forbidden** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 403 - * title with message "Forbidden" - * detail with message "Invoker Already registered". - * cause with message "Identical invoker public key". - - -## Test Case 3: Update Onboarded NetApp -* **Test ID**: ***capif_api_invoker_management-3*** -* **Description**: - - This test will try to update information of previous onboard NetApp at CAPIF Core. -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. 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*", - -* **Execution Steps**: - - 1. Register Invoker at CCF - 2. Onboard Invoker at CCF - 3. Store signed Certificate - 4. Update Onboarding Information at CCF with a minor change on "notificationDestination" - -* **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 Update Request (PUT) with minor change must contain: - 1. **200 OK** response. - 2. notificationDestination on response must contain the new value - - -## Test Case 4: Update Not Onboarded NetApp -* **Test ID**: ***capif_api_invoker_management-4*** -* **Description**: - - This test will try to update information of not onboarded NetApp at CAPIF Core. -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was not onboarded previously - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. Update information of not onboarded Invoker: - * Send PUT to *https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{INVOKER_NOT_REGISTERED}* - * Reference Request Body is: [put invoker onboarding body] - -* **Execution Steps**: - - 1. Register Invoker at CCF - 2. Onboard Invoker at CCF - 3. Update Onboarding Information at CCF of not onboarded - -* **Expected Result**: - - 1. Response to Onboard request must accomplish: - 1. **201 Created** - 2. Response to Update Request (PUT) must contain: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Please provide an existing Netapp ID". - * cause with message "Not exist NetappID". - - - -## Test Case 5: Offboard NetApp -* **Test ID**: ***capif_api_invoker_management-5*** -* **Description**: - - This test case will check that a Registered NetApp can be deleted. -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was onboarded previously - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. Offboard: - * Send Delete to *https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}* - -* **Execution Steps**: - - 1. Register Invoker at CCF - 2. Onboard Invoker at CCF - 3. Offboard Invoker at CCF - -* **Expected Result**: - - 1. Response to Onboard request must accomplish: - 1. **201 Created** - 2. Response to Offboard Request (DELETE) must contain: - 1. **204 No Content** - - -## Test Case 6: Offboard Not previsouly Onboarded NetApp -* **Test ID**: ***capif_api_invoker_management-6*** -* **Description**: - - This test case will check that a Non-Registered NetApp cannot be deleted -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was not onboarded previously - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. Offboard: - * Send Delete to *https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{INVOKER_NOT_REGISTERED}* - -* **Execution Steps**: - - 1. Register Invoker at CCF - 2. Offboard Invoker at CCF - -* **Expected Result**: - - 1. Response to Offboard Request (DELETE) must contain: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Please provide an existing Netapp ID". - * cause with message "Not exist NetappID". - -## Test Case 7: Update Onboarded NetApp Certificate -* **Test ID**: ***capif_api_invoker_management-7*** -* **Description**: - - This test will try to update public key and get a new signed certificate by CAPIF Core. -* **Pre-Conditions**: - - * NetApp was registered previously - * NetApp was onboarded previously with {onboardingId} and {public_key_1} - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] with public_key_1. - - 2. Create {public_key_2} - - 3. 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] - * ["onboardingInformation"]["apiInvokerPublicKey"]: {public_key_2}, - * Store new certificate. - - 4. Update information of previously onboarded Invoker Using new certificate: - * 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*", - * Use new invoker certificate - -* **Execution Steps**: - - 1. Register Invoker at CCF - 2. Onboard Invoker at CCF - 3. Store signed Certificate - 4. Update Onboarding Information at CCF with new public key - 5. Update Onboarding Information at CCF with minor change - -* **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 Update Request (PUT) with new public key: - 1. **200 OK** response. - 2. apiInvokerCertificate with new certificate on response -> store to use. - 3. Response to Update Request (PUT) with minor change must contain: - 1. **200 OK** response. - 2. notificationDestination on response must contain the new value - - - - -[invoker onboarding body]: ./invoker_details_post_example.json "API Invoker Request" -[invoker register body]: ./invoker_register_body.json "Invoker Register Body" -[put register body]: ./invoker_details_put_example.json "API Invoker Update Request" -[invoker getauth body]: ./invoker_getauth_example.json "Get Auth Example" - -[invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - -[Return To All Test Plans]: ../README.md \ No newline at end of file diff --git a/docs/test_plan/api_invoker_management/invoker_details_post_example.json b/docs/test_plan/api_invoker_management/invoker_details_post_example.json deleted file mode 100644 index c306a17e2d04f55da35a5b3638775af9d63e769f..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_invoker_management/invoker_details_post_example.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "notificationDestination": "http://host.docker.internal:8086/netapp_callback", - "supportedFeatures": "fffffff", - "apiInvokerInformation": "ROBOT_TESTING_INVOKER", - "websockNotifConfig": { - "requestWebsocketUri": true, - "websocketUri": "websocketUri" - }, - "onboardingInformation": { - "apiInvokerPublicKey": "{PUBLIC_KEY}", - "onboardingSecret": "onboardingSecret", - "apiInvokerCertificate": "apiInvokerCertificate" - }, - "requestTestNotification": true -} diff --git a/docs/test_plan/api_invoker_management/invoker_details_put_example.json b/docs/test_plan/api_invoker_management/invoker_details_put_example.json deleted file mode 100644 index 37a1eefbb05a2df1058b20429477cbf17f412cb8..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_invoker_management/invoker_details_put_example.json +++ /dev/null @@ -1,393 +0,0 @@ -{ - "notificationDestination": "http://host.docker.internal:8086/netapp_new_callback", - "supportedFeatures": "fffffff", - "apiInvokerInformation": "ROBOT_TESTING_INVOKER", - "websockNotifConfig": { - "requestWebsocketUri": true, - "websocketUri": "websocketUri" - }, - "onboardingInformation": { - "apiInvokerPublicKey": "{PUBLIC_KEY}", - "onboardingSecret": "onboardingSecret", - "apiInvokerCertificate": "apiInvokerCertificate" - }, - "requestTestNotification": true, - "apiList": [ - { - "serviceAPICategory": "serviceAPICategory", - "ccfId": "ccfId", - "apiName": "apiName", - "shareableInfo": { - "capifProvDoms": ["capifProvDoms", "capifProvDoms"], - "isShareable": true - }, - "supportedFeatures": "fffffff", - "description": "description", - "apiSuppFeats": "fffffff", - "apiId": "apiId", - "aefProfiles": [ - { - "securityMethods": ["PSK"], - "versions": [ - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - }, - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - } - ], - "aefId": "aefId", - "interfaceDescriptions": [ - { - "securityMethods": ["PSK"], - "port": 5248, - "ipv4Addr": "ipv4Addr" - }, - { "securityMethods": ["PSK"], "port": 5248, "ipv4Addr": "ipv4Addr" } - ] - }, - { - "securityMethods": ["PSK"], - "versions": [ - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - }, - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - } - ], - "aefId": "aefId", - "interfaceDescriptions": [ - { - "securityMethods": ["PSK"], - "port": 5248, - "ipv4Addr": "ipv4Addr" - }, - { "securityMethods": ["PSK"], "port": 5248, "ipv4Addr": "ipv4Addr" } - ] - } - ], - "pubApiPath": { "ccfIds": ["ccfIds", "ccfIds"] } - }, - { - "serviceAPICategory": "serviceAPICategory", - "ccfId": "ccfId", - "apiName": "apiName2", - "shareableInfo": { - "capifProvDoms": ["capifProvDoms", "capifProvDoms"], - "isShareable": true - }, - "supportedFeatures": "fffffff", - "description": "description", - "apiSuppFeats": "fffffff", - "apiId": "apiId", - "aefProfiles": [ - { - "securityMethods": ["PSK"], - "versions": [ - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - }, - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - } - ], - "aefId": "aefId", - "interfaceDescriptions": [ - { - "securityMethods": ["PSK"], - "port": 5248, - "ipv4Addr": "ipv4Addr" - }, - { "securityMethods": ["PSK"], "port": 5248, "ipv4Addr": "ipv4Addr" } - ] - }, - { - "securityMethods": ["PSK"], - "versions": [ - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - }, - { - "apiVersion": "apiVersion", - "resources": [ - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "resourceName": "resourceName", - "custOpName": "custOpName", - "uri": "uri", - "commType": "REQUEST_RESPONSE" - } - ], - "custOperations": [ - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - }, - { - "operations": ["GET"], - "description": "description", - "custOpName": "custOpName", - "commType": "REQUEST_RESPONSE" - } - ], - "expiry": "2000-01-23T04:56:07.000+00:00" - } - ], - "aefId": "aefId", - "interfaceDescriptions": [ - { - "securityMethods": ["PSK"], - "port": 5248, - "ipv4Addr": "ipv4Addr" - }, - { "securityMethods": ["PSK"], "port": 5248, "ipv4Addr": "ipv4Addr" } - ] - } - ], - "pubApiPath": { "ccfIds": ["ccfIds", "ccfIds"] } - } - ] -} diff --git a/docs/test_plan/api_invoker_management/invoker_getauth_example.json b/docs/test_plan/api_invoker_management/invoker_getauth_example.json deleted file mode 100644 index a66dad58adb1894b70b802193164301a429abdc1..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_invoker_management/invoker_getauth_example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "username": "ROBOT_TESTING_INVOKER", - "password": "password" -} diff --git a/docs/test_plan/api_invoker_management/invoker_register_body.json b/docs/test_plan/api_invoker_management/invoker_register_body.json deleted file mode 100644 index e5bf1fc5b89682c56416c62530a95a5a86037885..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_invoker_management/invoker_register_body.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "password": "password", - "username": "ROBOT_TESTING_INVOKER", - "role": "invoker", - "description": "Testing", - "cn": "ROBOT_TESTING_INVOKER" -} diff --git a/docs/test_plan/api_logging_service/README.md b/docs/test_plan/api_logging_service/README.md deleted file mode 100644 index 913a652ba779bc66dcae07c64502a5312bf3fdce..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_logging_service/README.md +++ /dev/null @@ -1,241 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Logging Service](#test-plan-for-capif-api-logging-service) -- [Tests](#tests) - - [Test Case 1: Creates a new individual CAPIF Log Entry.](#test-case-1-creates-a-new-individual-capif-log-entry) - - [Test Case 2: Creates a new individual CAPIF Log Entry with Invalid aefID](#test-case-2-creates-a-new-individual-capif-log-entry-with-invalid-aefid) - - [Test Case 3: Creates a new individual CAPIF Log Entry with Invalid serviceAPI](#test-case-3-creates-a-new-individual-capif-log-entry-with-invalid-serviceapi) - - [Test Case 4: Creates a new individual CAPIF Log Entry with Invalid apiInvokerId](#test-case-4-creates-a-new-individual-capif-log-entry-with-invalid-apiinvokerid) - - - [Test Case 5: Creates a new individual CAPIF Log Entry with differnted aef_id in body and request](#test-case-5-creates-a-new-individual-capif-log-entry-with-invalid-aefid-in-body) - - -# Test Plan for CAPIF Api Logging Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Creates a new individual CAPIF Log Entry. -* Test ID: ***capif_api_logging-1*** -* Description: - - This test case will check that a CAPIF AEF can create log entry to Logging Service -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid aefId from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding] and [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Log Entry: - 1. Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - 2. body [log entry request body] - 3. Use AEF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **201 Created** - 2. Response Body must follow **InvocationLog** data structure with: - * aefId - * apiInvokerId - * logs - 3. Response Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/api-invocation-logs/v1/{aefId}/logs/{logId}* - - - - -## Test Case 2: Creates a new individual CAPIF Log Entry with Invalid aefId -* Test ID: ***capif_api_logging-2*** -* Description: - - This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId -* Pre-Conditions: - - * CAPIF provider is not pre-authorised (has not valid aefId from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding] and [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Log Entry: - 1. Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{not-valid-aefId}/logs* - 2. body [log entry request body] - 3. Use AEF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Exposer not exist". - * cause with message "Exposer id not found". - -## Test Case 3: Creates a new individual CAPIF Log Entry with Invalid serviceAPI -* Test ID: ***capif_api_logging-3*** -* Description: - - This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has valid aefId from CAPIF Authority) - -* Information of Test: - - 1. Perform [provider onboarding] and [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Log Entry: - 1. Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - 2. body [log entry request body with serviceAPI apiName apiId not valid] - 3. Use AEF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Invoker not exist". - * cause with message "Invoker id not found". - - - -## Test Case 4: Creates a new individual CAPIF Log Entry with Invalid apiInvokerId -* Test ID: ***capif_api_logging-4*** -* Description: - - This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId -* Pre-Conditions: - - * CAPIF subscriber is pre-authorised (has valid aefId from CAPIF Authority) - -* Information of Test: - - 1. Perform [provider onboarding] and [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Log Entry: - 1. Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - 2. body [log entry request body with invokerId not valid] - 3. Use AEF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - -* Expected Result: - - 1. Response to Onboard request must accomplish: - 1. **201 Created** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure. - 3. For each **apiProvFuncs**, we must check: - 1. **apiProvFuncId** is set - 2. **apiProvCert** under **regInfo** is set properly - 5. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}* - - 2. Response to Logging Service must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Invoker not exist". - * cause with message "Invoker id not found". - - 3. Log Entry are not stored in CAPIF Database - - -## Test Case 5: Creates a new individual CAPIF Log Entry with Invalid aefId in body -* Test ID: ***capif_api_logging-5*** -* Description: - - This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId in body -* Pre-Conditions: - - * CAPIF provider is pre-authorised (has valid apfId from CAPIF Authority) - * Service exist in CAPIF - * Invoker exist in CAPIF - -* Information of Test: - - 1. Perform [provider onboarding] and [invoker onboarding] - - 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 - - Use APF Certificate - - 3. Log Entry: - 1. Send POST to *https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs* - 2. body [log entry request body with bad aefId] - 3. Use AEF Certificate - -* Execution Steps: - 1. Register Provider and Invoker CCF - 2. Publish Service - 3. Create Log Entry - -* Expected Result: - - 1. Response to Logging Service must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 401 - * title with message "Unauthorized" - * detail with message "AEF id not matching in request and body". - * cause with message "Not identical AEF id". - - - - - - -[log entry request body]: ./invocation_log.json "Log Request Body" - -[invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - -[provider onboarding]: ../common_operations/README.md#register-a-provider "Provider Onboarding" - -[Return To All Test Plans]: ../README.md diff --git a/docs/test_plan/api_logging_service/invocation_log.json b/docs/test_plan/api_logging_service/invocation_log.json deleted file mode 100644 index ceabcf02016e116566cd2b13c99a87a6adcef5d3..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_logging_service/invocation_log.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "aefId": "aefId", - "apiInvokerId": "apiInvokerId", - "logs": [ - { - "apiId": "apiId", - "apiName": "apiName", - "apiVersion": "string", - "resourceName": "string", - "uri": "string", - "protocol": "HTTP_1_1", - "operation": "GET", - "result": "string", - "invocationTime": "2023-03-30T10:30:21.404Z", - "invocationLatency": 0, - "inputParameters": "string", - "outputParameters": "string", - "srcInterface": { - "ipv4Addr": "string", - "ipv6Addr": "string", - "fqdn": "string", - "port": 65535, - "apiPrefix": "string", - "securityMethods": [ - "PSK", - "Oauth" - ] - }, - "destInterface": { - "ipv4Addr": "string", - "ipv6Addr": "string", - "fqdn": "string", - "port": 65535, - "apiPrefix": "string", - "securityMethods": [ - "PSK", - "string" - ] - }, - "fwdInterface": "string" - } - ], - "supportedFeatures": "string" - } - \ No newline at end of file diff --git a/docs/test_plan/api_provider_management/README.md b/docs/test_plan/api_provider_management/README.md deleted file mode 100644 index 547d654d69308c7dbbcc2b89f168df911e9e75dc..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_provider_management/README.md +++ /dev/null @@ -1,398 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Provider Management](#test-plan-for-capif-api-provider-management) -- [Tests](#tests) - - [Test Case 1: Register Api Provider](#test-case-1-register-api-provider) - - [Test Case 2: Register Api Provider Already registered](#test-case-2-register-api-provider-already-registered) - - [Test Case 3: Update Registered Api Provider](#test-case-3-update-registered-api-provider) - - [Test Case 4: Update Not Registered Api Provider](#test-case-4-update-not-registered-api-provider) - - [Test Case 5: Partially Update Registered Api Provider](#test-case-5-partially-update-registered-api-provider) - - [Test Case 6: Partially Update Not Registered Api Provider](#test-case-6-partially-update-not-registered-api-provider) - - [Test Case 7: Delete Registered Api Provider](#test-case-7-delete-registered-api-provider) - - [Test Case 8: Delete Not Registered Api Provider](#test-case-8-delete-not-registered-api-provider) - - -# Test Plan for CAPIF Api Provider Management -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Register Api Provider -* **Test ID**: ***capif_api_provider_management-1*** -* **Description**: - - This test case will check that Api Provider can be registered con CCF -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid certificate from CAPIF Authority) - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - -* **Execution Steps**: - - 1. Create private and public key for provider and each function to register. - 2. Register Provider. - -* **Expected Result**: - - 1. Register Provider at Provider Management: - 1. **201 Created** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure. - 3. For each **apiProvFuncs**, we must check: - 1. **apiProvFuncId** is set - 2. **apiProvCert** under **regInfo** is set properly - 5. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}* - -## Test Case 2: Register Api Provider Already registered -* **Test ID**: ***capif_api_provider_management-2*** -* **Description**: - - This test case will check that a Api Provider previously registered cannot be re-registered -* **Pre-Conditions**: - - * Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Re-Register Provider: - * Same regSec than Previous registration - -* **Execution Steps**: - - 1. Create private and public key for provider and each function to register. - 2. Register Provider. - 3. Re-Register Provider. - -* **Expected Result**: - - 1. Re-Register Provider: - 1. **403 Forbidden** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status 403 - * title with message "Forbidden" - * detail with message "Provider already registered". - * cause with message "Identical provider reg sec". - -## Test Case 3: Update Registered Api Provider -* **Test ID**: ***capif_api_provider_management-3*** -* **Description**: - - This test case will check that a Registered Api Provider can be updated -* **Pre-Conditions**: - - * Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Get Resource URL from Location - - 5. Update Provider: - * Send PUT to Resource URL returned at registration *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}* - * body [provider request body] with apiProvDomInfo set to ROBOT_TESTING_MOD - * Use AMF Certificate. - - -* **Execution Steps**: - - 1. Create private and public key for provider and each function to register. - 2. Register Provider - 3. Update Provider - -* **Expected Result**: - 1. Register Provider: - 1. **201 Created** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure. - 3. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}* - - - 2. Update Provider: - 1. **200 OK** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure, with: - * apiProvDomInfo set to ROBOT_TESTING_MOD - - -## Test Case 4: Update Not Registered Api Provider -* **Test ID**: ***capif_api_provider_management-4*** -* **Description**: - - This test case will check that a Non-Registered Api Provider cannot be updated -* **Pre-Conditions**: - - * Api Provider was not registered previously - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Update Not Registered Provider: - * Send PUT *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_PROVIDER_NOT_REGISTERED}* - * body [provider request body] - * Use AMF Certificate. - -* **Execution Steps**: - - 1. Register Provider at CCF - 3. Update Not Registered Provider - -* **Expected Result**: - - 1. Update Not Registered Provider: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status 404 - * title with message "Not Found" - * detail with message "Not Exist Provider Enrolment Details". - * cause with message "Not found registrations to send this api provider details". - -## Test Case 5: Partially Update Registered Api Provider -* **Test ID**: ***capif_api_provider_management-5*** -* **Description**: - - This test case will check that a Registered Api Provider can be partially updated -* **Pre-Conditions**: - - * Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Partial update provider: - * Send PATCH *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}* - * body [provider request patch body] - * Use AMF Certificate. - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Register Provider - 3. Partial update provider - -* **Expected Result**: - - 1. Partial update provider at Provider Management: - 1. **200 OK** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure, with: - * apiProvDomInfo with "ROBOT_TESTING_MOD" - -## Test Case 6: Partially Update Not Registered Api Provider -* **Test ID**: ***capif_api_provider_management-6*** -* **Description**: - - This test case will check that a Non-Registered Api Provider cannot be partially updated - -* **Pre-Conditions**: - - * Api Provider was not registered previously - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Partial update Provider: - * Send PATCH *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_API_PROVIDER_NOT_REGISTERED}* - * body [provider request patch body] - * Use AMF Certificate. - - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Register Provider - 3. Partial update provider - -* **Expected Result**: - - 1. Partial update provider: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status 404 - * title with message "Not Found" - * detail with message "Not Exist Provider Enrolment Details". - * cause with message "Not found registrations to send this api provider details". - -## Test Case 7: Delete Registered Api Provider -* **Test ID**: ***capif_api_provider_management-7*** -* **Description**: - - This test case will check that a Registered Api Provider can be deleted -* **Pre-Conditions**: - - * Api Provider was registered previously - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Delete registered provider: - * Send DELETE *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}* - * Use AMF Certificate. - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Register Provider - 3. Delete Provider - -* **Expected Result**: - - 1. Delete Provider: - 1. **204 No Content** response. - -## Test Case 8: Delete Not Registered Api Provider -* **Test ID**: ***capif_api_provider_management-8*** -* **Description**: - - This test case will check that a Non-Registered Api Provider cannot be deleted -* **Pre-Conditions**: - - * Api Provider was not registered previously - -* **Information of Test**: - - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Authentication Bearer with access_token - * Store each cert in a file with according name. - - 5. Delete registered provider at Provider Management: - * Send DELETE *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_PROVIDER_NOT_REGISTERED}* - * Use AMF Certificate. - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Delete Provider - -* **Expected Result**: - - 1. Delete Provider: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status 404 - * title with message "Not Found" - * detail with message "Not Exist Provider Enrolment Details". - * cause with message "Not found registrations to send this api provider details". - -[provider register body]: ./provider_details_post_example.json "API Provider Enrolment Request" - -[provider request body]: ./provider_details_post_example.json "API Provider Enrolment Request" - -[provider request patch body]: ./provider_details_enrolment_details_patch_example.json "API Provider Enrolment Patch Request" - -[provider getauth body]: ./provider_getauth_example.json "Get Auth Example" - -[Return To All Test Plans]: ../README.md diff --git a/docs/test_plan/api_provider_management/provider_details_enrolment_details_patch_example.json b/docs/test_plan/api_provider_management/provider_details_enrolment_details_patch_example.json deleted file mode 100644 index 4dac4f409eccfc7201c4eaf615b55f70c38b54e4..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_provider_management/provider_details_enrolment_details_patch_example.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "regSec": "", - "apiProvFuncs": [ - { - "regInfo": { - "apiProvPubKey": "" - }, - "apiProvFuncRole": "APF", - "apiProvFuncInfo": "APF_ROBOT_TESTING_PROVIDER" - }, - { - "regInfo": { - "apiProvPubKey": "" - }, - "apiProvFuncRole": "AEF", - "apiProvFuncInfo": "AEF_ROBOT_TESTING_PROVIDER" - }, - { - "regInfo": { - "apiProvPubKey": "" - }, - "apiProvFuncRole": "AMF", - "apiProvFuncInfo": "AMF_ROBOT_TESTING_PROVIDER" - } - ], - "apiProvDomInfo": "ROBOT_TESTING", - "suppFeat": "string", - "failReason": "string" -} \ No newline at end of file diff --git a/docs/test_plan/api_provider_management/provider_details_post_example.json b/docs/test_plan/api_provider_management/provider_details_post_example.json deleted file mode 100644 index 48e91bacf24899e55221babf610598b9d4132b61..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_provider_management/provider_details_post_example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "regSec": "string", - "apiProvFuncs": [ - { - "apiProvFuncId": "string", - "regInfo": { - "apiProvPubKey": "string", - "apiProvCert": "string" - }, - "apiProvFuncRole": "AEF", - "apiProvFuncInfo": "string" - } - ], - "apiProvDomInfo": "string", - "suppFeat": "string", - "failReason": "string" -} \ No newline at end of file diff --git a/docs/test_plan/api_provider_management/provider_getauth_example.json b/docs/test_plan/api_provider_management/provider_getauth_example.json deleted file mode 100644 index 8fc82aeebfc9531651fa746bf10be11c6aa347f3..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_provider_management/provider_getauth_example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "username": "ROBOT_TESTING_PROVIDER", - "password": "password" -} diff --git a/docs/test_plan/api_provider_management/provider_register_body.json b/docs/test_plan/api_provider_management/provider_register_body.json deleted file mode 100644 index fc26db2141eab904b1f2f8d96e963f2ec0efcbe1..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_provider_management/provider_register_body.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "password": "password", - "username": "ROBOT_TESTING_PUBLISHER", - "role": "provider", - "description": "Testing", - "cn": "ROBOT_TESTING_PUBLISHER" -} diff --git a/docs/test_plan/api_publish_service/README.md b/docs/test_plan/api_publish_service/README.md deleted file mode 100644 index 8487f5d5cc582ab65c393c5e437267e51b23a089..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_publish_service/README.md +++ /dev/null @@ -1,599 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Publish Service](#test-plan-for-capif-api-publish-service) -- [Tests](#tests) - - [Test Case 1: Publish API by Authorised API Publisher](#test-case-1-publish-api-by-authorised-api-publisher) - - [Test Case 2: Publish API by NON Authorised API Publisher](#test-case-2-publish-api-by-non-authorised-api-publisher) - - [Test Case 3: Retrieve all APIs Published by Authorised apfId](#test-case-3-retrieve-all-apis-published-by-authorised-apfid) - - [Test Case 4: Retrieve all APIs Published by NON Authorised apfId](#test-case-4-retrieve-all-apis-published-by-non-authorised-apfid) - - [Test Case 5: Retrieve single APIs Published by Authorised apfId](#test-case-5-retrieve-single-apis-published-by-authorised-apfid) - - [Test Case 6: Retrieve single APIs non Published by Authorised apfId](#test-case-6-retrieve-single-apis-non-published-by-authorised-apfid) - - [Test Case 7: Retrieve single APIs Published by NON Authorised apfId](#test-case-7-retrieve-single-apis-published-by-non-authorised-apfid) - - [Test Case 8: Update API Published by Authorised apfId with valid serviceApiId](#test-case-8-update-api-published-by-authorised-apfid-with-valid-serviceapiid) - - [Test Case 9: Update APIs Published by Authorised apfId with invalid serviceApiId](#test-case-9-update-apis-published-by-authorised-apfid-with-invalid-serviceapiid) - - [Test Case 10: Update APIs Published by NON Authorised apfId](#test-case-10-update-apis-published-by-non-authorised-apfid) - - [Test Case 11: Delete API Published by Authorised apfId with valid serviceApiId](#test-case-11-delete-api-published-by-authorised-apfid-with-valid-serviceapiid) - - [Test Case 12: Delete APIs Published by Authorised apfId with invalid serviceApiId](#test-case-12-delete-apis-published-by-authorised-apfid-with-invalid-serviceapiid) - - [Test Case 13: Delete APIs Published by NON Authorised apfId](#test-case-13-delete-apis-published-by-non-authorised-apfid) - - -# Test Plan for CAPIF Api Publish Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Publish API by Authorised API Publisher -* **Test ID**: ***capif_api_publish_service-1*** -* **Description**: - - This test case will check that an API Publisher can Publish an API -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - -* **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 - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API - 3. Retrieve {apiId} from body and Location header with new resource created from response - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 2. Published Service API is stored in CAPIF Database - -## Test Case 2: Publish API by NON Authorised API Publisher -* **Test ID**: ***capif_api_publish_service-2*** -* **Description**: - - This test case will check that an API Publisher cannot Publish an API withot valid apfId -* **Pre-Conditions**: - - * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority) - -* **Information of Test**: - 1. Perform [Provider Registration] - - 2. Publish Service API with invalid APF ID at CCF: - * Send Post to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{APF_ID_NOT_VALID}/service-apis* - * body [service api description] with apiName service_1 - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API with invalid APF ID - -* **Expected Result**: - 1. Response to Publish request must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **401** - * title with message "Unauthorized" - * detail with message "Publisher not existing". - * cause with message "Publisher id not found". - - 2. Service API is NOT stored in CAPIF Database - - -## Test Case 3: Retrieve all APIs Published by Authorised apfId -* **Test ID**: ***capif_api_publish_service-3*** -* **Description**: - - This test case will check that an API Publisher can Retrieve all API published -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - * At least 2 service APIs are published. - -* **Information of Test**: - 1. Perform [Provider Registration] - - 2. Publish Service API at CCF: - * Send Post to *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis* - * body [service api description] with apiName service_1 - * Get apiId - * Use APF Certificate - - 3. Publish Other 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 - * Get apiId - * Use APF Certificate - - 4. Retrieve all published APIs: - * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API service_1 - 3. Retrieve {apiId1} from body and Location header with new resource created from response - 4. Publish Service API service_2 - 5. Retrieve {apiId2} from body and Location header with new resource created from response - 6. Retrieve All published APIs and check if both are present. - -* **Expected Result**: - 1. Response to service 1 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/{apfId}/service-apis/{serviceApiId1}* - - 2. Response to service 2 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/{apfId}/service-apis/{serviceApiId2}* - - 3. Published Service APIs are stored in CAPIF Database - - 4. Response to Retrieve all published APIs: - 1. **200 OK** - 2. Response body must return an array of **ServiceAPIDescription** data. - 3. Array must contain all previously published APIs. - -## Test Case 4: Retrieve all APIs Published by NON Authorised apfId -* **Test ID**: ***capif_api_publish_service-4*** -* **Description**: - - This test case will check that an API Publisher cannot Retrieve API published when apfId is not authorised -* **Pre-Conditions**: - - * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority) - -* **Information of Test**: - 1. Perform [Provider Registration] - - 2. Retrieve all published APIs: - * Send Get to *https://{CAPIF_HOSTNAME}/published-apis/v1/{APF_ID_NOT_VALID}/service-apis* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Retrieve All published APIs - -* **Expected Result**: - 1. Response to Publish request must accomplish: - 1. **401 Non Authorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **401** - * title with message "Unauthorized" - * detail with message "Provider not existing". - * cause with message "Provider id not found". - - 2. Service API is NOT stored in CAPIF Database - -## Test Case 5: Retrieve single APIs Published by Authorised apfId -* **Test ID**: ***capif_api_publish_service-5*** -* **Description**: - - This test case will check that an API Publisher can Retrieve API published one by one -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - * At least 2 service APIs are published. - -* **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 - * Get apiId - * Use APF Certificate - - 3. Publish Other 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 - * Get apiId - * Use APF Certificate - - 4. Retrieve service_1 published APIs detail: - * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{apiId1}* - * Use APF Certificate - - 5. Retrieve service_2 published APIs detail: - * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{apiId2}* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API service_1. - 3. Retrieve {apiId1} from body and Location header with new resource created from response. - 4. Publish Service API service_2. - 5. Retrieve {apiId2} from body and Location header with new resource created from response. - 6. Retrieve service_1 API Detail. - 7. Retrieve service_2 API Detail. - -* **Expected Result**: - 1. Response to service 1 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/{apfId}/service-apis/{serviceApiId1}* - - 2. Response to service 2 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/{apfId}/service-apis/{serviceApiId2}* - - 3. Published Service APIs are stored in CAPIF Database - - 4. Response to Retrieve service_1 published API using apiId1: - 1. **200 OK** - 2. Response body must return a **ServiceAPIDescription** data. - 3. Array must contain same information than service_1 published registration response. - - 5. Response to Retrieve service_2 published API using apiId2: - 1. **200 OK** - 2. Response body must return a **ServiceAPIDescription** data. - 3. Array must contain same information than service_2 published registration response. - - -## Test Case 6: Retrieve single APIs non Published by Authorised apfId -* **Test ID**: ***capif_api_publish_service-6*** -* **Description**: - - This test case will check that an API Publisher try to get detail of not published api. -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - * No published api - -* **Information of Test**: - 1. Perform [Provider Registration] - 2. Retrieve not published APIs detail: - * Send Get to ccf_publish_url *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Retrieve not published API Detail. - -* **Expected Result**: - 1. Response to Retrieve for NOT published API must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **404** - * title with message "Not Found" - * detail with message "Service API not found". - * cause with message "No Service with specific credentials exists". - - -## Test Case 7: Retrieve single APIs Published by NON Authorised apfId -* **Test ID**: ***capif_api_publish_service-7*** -* **Description**: - - This test case will check that an API Publisher cannot Retrieve detailed API published when apfId is not authorised -* **Pre-Conditions**: - - * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority) - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Get apiId - * Use APF Certificate - - 3. Retrieve detailed published APIs: - * Send Get to *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/${apiId}* - * Use Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API at CCF - 3. Retrieve {apiId} from body and Location header with new resource created from response. - 4. Register and onboard Invoker at CCF - 5. Store signed Invoker Certificate - 6. Retrieve detailed published API acting as Invoker - -* **Expected Result**: - 1. Response to Retrieve Detailed published API acting as Invoker must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **401** - * title with message "Unauthorized" - * detail with message "User not authorized". - * cause with message "Certificate not authorized". - - 2. Service API is NOT stored in CAPIF Database - - -## Test Case 8: Update API Published by Authorised apfId with valid serviceApiId -* **Test ID**: ***capif_api_publish_service-8*** -* **Description**: - - This test case will check that an API Publisher can Update published API with a valid serviceApiId -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - * A service APIs is published. - -* **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 - * Get apiId - * get resource url from location Header. - * Use APF Certificate - - 3. 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 - - 4. Retrieve detail of service API: - * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}* - * check apiName is service_1_modified - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API - 3. Retrieve {apiId} from body and Location header with new resource url created from response - 4. Update published Service API. - 5. Retrieve detail of Service API - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 2. Response to Update Published Service API: - 1. **200 OK** - 2. Response Body must follow **ServiceAPIDescription** data structure with: - * apiName service_1_modified - - 3. Response to Retrieve detail of Service API: - 1. **200 OK** - 2. Response Body must follow **ServiceAPIDescription** data structure with: - * apiName service_1_modified. - - -## Test Case 9: Update APIs Published by Authorised apfId with invalid serviceApiId -* **Test ID**: ***capif_api_publish_service-9*** -* **Description**: - - This test case will check that an API Publisher cannot Update published API with a invalid serviceApiId -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority) - -* **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 - * Get apiId - * Use APF Certificate - - 3. Update published API at CCF: - * Send PUT to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}* - * body [service api description] with overrided apiName to ***service_1_modified*** - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Update published Service API. - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 2. Response to Update Published Service API: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **404** - * title with message "Not Found" - * detail with message "Service API not found". - * cause with message "Service API id not found". - - ## Test Case 10: Update APIs Published by NON Authorised apfId -* **Test ID**: ***capif_api_publish_service-10*** -* **Description**: - - This test case will check that an API Publisher cannot Update API published when apfId is not authorised -* **Pre-Conditions**: - - * CAPIF subscriber is NOT pre-authorised (has invalid apfId from CAPIF Authority) - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Get apiId - * Use APF Certificate - - 3. Update published API at CCF: - * Send PUT to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serviceApiId}* - * body [service api description] with overrided apiName to ***service_1_modified*** - * Use invoker certificate - - 4. Retrieve detail of service API: - * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}* - * check apiName is service_1 - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API at CCF - 3. Retrieve {apiId} from body and Location header with new resource created from response. - 4. Register and onboard Invoker at CCF - 5. Store signed Invoker Certificate - 6. Update published API at CCF as Invoker - 7. Retrieve detail of Service API as publisher - -* **Expected Result**: - 1. Response to Update published API acting as Invoker must accomplish: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **401** - * title with message "Unauthorized" - * detail with message "User not authorized". - * cause with message "Certificate not authorized". - - 2. Response to Retrieve Detail of Service API: - 1. **200 OK** - 2. Response Body must follow **ServiceAPIDescription** data structure with: - * apiName service_1. - - -## Test Case 11: Delete API Published by Authorised apfId with valid serviceApiId -* **Test ID**: ***capif_api_publish_service-11*** -* **Description**: - - This test case will check that an API Publisher can Delete published API with a valid serviceApiId -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority). - * A service APIs is published. - -* **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 - * Get apiId - * Use APF Certificate - - 3. Remove published Service API at CCF: - * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serviceApiId}* - * Use APF Certificate - 4. Retrieve detail of service API: - * Send Get to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Publish Service API - 3. Retrieve {apiId} from body and Location header with new resource created from response - 4. Remove published API at CCF - 5. Try to retreive deleted service API from CCF - -* **Expected Result**: - 1. 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/{apfId}/service-apis/{serviceApiId}* - - 2. Published Service API is stored in CAPIF Database - - 3. Response to Remove published Service API at CCF: - 1. **204 No Content** - - 4. Response to Retrieve for DELETED published API must accomplish: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Service API not found". - * cause with message "No Service with specific credentials exists". - - -## Test Case 12: Delete APIs Published by Authorised apfId with invalid serviceApiId -* **Test ID**: ***capif_api_publish_service-12*** -* **Description**: - - This test case will check that an API Publisher cannot Delete with invalid serviceApiId -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority). - -* **Information of Test**: - 1. Perform [Provider Registration] - - 2. Remove published Service API at CCF with invalid serviceId: - * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}* - * Use APF Certificate - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Remove published API at CCF with invalid serviceId - -* **Expected Result**: - 1. Response to Remove published Service API at CCF: - 1. **404 Not Found** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status 404 - * title with message "Not Found" - * detail with message "Service API not found". - * cause with message "Service API id not found". - - -## Test Case 13: Delete APIs Published by NON Authorised apfId -* **Test ID**: ***capif_api_publish_service-12*** -* **Description**: - - This test case will check that an API Publisher cannot Delete API published when apfId is not authorised -* **Pre-Conditions**: - - * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority). - -* **Information of Test**: - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Get apiId - * Use APF Certificate - - 3. Remove published Service API at CCF with invalid serviceId as Invoker: - * Send DELETE to resource URL *https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID_NOT_VALID}* - * Use invoker certificate. - -* **Execution Steps**: - 1. Register Provider at CCF and store certificates. - 2. Register Invoker and onboard Invoker at CCF - 3. Remove published API at CCF with invalid serviceId as Invoker - -* **Expected Result**: - 1. Response to Remove published Service API at CCF: - 1. **401 Unauthorized** - 2. Error Response Body must accomplish with **ProblemDetails** data structure with: - * status **401** - * title with message "Unauthorized" - * detail with message "User not authorized". - * cause with message "Certificate not authorized". - - - [service api description]: ./service_api_description_post_example.json "Service API Description Request" - [publisher register body]: ./publisher_register_body.json "Publish register Body" - [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" - [invoker register body]: ../api_invoker_management/invoker_register_body.json "Invoker Register Body" - [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" - [provider getauth body]: ../api_provider_management/provider_getauth_example.json "Get Auth Example" - - [invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" - - - [Return To All Test Plans]: ../README.md \ No newline at end of file diff --git a/docs/test_plan/api_publish_service/publisher_register_body.json b/docs/test_plan/api_publish_service/publisher_register_body.json deleted file mode 100644 index fc26db2141eab904b1f2f8d96e963f2ec0efcbe1..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_publish_service/publisher_register_body.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "password": "password", - "username": "ROBOT_TESTING_PUBLISHER", - "role": "provider", - "description": "Testing", - "cn": "ROBOT_TESTING_PUBLISHER" -} diff --git a/docs/test_plan/api_publish_service/service_api_description_post_example.json b/docs/test_plan/api_publish_service/service_api_description_post_example.json deleted file mode 100644 index b725b428629509bf39a79c030f1bf93f4b6f18f6..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_publish_service/service_api_description_post_example.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "apiName": "service_1", - "aefProfiles": [ - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - }, - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -} \ No newline at end of file diff --git a/docs/test_plan/api_security_service/README.md b/docs/test_plan/api_security_service/README.md deleted file mode 100644 index c0d3e71b06da6e40e9fdaeff50064ad230b76c57..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_security_service/README.md +++ /dev/null @@ -1,1244 +0,0 @@ -[**[Return To All Test Plans]**] - -- [Test Plan for CAPIF Api Security Service](#test-plan-for-capif-api-security-service) -- [Tests](#tests) - - [Test Case 1: Create a security context for an API invoker](#test-case-1-create-a-security-context-for-an-api-invoker) - - [Test Case 2: Create a security context for an API invoker with Provider role](#test-case-2-create-a-security-context-for-an-api-invoker-with-provider-role) - - [Test Case 3: Create a security context for an API invoker with Provider entity role and invalid apiInvokerId](#test-case-3-create-a-security-context-for-an-api-invoker-with-provider-entity-role-and-invalid-apiinvokerid) - - [Test Case 4: Create a security context for an API invoker with Invoker entity role and invalid apiInvokerId](#test-case-4-create-a-security-context-for-an-api-invoker-with-invoker-entity-role-and-invalid-apiinvokerid) - - [Test Case 5: Retrieve the Security Context of an API Invoker](#test-case-5-retrieve-the-security-context-of-an-api-invoker) - - [Test Case 6: Retrieve the Security Context of an API Invoker with invalid apiInvokerID](#test-case-6-retrieve-the-security-context-of-an-api-invoker-with-invalid-apiinvokerid) - - [Test Case 7: Retrieve the Security Context of an API Invoker with invalid apfId](#test-case-7-retrieve-the-security-context-of-an-api-invoker-with-invalid-apfid) - - [Test Case 8: Delete the Security Context of an API Invoker](#test-case-8-delete-the-security-context-of-an-api-invoker) - - [Test Case 9: Delete the Security Context of an API Invoker with Invoker entity role](#test-case-9-delete-the-security-context-of-an-api-invoker-with-invoker-entity-role) - - [Test Case 10: Delete the Security Context of an API Invoker with Invoker entity role and invalid apiInvokerID](#test-case-10-delete-the-security-context-of-an-api-invoker-with-invoker-entity-role-and-invalid-apiinvokerid) - - [Test Case 11: Delete the Security Context of an API Invoker with invalid apiInvokerID](#test-case-11-delete-the-security-context-of-an-api-invoker-with-invalid-apiinvokerid) - - [Test Case 12: Update the Security Context of an API Invoker](#test-case-12-update-the-security-context-of-an-api-invoker) - - [Test Case 13: Update the Security Context of an API Invoker with Provider entity role](#test-case-13-update-the-security-context-of-an-api-invoker-with-provider-entity-role) - - [Test Case 14: Update the Security Context of an API Invoker with AEF entity role and invalid apiInvokerId](#test-case-14-update-the-security-context-of-an-api-invoker-with-aef-entity-role-and-invalid-apiinvokerid) - - [Test Case 15: Update the Security Context of an API Invoker with invalid apiInvokerID](#test-case-15-update-the-security-context-of-an-api-invoker-with-invalid-apiinvokerid) - - [Test Case 16: Revoke the authorization of the API invoker for APIs.](#test-case-16-revoke-the-authorization-of-the-api-invoker-for-apis) - - [Test Case 17: Revoke the authorization of the API invoker for APIs without valid apfID.](#test-case-17-revoke-the-authorization-of-the-api-invoker-for-apis-without-valid-apfid) - - [Test Case 18: Revoke the authorization of the API invoker for APIs with invalid apiInvokerId.](#test-case-18-revoke-the-authorization-of-the-api-invoker-for-apis-with-invalid-apiinvokerid) - - [Test Case 19: Retrieve access token](#test-case-19-retrieve-access-token) - - [Test Case 20: Retrieve access token by Provider](#test-case-20-retrieve-access-token-by-provider) - - [Test Case 21: Retrieve access token by Provider with invalid apiInvokerId](#test-case-21-retrieve-access-token-by-provider-with-invalid-apiinvokerid) - - [Test Case 22: Retrieve access token with invalid apiInvokerId](#test-case-22-retrieve-access-token-with-invalid-apiinvokerid) - - [Test Case 23: Retrieve access token with invalid client\_id](#test-case-23-retrieve-access-token-with-invalid-client_id) - - [Test Case 24: Retrieve access token with unsupported grant\_type](#test-case-24-retrieve-access-token-with-unsupported-grant_type) - - [Test Case 25: Retrieve access token with invalid scope](#test-case-25-retrieve-access-token-with-invalid-scope) - - [Test Case 26: Retrieve access token with invalid aefid at scope](#test-case-26-retrieve-access-token-with-invalid-aefid-at-scope) - - [Test Case 27: Retrieve access token with invalid apiName at scope](#test-case-27-retrieve-access-token-with-invalid-apiname-at-scope) - - - -# Test Plan for CAPIF Api Security Service -At this documentation you will have all information and related files and examples of test plan for this API. - -# Tests - -## Test Case 1: Create a security context for an API invoker -* **Test ID**: ***capif_security_api-1*** -* **Description**: - - This test case will check that an API Invoker can create a Security context -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) - -* **Information of Test**: - 1. Perform [Invoker Onboarding] - 2. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Use Invoker Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Store signed Certificate - 3. Create Security Context - -* **Expected Result**: - - 1. 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}* - - -## Test Case 2: Create a security context for an API invoker with Provider role -* **Test ID**: ***capif_security_api-2*** -* **Description**: - - This test case will check that an Provider cannot create a Security context with valid apiInvokerId. -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID), but user that create Security Context with Provider role - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker but using Provider certificate. - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using AEF certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context using Provider certificate - -* **Expected Result**: - - 1. Create security context using Provider certificate: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be invoker". - - 2. No context stored at DB - -## Test Case 3: Create a security context for an API invoker with Provider entity role and invalid apiInvokerId -* **Test ID**: ***capif_security_api-3*** -* **Description**: - - This test case will check that an Provider cannot create a Security context with invalid apiInvokerID. -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID), but user that create Security Context with Provider role - -* **Information of Test**: - - 1. Perform [Provider Registration] - - 2. Create Security Context for this not valid apiInvokerId and using Provider certificate. - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}* - * body [service security body] - * Using AEF certificate - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Create Security Context using Provider certificate - -* **Expected Result**: - - 1. Create security context using Provider certificate: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be invoker". - 2. No context stored at DB - -## Test Case 4: Create a security context for an API invoker with Invoker entity role and invalid apiInvokerId -* **Test ID**: ***capif_security_api-4*** -* **Description**: - - This test case will check that an Invoker cannot create a Security context with valid apiInvokerId. -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID), but user that create Security Context with invalid apiInvokerId - -* **Information of Test**: - 1. Perform [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}* - * body [service security body] - * Use Invoker Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Create Security Context using Provider certificate - -* **Expected Result**: - - 1. Create security context using Provider certificate: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Invoker not found". - * cause with message "API Invoker not exists or invalid ID". - - 2. No context stored at DB - - -## Test Case 5: Retrieve the Security Context of an API Invoker -* **Test ID**: ***capif_security_api-5*** -* **Description**: - - This test case will check that an provider can retrieve the Security context of an API Invoker -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid apfId from CAPIF Authority) and API Invoker has created a valid Security Context - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker. - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker certificate - - 3. Retrieve Security Context of Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using AEF Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context using Provider certificate - 4. Retrieve Security Context by Provider - -* **Expected Result**: - 1. Retrieve security context: - 1. **200 OK** response. - 2. body returned must accomplish **ServiceSecurity** data structure. - - -## Test Case 6: Retrieve the Security Context of an API Invoker with invalid apiInvokerID -* **Test ID**: ***capif_security_api-6*** -* **Description**: - - This test case will check that an provider can retrieve the Security context of an API Invoker -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid apfId from CAPIF Authority) and API Invoker has created a valid Security Context - -* **Information of Test**: - - 1. Perform [Provider Registration] - - 2. Retrieve Security Context of invalid Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}* - * Using AEF Certificate. - -* **Execution Steps**: - - 2. Register Provider at CCF - 3. Create Security Context using Provider certificate - 4. Retrieve Security Context by Provider of invalid invoker - -* **Expected Result**: - 1. Retrieve security context: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Invoker not found". - * cause with message "API Invoker not exists or invalid ID". - - -## Test Case 7: Retrieve the Security Context of an API Invoker with invalid apfId -* **Test ID**: ***capif_security_api-7*** -* **Description**: - - This test case will check that an Provider cannot retrieve the Security context of an API Invoker without valid apfId -* **Pre-Conditions**: - - * API Exposure Function is not pre-authorised (has invalid apfId) - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate - - 3. Retrieve Security Context as Invoker role: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using Invoker Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Store signed Certificate - 3. Create Security Context - 4. Retrieve Security Context as Provider. - -* **Expected Result**: - - 1. Create security context: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be aef". - - -## Test Case 8: Delete the Security Context of an API Invoker -* **Test ID**: ***capif_security_api-8*** -* **Description**: - - This test case will check that an Provider can delete a Security context -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid apfId from CAPIF Authority) and API Invoker has created a valid Security Context - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker but using Provider certificate. - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using AEF certificate - - 3. Delete Security Context of Invoker by Provider: - * Send DELETE *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Use AEF certificate - - 4. Retrieve Security Context of Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using AEF Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context using Provider certificate - 4. Delete Security Context by Provider - -* **Expected Result**: - - 1. Delete security context: - 1. **204 No Content** response. - - 2. Retrieve security context: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Security context not found". - * cause with message "API Invoker not exists or invalid ID". - - -## Test Case 9: Delete the Security Context of an API Invoker with Invoker entity role -* **Test ID**: ***capif_security_api-9*** -* **Description**: - - This test case will check that an Invoker cannot delete a Security context -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid apfId from CAPIF Authority) and API Invoker has created a valid Security Context - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker certificate - - 3. Delete Security Context of Invoker: - * Send DELETE *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Use Invoker certificate - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Create Security Context using Provider certificate - 3. Delete Security Context by Invoker - -* **Expected Result**: - - 1. Delete security context: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be aef". - - -## Test Case 10: Delete the Security Context of an API Invoker with Invoker entity role and invalid apiInvokerID -* **Test ID**: ***capif_security_api-10*** -* **Description**: - - This test case will check that an Invoker cannot delete a Security context with invalid -* **Pre-Conditions**: - - * Invoker is pre-authorised. - -* **Information of Test**: - - 1. Perform [Invoker Onboarding] - - 2. Delete Security Context of Invoker: - * Send DELETE *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}* - * Use Invoker certificate - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Delete Security Context by invoker - -* **Expected Result**: - - 1. Delete security context: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be aef". - - -## Test Case 11: Delete the Security Context of an API Invoker with invalid apiInvokerID -* **Test ID**: ***capif_security_api-11*** -* **Description**: - - This test case will check that an Provider cannot delete a Security context of invalid apiInvokerId -* **Pre-Conditions**: - - * Provider is pre-authorised (has valid apfId from CAPIF Authority). - -* **Information of Test**: - - 1. Perform [Provider Registration] - - 2. Delete Security Context of Invoker by Provider: - * Send DELETE *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}* - * Use AEF certificate - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Delete Security Context by provider - -* **Expected Result**: - - 1. Retrieve security context: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Invoker not found". - * cause with message "API Invoker not exists or invalid ID". - - -## Test Case 12: Update the Security Context of an API Invoker -* **Test ID**: ***capif_security_api-12*** -* **Description**: - - This test case will check that an API Invoker can update a Security context -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - - 3. Update Security Context of Invoker: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/update* - * body [service security body] but with notification destination modified to http://robot.testing2 - * Using Invoker Certificate. - - 4. Retrieve Security Context of Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using AEF Certificate. - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context By Invoker - 4. Update Security Context By Invoker - 5. Retrieve Security Context By Provider - -* **Expected Result**: - - 1. Update security context: - 1. **200 OK** response. - 2. body returned must accomplish **ServiceSecurity** data structure. - - 2. Retrieve security context: - 1. **200 OK** response. - 2. body returned must accomplish **ServiceSecurity** data structure. - 1. Check is this returned object match with modified one. - - -## Test Case 13: Update the Security Context of an API Invoker with Provider entity role -* **Test ID**: ***capif_security_api-13*** -* **Description**: - - This test case will check that an Provider cannot update a Security context - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized. - * Invoker has created the Security Context previously. - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - - 3. Update Security Context of Invoker by Provider: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/update* - * body [service security body] but with notification destination modified to http://robot.testing2 - * Using AEF Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context - 4. Update Security Context as Provider - -* **Expected Result**: - - 1. Update security context: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be invoker". - - -## Test Case 14: Update the Security Context of an API Invoker with AEF entity role and invalid apiInvokerId -* **Test ID**: ***capif_security_api-14*** -* **Description**: - - This test case will check that an Provider cannot update a Security context of invalid apiInvokerId - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized. - * Invoker has created the Security Context previously. - -* **Information of Test**: - - 1. Perform [Provider Registration] - - 4. Update Security Context of Invoker by Provider: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}/update* - * body [service security body] - * Using AEF Certificate - -* **Execution Steps**: - - 1. Register Provider at CCF - 2. Update Security Context as Provider - -* **Expected Result**: - - 1. Update security context: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be invoker". - - -## Test Case 15: Update the Security Context of an API Invoker with invalid apiInvokerID -* **Test ID**: ***capif_security_api-15*** -* **Description**: - - This test case will check that an API Invoker cannot update a Security context not valid apiInvokerId -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Update Security Context of Invoker: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}/update* - * body [service security body] - * Using Invoker Certificate. - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Update Security Context - -* **Expected Result**: - -1. Retrieve security context: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Invoker not found". - * cause with message "API Invoker not exists or invalid ID". - - -## Test Case 16: Revoke the authorization of the API invoker for APIs. -* **Test ID**: ***capif_security_api-16*** -* **Description**: - - This test case will check that a Provider can revoke the authorization for APIs - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context By Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate - - 3. Revoke Authorization by Provider: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/delete* - * body [security notification body] - * Using AEF Certificate. - - 4. Retrieve Security Context by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using AEF Certificate. - - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context by Invoker - 4. Revoke Security Context by Provider - 5. Retrieve Security Context by Provider - -* **Expected Result**: - - 1. Revoke Authorization: - 1. **204 No Content** response. - - 2. Retrieve security context: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Security context not found". - * cause with message "API Invoker has no security context". - - -## Test Case 17: Revoke the authorization of the API invoker for APIs without valid apfID. -* **Test ID**: ***capif_security_api-17*** -* **Description**: - - This test case will check that an Invoker can't revoke the authorization for APIs - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - - 3. Revoke Authorization by invoker: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/delete* - * body [security notification body] - * Using Invoker Certificate - - 4. Retrieve Security Context of Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * Using Provider Certificate - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context - 4. Revoke Security Context by invoker - 5. Retrieve Security Context - -* **Expected Result**: - - 1. Revoke Security Context by invoker: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **401** - * title with message "Unauthorized" - * detail with message "Role not authorized for this API route". - * cause with message "User role must be provider". - - 3. Retrieve security context: - 1. **200 OK** response. - 2. body returned must accomplish **ServiceSecurity** data structure. - 1. Check is this returned object match with created one. - - -## Test Case 18: Revoke the authorization of the API invoker for APIs with invalid apiInvokerId. -* **Test ID**: ***capif_security_api-18*** -* **Description**: - - This test case will check that an API Exposure Function cannot revoke the authorization for APIs for invalid apiInvokerId - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 2. Create Security Context for this Invoker: - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - - 3. Revoke Authorization by Provider: - * Send POST *https://{CAPIF_HOSTNAME}/trustedInvokers/{API_INVOKER_NOT_VALID}/delete* - * body [security notification body] - * Using AEF Certificate. - - 4. Retrieve Security Context of Invoker by Provider: - * Send GET *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}?authenticationInfo=true&authorizationInfo=true* - * This request will ask with parameter to retrieve authenticationInfo and authorizationInfo - * Using AEF Certificate. - -* **Execution Steps**: - - 1. Register and onboard Invoker at CCF - 2. Register Provider at CCF - 3. Create Security Context - 4. Revoke Security Context by Provider - 5. Retrieve Security Context - -* **Expected Result**: - - 1. Revoke Security Context by invoker: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails** data structure, with: - * status **404** - * title with message "Not Found" - * detail with message "Invoker not found". - * cause with message "API Invoker not exists or invalid ID". - - 3. Retrieve security context: - 1. **200 OK** response. - 2. body returned must accomplish **ServiceSecurity** data structure. - 1. Check is this return one object that match with created one. - - -## Test Case 19: Retrieve access token -* **Test ID**: ***capif_security_api-19*** -* **Description**: - - This test case will check that an API Invoker can retrieve a security access token OAuth 2.0. -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerId) - * Service API of Provider is published - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*: - * body [access token req body] and example [example] - * ***securityId*** is apiInvokerId. - * ***grant_type=client_credentials***. - * Create Scope properly for request: ***3gpp#{aef_id}:{api_name}*** - * Using Invoker Certificate. - -* **Execution Steps**: - - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **200 OK** - 2. body must follow **AccessTokenRsp** with: - 1. access_token present - 2. token_type=Bearer - -## Test Case 20: Retrieve access token by Provider -* **Test ID**: ***capif_security_api-20*** -* **Description**: - - This test case will check that an API Exposure Function cannot revoke the authorization for APIs for invalid apiInvokerId - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerID from CAPIF Authority) and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by provider: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*: - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * Using AEF certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Provider - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error unauthorized_client - * error_description=Role not authorized for this API route - -## Test Case 21: Retrieve access token by Provider with invalid apiInvokerId -* **Test ID**: ***capif_security_api-21*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token without valid apiInvokerId - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by provider: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{API_INVOKER_NOT_VALID}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * Using AEF certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Provider - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **401 Unauthorized** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error unauthorized_client - * error_description=Role not authorized for this API route - - -## Test Case 22: Retrieve access token with invalid apiInvokerId -* **Test ID**: ***capif_security_api-22*** -* **Description**: - - This test case will check that an API Invoker can't retrieve a security access token without valid apiInvokerId - -* **Pre-Conditions**: - - * API Invoker is pre-authorised (has valid apiInvokerId) - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - 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 - * Use APF Certificate - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{API_INVOKER_NOT_VALID}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **404 Not Found** response. - 2. body returned must accomplish **ProblemDetails29571** data structure, with: - * status 404 - * title Not Found - * detail Security context not found - * cause API Invoker has no security context - - -**NOTE: ProblemDetails29571 is the definition present for this request at swagger of ProblemDetails, and this is different from definition of ProblemDetails across other CAPIF Services** - -## Test Case 23: Retrieve access token with invalid client_id -* **Test ID**: ***capif_security_api-23*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token without valid client_id at body - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * **client_id is not-valid** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **400 Bad Request** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error invalid_client - * error_description=Client Id not found - - -## Test Case 24: Retrieve access token with unsupported grant_type -* **Test ID**: ***capif_security_api-24*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token with unsupported grant_type - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=not_valid*** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **400 Bad Request** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error unsupported_grant_type - * error_description=Invalid value for `grant_type` \\(${grant_type}\\), must be one of \\['client_credentials'\\] - 'grant_type' - -## Test Case 25: Retrieve access token with invalid scope -* **Test ID**: ***capif_security_api-25*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token with complete invalid scope - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * ***scope=not-valid-scope*** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **400 Bad Request** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error invalid_scope - * error_description=The first characters must be '3gpp' - - -## Test Case 26: Retrieve access token with invalid aefid at scope -* **Test ID**: ***capif_security_api-26*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token with invalid aefId at scope - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * ***scope=3gpp#1234:service_1*** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **400 Bad Request** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error invalid_scope - * error_description=One of aef_id not belongs of your security context - - -## Test Case 27: Retrieve access token with invalid apiName at scope -* **Test ID**: ***capif_security_api-27*** -* **Description**: - - This test case will check that an API Exposure Function cannot retrieve a security access token with invalid apiName at scope - -* **Pre-Conditions**: - - * API Invoker is pre-authorised and Provider is also authorized - -* **Information of Test**: - - 1. Perform [Provider Registration] and [Invoker Onboarding] - - 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 - * Use APF Certificate - - 3. Request Discover Published APIs not filtered: - * Send GET to ccf_discover_url *https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}* - * Param api-invoker-id is mandatory - * Using invoker certificate - - 4. Create Security Context for this Invoker - * Send PUT *https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}* - * body [service security body] - * Using Invoker Certificate. - * Create Security Information Body with one **securityInfo** for each aef present at each serviceAPIDescription present at Discover. - - 5. Request Access Token by invoker: - * Sent POST *https://{CAPIF_HOSTNAME}/securities/{securityId}/token*. - * body [access token req body] - * ***securityId*** is apiInvokerId - * ***grant_type=client_credentials*** - * ***scope=3gpp#{aef_id}:not-valid*** - * Using Invoker certificate - -* **Execution Steps**: - 1. Register Provider at CCF, store certificates and Publish Service API service_1 at CCF - 2. Register and onboard Invoker at CCF - 3. Discover Service APIs by Invoker. - 4. Create Security Context According to Service APIs discovered. - 5. Request Access Token by Invoker - -* **Expected Result**: - - 1. Response to Request of Access Token: - 1. **400 Bad Request** response. - 2. body returned must accomplish **AccessTokenErr** data structure, with: - * error invalid_scope - * error_description=One of the api names does not exist or is not associated with the aef id provided - - - [Return To All Test Plans]: ../README.md - - - - [service security body]: ./service_security.json "Service Security Request" - [security notification body]: ./security_notification.json "Security Notification Request" - [access token req body]: ./access_token_req.json "Access Token Request" - [example]: ./access_token_req.json "Access Token Request Example" - - [invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" - [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" - - diff --git a/docs/test_plan/api_security_service/access_token_req.json b/docs/test_plan/api_security_service/access_token_req.json deleted file mode 100644 index 8504736e1fb40d49c3bcb4c6a8bca4dbb6d9f855..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_security_service/access_token_req.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "client_id": "client_id", - "client_secret": "client_secret", - "grant_type": "client_credentials", - "scope": "scope" -} \ No newline at end of file diff --git a/docs/test_plan/api_security_service/access_token_req_example.json b/docs/test_plan/api_security_service/access_token_req_example.json deleted file mode 100644 index 070a717db975b76a80792117b50957ce4267cf6b..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_security_service/access_token_req_example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "client_id": "bb260b4d0b3a0f954fa23f42d979ca", - "grant_type": "client_credentials", - "scope": "3gpp#af7e4cf70063814770e7b00b87273e:service_1" -} diff --git a/docs/test_plan/api_security_service/security_notification.json b/docs/test_plan/api_security_service/security_notification.json deleted file mode 100644 index 6b94eb5497ed8b6bde547dda6a4abc71783bc998..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_security_service/security_notification.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "aefId": "aefId", - "apiIds": [ - "apiIds", - "apiIds" - ], - "apiInvokerId": "api_invoker_id", - "cause": "OVERLIMIT_USAGE" -} \ No newline at end of file diff --git a/docs/test_plan/api_security_service/service_security.json b/docs/test_plan/api_security_service/service_security.json deleted file mode 100644 index ad7bc1ad5c64f6dc979a294044b5b44f5f43c68a..0000000000000000000000000000000000000000 --- a/docs/test_plan/api_security_service/service_security.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "notificationDestination": "http://robot.testing", - "supportedFeatures": "fffffff", - "securityInfo": [{ - "authenticationInfo": "authenticationInfo", - "authorizationInfo": "authorizationInfo", - "interfaceDetails": { - "ipv4Addr": "127.0.0.1", - "securityMethods": ["PSK"], - "port": 5248 - }, - "prefSecurityMethods": ["PSK", "PKI", "OAUTH"], - }, - { - "authenticationInfo": "authenticationInfo", - "authorizationInfo": "authorizationInfo", - "prefSecurityMethods": ["PSK", "PKI", "OAUTH"], - "aefId": "aefId" - }], - "websockNotifConfig": { - "requestWebsocketUri": true, - "websocketUri": "websocketUri" - }, - "requestTestNotification": true -} diff --git a/docs/test_plan/common_operations/README.md b/docs/test_plan/common_operations/README.md deleted file mode 100644 index ff39d943278ac7760f370dac2810fde776a28d5d..0000000000000000000000000000000000000000 --- a/docs/test_plan/common_operations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -# Register an Invoker - -## Steps to perform operation - 1. Create public and private key at invoker - 2. Register of Invoker at CCF: - * Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register - * Body [invoker register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [invoker getauth body] - - 4. Onboard Invoker: - * Send POST to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers - * Reference Request Body: [invoker onboarding body] - * "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker. - * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token}) - -## Checks to ensure onboarding - 1. Response to Register: - 1. **201 Created** - - 2. Response to Get Auth: - 1. **200 OK** - 2. ***access_token*** returned. - - 3. 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}* - - -# Register a Provider - -## Steps to Perform operation - 1. Create public and private key at provider for provider itself and each function (apf, aef and amf) - 2. Register of Provider at CCF: - * Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register* - * body [provider register body] - - 3. Obtain Access Token: - * Send POST to *http://{CAPIF_HOSTNAME}/getauth* - * Body [provider getauth body] - - 4. Register Provider: - * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* - * body [provider request body] - * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token}) - * Store each cert in a file with according name. - -## Checks to ensure provider registration - 1. Response to Register: - 1. **201 Created** - - 2. Response to Get Auth: - 1. **200 OK** - 2. ***access_token*** returned. - - 3. Register Provider at Provider Management: - 1. **201 Created** response. - 2. body returned must accomplish **APIProviderEnrolmentDetails** data structure. - 3. For each **apiProvFuncs**, we must check: - 1. **apiProvFuncId** is set - 2. **apiProvCert** under **regInfo** is set properly - 4. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}* - - - - - -[invoker register body]: ../api_invoker_management/invoker_register_body.json "Invoker Register Body" -[invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" -[invoker getauth body]: ../api_invoker_management/invoker_getauth_example.json "Get Auth Example" - -[provider register body]: ../api_provider_management/provider_register_body.json "Provider Register Body" -[provider request body]: ../api_provider_management/provider_details_post_example.json "API Provider Enrolment Request" -[provider getauth body]: ../api_provider_management/provider_getauth_example.json "Get Auth Example" - - - - - -[Return To All Test Plans]: ../README.md diff --git a/docs/testing_with_curl/README.md b/docs/testing_with_curl/README.md deleted file mode 100644 index 0903b8ba0f1dbac8703517160bee96752ecc857d..0000000000000000000000000000000000000000 --- a/docs/testing_with_curl/README.md +++ /dev/null @@ -1,369 +0,0 @@ -[**[Return To Main]**] -# Testing Using Curl - -- [Testing Using Curl](#testing-using-curl) - - [cURL scripts (TLS supported)](#curl-scripts-tls-supported) - - [cURL manual execution](#curl-manual-execution) - - [Authentication](#authentication) - - [Invoker](#invoker) - - [Provider](#provider) - - [JWT Authentication APIs](#jwt-authentication-apis) - - [Register an entity](#register-an-entity) - - [Get access token for an existing entity](#get-access-token-for-an-existing-entity) - - [Retrieve and store CA certificate](#retrieve-and-store-ca-certificate) - - [Sign provider certificate](#sign-provider-certificate) - - [Invoker Management APIs](#invoker-management-apis) - - [Onboard an Invoker](#onboard-an-invoker) - - [Update Invoker Details](#update-invoker-details) - - [Offboard an Invoker](#offboard-an-invoker) - - [Publish APIs](#publish-apis) - - [Publish a new API.](#publish-a-new-api) - - [Update a published service API.](#update-a-published-service-api) - - [Unpublish a published service API.](#unpublish-a-published-service-api) - - [Retrieve all published APIs](#retrieve-all-published-apis) - - [Retrieve a published service API.](#retrieve-a-published-service-api) - - [Discover API](#discover-api) - - [Discover published service APIs and retrieve a collection of APIs according to certain filter criteria.](#discover-published-service-apis-and-retrieve-a-collection-of-apis-according-to-certain-filter-criteria) - -## cURL scripts (TLS supported) -Also you can follow the instructions and run the commands of the bash scripts: -* [provider](./capif_tls_curls_exposer.sh) to test CAPIF as provider with TLS support. -* [invoker](./capif_tls_curls_invoker.sh) to test CAPIF as invoker with TLS support. - -## cURL manual execution - -### Authentication -This version will use TLS communication, for that purpose we have 2 different scenarios, according to role: -* Invoker -* Provider - -#### Invoker -To authenticate an invoker user, we must perform next steps: -- Retrieve CA certificate from platform. [Retrieve and store CA certificate](#retrieve-and-store-ca-certificate) -- Register on the CAPIF with invoker role. [Register an entity](#register-an-entity) -- Get a Json Web Token (JWT) in order to request onboarding [Get access token for an existing entity](#get-access-token-for-an-existing-entity) -- Request onboarding adding public key to request. [Onboard an Invoker](#onboard-an-invoker) -- Store certificate signed by CAPIF platform to allow TLS onwards. - -**Flow:** - -![Flow](../images/flows/04%20-%20Invoker%20Register.png) -![Flow](../images/flows/05%20-%20Invoker%20Onboarding.png) - -#### Provider -To authenticate an provider user, we must perform next steps: -- Retrieve CA certificate from platform. [Retrieve and store CA certificate](#retrieve-and-store-ca-certificate) -- Register on the CAPIF with provider role. [Register an entity](#register-an-entity) -- Request sign the public key to CAPIF including beared with JWT. [Sign provider certificate](#sign-provider-certificate) -- Store certificate signed by CAPIF platform to allow TLS onwards. - -**Flow:** - -![Flow](../images/flows/01%20-%20Register%20of%20AEF.png) -![Flow](../images/flows/02%20-%20AEF%20API%20Provider%20registration.png) -![Flow](../images/flows/03%20-%20AEF%20Publish.png) - -### JWT Authentication APIs -These APIs are triggered by an entity (Invoker or Provider for release 1.0) to: -- register on the CAPIF Framework -- get a Json Web Token (JWT) in order to be authorized to call CAPIF APIs - -#### Register an entity -Request -```shell -curl --request POST 'http://:/register' --header 'Content-Type: application/json' --data '{ - "username":"...", - "password":"...", - "role":"...", - "description":"...", - "cn":"..." -}' -``` - -* Role: invoker or publisher -* cn: common name - -Response body -```json -{ - "id": "Entity ID", - "message": "Informative message" -} -``` - -#### Get access token for an existing entity -Request -```shell -curl --request POST 'http://:/gettoken' --header 'Content-Type: application/json' --data '{ - "username":"...", - "password":"...", - "role":"..." -}' -``` - -Response body -```json -{ - "access_token": "JSON Web Token for CAPIF APIs", - "message": "Informative message" -} -``` - -#### Retrieve and store CA certificate -```shell -curl --request GET 'http://:/ca-root' 2>/dev/null | jq -r '.certificate' -j > -``` - -#### Sign provider certificate -```shell -curl --request POST 'http:///sign-csr' --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{ - "csr": "RAW PUBLIC KEY CREATED BY PUBLISHER", - "mode": "client", - "filename": provider -}' -``` -Response -``` json -{ - "certificate": "PUBLISHER CERTIFICATE" -} -``` -PUBLISHER CERTIFICATE value must be stored by Provider entity to next request to CAPIF (provider.crt for example) - -### Invoker Management APIs - -These APIs are triggered by a NetApp (i.e. Invoker) - -#### Onboard an Invoker - -```shell -curl --cacert --request POST 'https:///api-invoker-management/v1/onboardedInvokers' --header 'Authorization: Bearer ' --header 'Content-Type: application/json' --data-raw '{ - "notificationDestination" : "http://X:Y/netapp_callback", - "supportedFeatures" : "fffffff", - "apiInvokerInformation" : , - "websockNotifConfig" : { - "requestWebsocketUri" : true, - "websocketUri" : "websocketUri" - }, - "onboardingInformation" : { - "apiInvokerPublicKey" : - }, - "requestTestNotification" : true -}' -``` - -Response Body - -``` json -{ - "apiInvokerId": "7da0a8d4172d7d86c536c0fbc9c372", - "onboardingInformation": { - "apiInvokerPublicKey": "RAW PUBLIC KEY CREATED BY INVOKER", - "apiInvokerCertificate": "INVOKER CERTIFICATE", - "onboardingSecret": "onboardingSecret" - }, - "notificationDestination": "http://host.docker.internal:8086/netapp_callback", - "requestTestNotification": true, - ... -} -``` - -INVOKER CERTIFICATE value must be stored by Invoker entity to next request to CAPIF (invoker.crt for example) - -#### Update Invoker Details - -```shell -curl --location --request PUT 'https:///api-invoker-management/v1/onboardedInvokers/' --cert --key --cacert --header 'Content-Type: application/json' --data '{ - "notificationDestination" : "http://X:Y/netapp_callback2", - "supportedFeatures" : "fffffff", - "apiInvokerInformation" : , - "websockNotifConfig" : { - "requestWebsocketUri" : true, - "websocketUri" : "websocketUri2" - }, - "onboardingInformation" : { - "apiInvokerPublicKey" : - }, - "requestTestNotification" : true -}' -``` - -#### Offboard an Invoker - -```shell -curl --cert --key --cacert --request DELETE 'https:///api-invoker-management/v1/onboardedInvokers/' -``` - -### Publish APIs - -These APIs are triggered by the API Publishing Function (APF) of an Provider - -#### Publish a new API. -```shell -curl --cert --key --cacert --request POST 'https:///published-apis/v1//service-apis' --header 'Content-Type: application/json' --data '{ - "apiName": "3gpp-monitoring-event", - "aefProfiles": [ - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -}' -``` - -#### Update a published service API. -```shell -curl --cert --key --cacert --request PUT 'https:///published-apis/v1//service-apis/' --header 'Content-Type: application/json' --data '{ - "apiName": "3gpp-monitoring-event", - "aefProfiles": [ - { - "aefId": "string1", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -}' -``` - -#### Unpublish a published service API. -```shell -curl --cert --key --cacert --request DELETE 'https:///published-apis/v1//service-apis/' -``` - -#### Retrieve all published APIs -```shell -curl --cert --key --cacert --request GET 'https:///published-apis/v1//service-apis' -``` - -#### Retrieve a published service API. -```shell -curl --cert --key --cacert --request GET 'https:///published-apis/v1//service-apis/' -``` - -### Discover API - -This API is triggered by a NetApp (or Invoker) - -#### Discover published service APIs and retrieve a collection of APIs according to certain filter criteria. -```shell -curl --cert --key --cacert --request GET 'https:///service-apis/v1/allServiceAPIs?api-invoker-id=&api-name=&api-version=&aef-id=&api-cat=&supported-features=&api-supported-features=' -``` - - - -[Return To Main]: ../../README.md#using-curl \ No newline at end of file diff --git a/docs/testing_with_curl/capif_tls_curls_exposer.sh b/docs/testing_with_curl/capif_tls_curls_exposer.sh deleted file mode 100755 index 5b81712eeebf75965dc0fd6e4b38f1f6a89a1ef7..0000000000000000000000000000000000000000 --- a/docs/testing_with_curl/capif_tls_curls_exposer.sh +++ /dev/null @@ -1,205 +0,0 @@ -##### Execute Exposer curls locally - -##### Configure machine - -##### Add in /etc/hosts: 127.0.0.1 capifcore - - -##### Set environment variables -capifhost="capifcore" -capifhttpport="8080" - -exposerpk="-----BEGIN CERTIFICATE REQUEST-----\nMIIC0TCCAbkCAQAwgYsxEDAOBgNVBAMMB2V4cG9zZXIxFzAVBgNVBAoMDlRlbGVm\nb25pY2EgSStEMRMwEQYDVQQLDApJbm5vdmF0aW9uMQ8wDQYDVQQHDAZNYWRyaWQx\nDzANBgNVBAgMBk1hZHJpZDELMAkGA1UEBhMCRVMxGjAYBgkqhkiG9w0BCQEWC2lu\nbm9AdGlkLmVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkpJ7FzAI\nkzFYxLKbW54lIsQBNIQz5zQIvRZDFcrO4QLR2jQUps9giBWEDih++47JiBJyM+z1\nWkEh7b+moZhQThj7L9PKgJHRhU1oeHpSE1x/r7479J5F+CFRqFo5v9dC+2zGfP4E\nsSrNfp3MK/KQHsHhMzSt881xAHs+p2/bcM+sd/BlXC4J6E1y6Hk3ogI7kq443fcY\noUHZx9ClUSboOvXa1ZSPVxdCV6xKRraUdAKfhMGn+pYtJDsNp8Gg/BN8NXmYUzl9\ntDhjeuIxr4N38LgW3gRHLNIa8acO9eBctWw9AD20JWzFAXvvmsboBPc2wsOVcsml\ncCbisMRKX4JyKQIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAIxZ1Sec9ATbqjhi\nRz4rvhX8+myXhyfEw2MQ62jz5tpH4qIVZFtn+cZvU/ULySY10WHaBijGgx8fTaMh\nvjQbc+p3PXmgtnmt1QmoOGjDTFa6vghqpxPLSUjjCUe8yj5y24gkOImY6Cv5rzzQ\nlnTMkNvnGgpDgUeiqWcQNbwwge3zkzp9bVRgogTT+EDxiFnjTTF6iUG80sRtXMGr\nD6sygLsF2zijGGfWoKRo/7aZTQxuCiCixceVFXegMfr+eACkOjV25Kso7hYBoEdP\nkgUf5PNpl5uK3/rmPIrl/TeE0SnGGfCYP7QajE9ELRsBVmVDZJb7ZxUl1A4YydFY\ni0QOM3Y=\n-----END CERTIFICATE REQUEST-----\n" - - -##### Retrieve and store CA certificate - -curl --request GET "http://$capifhost:$capifhttpport/ca-root" 2>/dev/null | jq -r '.certificate' -j > ca.crt - - -##### Register an entity - -exposerid=$(curl --request POST "http://$capifhost:$capifhttpport/register" --header 'Content-Type: application/json' --data '{ - "username":"exposer", - "password":"exposer", - "role":"exposer", - "description":"Exposer", - "cn":"exposer" -}' 2>/dev/null | jq -r '.id' -j) - - -##### Get access token - -exposertoken=$(curl --request POST "http://$capifhost:$capifhttpport/gettoken" --header 'Content-Type: application/json' --data '{ - "username":"exposer", - "password":"exposer", - "role":"exposer" -}' 2>/dev/null | jq -r '.access_token' -j) - - -##### Sign exposer certificate - -curl --request POST "http://$capifhost:$capifhttpport/sign-csr" --header "Authorization: Bearer $exposertoken" --header 'Content-Type: application/json' --data-raw "{ - \"csr\": \"$exposerpk\", - \"mode\": \"client\", - \"filename\": \"exposer\" -}" 2>/dev/null | jq -r '.certificate' -j > exposer.crt - - -##### Publish service -curl --cert exposer.crt --key exposer.key --cacert ca.crt --request POST "https://$capifhost/published-apis/v1/$exposerid/service-apis" --header 'Content-Type: application/json' --data '{ - "apiName": "3gpp-monitoring-event", - "aefProfiles": [ - { - "aefId": "string", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -}' > response.json - -apiserviceid=$(cat response.json | jq -r '.apiId' -j) - - -##### Update a published service API -curl --cert exposer.crt --key exposer.key --cacert ca.crt --request PUT "https://$capifhost/published-apis/v1/$exposerid/service-apis/$apiserviceid" --header 'Content-Type: application/json' --data '{ - "apiName": "3gpp-monitoring-event", - "aefProfiles": [ - { - "aefId": "string1", - "versions": [ - { - "apiVersion": "v1", - "expiry": "2021-11-30T10:32:02.004Z", - "resources": [ - { - "resourceName": "string", - "commType": "REQUEST_RESPONSE", - "uri": "string", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ], - "custOperations": [ - { - "commType": "REQUEST_RESPONSE", - "custOpName": "string", - "operations": [ - "GET" - ], - "description": "string" - } - ] - } - ], - "protocol": "HTTP_1_1", - "dataFormat": "JSON", - "securityMethods": ["PSK"], - "interfaceDescriptions": [ - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - }, - { - "ipv4Addr": "string", - "port": 65535, - "securityMethods": ["PSK"] - } - ] - } - ], - "description": "string", - "supportedFeatures": "fffff", - "shareableInfo": { - "isShareable": true, - "capifProvDoms": [ - "string" - ] - }, - "serviceAPICategory": "string", - "apiSuppFeats": "fffff", - "pubApiPath": { - "ccfIds": [ - "string" - ] - }, - "ccfId": "string" -}' - - -##### Retrieve all published APIs - -curl --cert exposer.crt --key exposer.key --cacert ca.crt --request GET "https://$capifhost/published-apis/v1/$exposerid/service-apis" - - -##### Retrieve a published service API - -curl --cert exposer.crt --key exposer.key --cacert ca.crt --request GET "https://$capifhost/published-apis/v1/$exposerid/service-apis/$apiserviceid" - - -##### Unpublish a published service API - -curl --cert exposer.crt --key exposer.key --cacert ca.crt --request DELETE "https://$capifhost/published-apis/v1/$exposerid/service-apis/$apiserviceid" - - diff --git a/docs/testing_with_curl/capif_tls_curls_invoker.sh b/docs/testing_with_curl/capif_tls_curls_invoker.sh deleted file mode 100755 index d6c287a91ee27891cf652c65e6d5b25f8ca84a63..0000000000000000000000000000000000000000 --- a/docs/testing_with_curl/capif_tls_curls_invoker.sh +++ /dev/null @@ -1,86 +0,0 @@ -##### Execute Invoker curls locally - -##### Configure machine - -##### Add in /etc/hosts: 127.0.0.1 capifcore - - -##### Set environment variables - -capifhost="capifcore" -capifhttpport="8080" - -invokerpk="-----BEGIN CERTIFICATE REQUEST-----\nMIIC0TCCAbkCAQAwgYsxEDAOBgNVBAMMB2ludm9rZXIxFzAVBgNVBAoMDlRlbGVm\nb25pY2EgSStEMRMwEQYDVQQLDApJbm5vdmF0aW9uMQ8wDQYDVQQHDAZNYWRyaWQx\nDzANBgNVBAgMBk1hZHJpZDELMAkGA1UEBhMCRVMxGjAYBgkqhkiG9w0BCQEWC2lu\nbm9AdGlkLmVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArfITEb3/\nJ5KDt7ia2WsQrd8iSrlH8kh6D9YNPEF+KaIGQ9w8QhmOW416uvIAASzOaCKMNqgb\nCI0NqsbVF9lfaiBgB71vcwX0yKatjACn3Nl3Lnubi+tH4Jb5zGQQXOuxpMHMmgyn\nNTsSc/MeMzX3iUWqLmmhnTC31Mu1ESUPTBa+CitQAj2wYMvBS970WICKrDlxWkR8\nZZBkRBZaxMfqY21VWmREtR+Kl6GCMBtUCUBH6uWjFiOpxYbCxdygxxrA4a3IzmiO\ntXOyLs7iuOP/CLSYfk71MHX2qKlpAyjdRK2W0w0GioV90Hk4uT/YUYy9zjWWN+mm\nrQ9GBy8iRZm7YwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAI0btA7KDMvkY4Ib\n0eMteeeT40bm11Yw8/6V48IaIPi9EpZMI+jWyCebw8PBFUs3l3ImWeO8Gma96gyf\np0WB/64MRkUSdOxUWOWGMPIMEF+BH3eiHthx+EbAETtJ0D4KzmH6raxl14qvwLS5\nwxtxPGxu/R5ue5RVJpAzzJ6OX36p05GYSzL+pTotVPpowSdoeNsV+xPgPA0diV8a\nB7Zn/ujwMpsh7IjQPKpOEkhQdxc478Si8dmRbzXkVar1Oa8/QSJ8ZAaFI4VGowjR\nmtxps7AvS5OG9iMPtFQHpqxHVO50CJU5cbsXsYdu9EipGhgIKJDKewBX7tCKk0Ot\nBLU03CY=\n-----END CERTIFICATE REQUEST-----\n" - - -##### Retrieve and store CA certificate - -curl --request GET "http://$capifhost:$capifhttpport/ca-root" 2>/dev/null | jq -r '.certificate' -j > ca.crt - - -##### Register an entity - -invokerid=$(curl --request POST "http://$capifhost:$capifhttpport/register" --header 'Content-Type: application/json' --data '{ - "username":"invoker", - "password":"invoker", - "role":"invoker", - "description":"Invoker", - "cn":"invoker" -}' 2>/dev/null | jq -r '.id' -j) - - -##### Get access token - -invokertoken=$(curl --request POST "http://$capifhost:$capifhttpport/gettoken" --header 'Content-Type: application/json' --data '{ - "username":"invoker", - "password":"invoker", - "role":"invoker" -}' 2>/dev/null | jq -r '.access_token' -j) - - -##### Onboard an Invoker - -curl --cacert ca.crt --request POST "https://$capifhost/api-invoker-management/v1/onboardedInvokers" --header "Authorization: Bearer $invokertoken" --header 'Content-Type: application/json' --data-raw "{ - \"notificationDestination\" : \"http://X:Y/netapp_callback\", - \"supportedFeatures\" : \"fffffff\", - \"apiInvokerInformation\" : \"invoker\", - \"websockNotifConfig\" : { - \"requestWebsocketUri\" : true, - \"websocketUri\" : \"websocketUri\" - }, - \"onboardingInformation\" : { - \"apiInvokerPublicKey\" : \"$invokerpk\" - }, - \"requestTestNotification\" : true -}" > response.json - -cat response.json | jq -r '.onboardingInformation.apiInvokerCertificate' -j > invoker.crt -apiinvokerid=$(cat response.json | jq -r '.apiInvokerId' -j) - - -##### Update Invoker Details - -curl --location --request PUT "https://$capifhost/api-invoker-management/v1/onboardedInvokers/$apiinvokerid" --cert invoker.crt --key invoker.key --cacert ca.crt --header 'Content-Type: application/json' --data "{ - \"notificationDestination\" : \"http://X:Y/netapp_callback2\", - \"supportedFeatures\" : \"fffffff\", - \"apiInvokerInformation\" : \"test\", - \"websockNotifConfig\" : { - \"requestWebsocketUri\" : true, - \"websocketUri\" : \"websocketUri2\" - }, - \"onboardingInformation\" : { - \"apiInvokerPublicKey\" : \"$invokerpk\" - }, - \"requestTestNotification\" : true -}" - - -##### Discover API - -curl --cert invoker.crt --key invoker.key --cacert ca.crt --request GET "https://$capifhost/service-apis/v1/allServiceAPIs?api-invoker-id=$apiinvokerid" - - -##### Offboard an Invoker - -curl --cert invoker.crt --key invoker.key --cacert ca.crt --request DELETE "https://$capifhost/api-invoker-management/v1/onboardedInvokers/$apiinvokerid" - diff --git a/docs/testing_with_curl/exposer.key b/docs/testing_with_curl/exposer.key deleted file mode 100644 index e84c8c4c2796860f0a3a1b0937d5b444a68692e2..0000000000000000000000000000000000000000 --- a/docs/testing_with_curl/exposer.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSknsXMAiTMVjE -sptbniUixAE0hDPnNAi9FkMVys7hAtHaNBSmz2CIFYQOKH77jsmIEnIz7PVaQSHt -v6ahmFBOGPsv08qAkdGFTWh4elITXH+vvjv0nkX4IVGoWjm/10L7bMZ8/gSxKs1+ -ncwr8pAeweEzNK3zzXEAez6nb9twz6x38GVcLgnoTXLoeTeiAjuSrjjd9xihQdnH -0KVRJug69drVlI9XF0JXrEpGtpR0Ap+Ewaf6li0kOw2nwaD8E3w1eZhTOX20OGN6 -4jGvg3fwuBbeBEcs0hrxpw714Fy1bD0APbQlbMUBe++axugE9zbCw5VyyaVwJuKw -xEpfgnIpAgMBAAECggEACs11TqlcIG5qd/N1Ts8ni9noACpe4ZiXV578lRkW8++E -xEZtX+P4iIm+wK+3DYGhvyp430naGsD30rF62FMaVr8xmCijC/nIoutTGqS38t8G -Ns+C/2Lrjj+fvemJyGasSaKOjdIc9L/OWG7MiE/+05LU2bTKvfrIwXvT4NGg2ei1 -NDO8vS5fRHYZ1LyCyrCDetP2aYrTlPao20hmU4IDyh4N17wLuPgijC+AuqR2Xic0 -Mk4ofZ/6Y3oN0rrov2yG7IXjMJQI469IQ6TJLlyFc8tQIF5Y3CMMCMuVMq5m33bq -/6bow4/VYFG8mPzy7lQLQ8YeEPsgDKL0pB4zqDr7ZwKBgQDJRJoG2PSaEOt6DIKV -84to73oD9x9lOSrmaH2/NzL3mwLXP2Is4nmLzEDQvA0UhTZe9c0n6OoE3uRZ1gAu -JIe3zXTJSK4/ysmePUZL1js5bKtuHBrcSCOupWRuJXbaXK5uqISDHUgHiRw3bq8y -g8SZY/JOBPyJhVlKhmhNCYMi9wKBgQC6bjJ//tLpH6EG4ux0O2StzUoHrvV2cyUj -RRxGvAt92sdsZaVKmIW/SlLy8tv5HJqblfn6m7aY/vUYbN3AfMJ4teLZz5Y//CH3 -jPchHyk/uhh7gxufiD65i5bfVyRt54tDbyVDc2/1prUyD5W4q4UNOmvhXym5saIc -U5WNCnSr3wKBgQCs8MaM5bVgAPPlfoRixs9ejo/AgoK2nqWvL9AFEzA3NDn/rJX2 -TW/1YL+83Ck9Ha33cKwlA+y53LBIRSsIexknJWKZZltbsysFTk9t8JoZILg5N+sY -puAKPFGMl6KFxSeZLDIY23s+BmF5fCEMfc7botbclUpN/IgaEl3i/C5zRwKBgHsx -lKdmEaNBZlwxmgTYtpfvH2tiXwwN3M2ovp2zZ3icGMn1hTt8/GzCxXuLpnbAQx5r -BcxoF0qUuAuS7RpklvHDZ4t9FJFloGCAQ1Ic0FovNDxyD8/k7WYY6vLdF9KUfj9q -c9pVrvdKWVQiXlKw7PQn1eAQzXbK/g/v39Raw2xLAoGBAILTLY3sGBNkFCVhJlyZ -DaIwkbtnpCBT2T7DUupw51aLhh4rnuJ5wA3uGdRqoKVYSc9DuOwB/yNFGuQDElxQ -jfKlX0X5xItaxZ5FR4EvGCnqBJl6JM3QekzhXtq5VdY5zIf/HHqFYebcMFrkEicZ -uuAZd4wa+jn9SR9mUYtS+Lq+ ------END PRIVATE KEY----- diff --git a/docs/testing_with_curl/invoker.key b/docs/testing_with_curl/invoker.key deleted file mode 100644 index 15b96bbd0d00ef4ee73a5557e79b42c4b6d6598f..0000000000000000000000000000000000000000 --- a/docs/testing_with_curl/invoker.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCt8hMRvf8nkoO3 -uJrZaxCt3yJKuUfySHoP1g08QX4pogZD3DxCGY5bjXq68gABLM5oIow2qBsIjQ2q -xtUX2V9qIGAHvW9zBfTIpq2MAKfc2Xcue5uL60fglvnMZBBc67GkwcyaDKc1OxJz -8x4zNfeJRaouaaGdMLfUy7URJQ9MFr4KK1ACPbBgy8FL3vRYgIqsOXFaRHxlkGRE -FlrEx+pjbVVaZES1H4qXoYIwG1QJQEfq5aMWI6nFhsLF3KDHGsDhrcjOaI61c7Iu -zuK44/8ItJh+TvUwdfaoqWkDKN1ErZbTDQaKhX3QeTi5P9hRjL3ONZY36aatD0YH -LyJFmbtjAgMBAAECggEAAyR5OxdJ1W5jnSD9kBCvO6jDMIUuIcU+SAZUfGaxYybn -EeNCtBiPGV8tWWLHJJ0bL6iKpAv+gOKeSpKOmwU7XkHZEWVlRAfpiNfen2bcTCiw -fg3D4bgRMmDwwyMH368QFlJ56UFMCuqb0x+oCeMRIdNjwfbcPVCpZDYNGwTDBzoy -72Aj5TssEu+Ft5VVGwhsvq0v6bd6OWmW34PI9SHzXzRlRw4b4ZtZekW8o/QpO1gO -F+ARbCGE2qjqHWRU/vzINMmAucqhDM6/f7Un5XXr+Zm+8u4PGa5eLWkebJHhfwKX -Ag0WToD/FmDPRqlnjZdzraJlhuXLGdhRAlzdnIQNRQKBgQDvhiVewu7CTzgB66dA -cdrJkXVJPZUGvUYmXkwPaSju7hjDc87pNz+szH2QP+Qm+pD1mV9OswIim4Oi7C1l -lEe423QGjtsn5txzcRk+ZzyX/Z2ltcnXi8N/MNeOZ2qFAgP/IIOTcgowKftuUT6w -2A1DQFj6xxu6vrzxOqIL6tXy7wKBgQC56SM80udTqyb9+wk/KuDSgym3bSaZ8i5q -dNVV5wOxCotLGG9Any61TVOIP/SUjar4f4+FznLZjJYXIZvpbS32PUOtlnKtOmp6 -OBKIpEXq2zq0u/o/i8EyOb6laNqehfffRYqqYU9mJXVjiTUNcOVqfLljeeui1r1P -txSRBlTuzQKBgQDUgB/hbXHjw+J9mbM9soUXtUvn2ZHAc+Wrnpc+SN6+80/W/4R/ -VbvRM27mrjhc+InoytRKfvgS+gOUZJJ1/1KOR2wtcUovoVrNtHZf7blNYv0dCiXz -bBTaX9uthER1km83RoJVKqStTGG74qqKvHMvygPnIQSR7iy0m38usX500wKBgGeM -koLzWcOBhhNa+tiDMnwucFLpaeG/QdkrwBO7u5OlstYeAwF0aFi1fDxcmwcPLVaB -/lfiGJhRtNunbacDl+EaWJLcRH12Fw6CItiW3xakCzvVo9o3JmGqRiTtlS9MoTZs -DoM99jKH1K2fI7yb0DySwdPFedjWUNWQvNTWOQJVAoGAYr9Kuo7s83Qe9CaHQW/Y -PPL0dYBA63guuw2mNQjBL5LuqMZPz6vVB0hIVlYb5Xgw48OWUThHksJ0qltJK7kR -OPRyOxiWpJVo5rZPVzS0Ofbmau9z1VYr358RqR2N2EqG5KDr5QZT9nQq7k8EJvrF -NM/zMhxmgtNYez417Q/3U+M= ------END PRIVATE KEY----- diff --git a/docs/testing_with_postman/README.md b/docs/testing_with_postman/README.md deleted file mode 100644 index b6c75832265d5b61f797f4d38ac2ad3d090fd216..0000000000000000000000000000000000000000 --- a/docs/testing_with_postman/README.md +++ /dev/null @@ -1,160 +0,0 @@ -[**[Return To Main]**] - -- [CAPIF in Postman](#capif-in-postman) - - [Requisites](#requisites) - - [First steps](#first-steps) - - [Not Local CAPIF](#not-local-capif) -- [CAPIF Flows](#capif-flows) - - [Publication of an API](#publication-of-an-api) - - [**01-register\_user\_provider**](#01-register_user_provider) - - [**02-getauth\_provider**](#02-getauth_provider) - - [**03-onboard\_provider**](#03-onboard_provider) - - [**04-publish\_api**](#04-publish_api) - - [Calling the API](#calling-the-api) - - [**05-register\_user\_invoker**](#05-register_user_invoker) - - [**06-getauth\_invoker**](#06-getauth_invoker) - - [**07-onboard\_invoker**](#07-onboard_invoker) - - [**08-discover**](#08-discover) - - [**09-security\_context**](#09-security_context) - - [**10-get\_token**](#10-get_token) - - [**11-call\_service**](#11-call_service) - - [Other requests](#other-requests) -- [Notes](#notes) - - -# CAPIF in Postman -In this section we can use Postman to publish an API as a provider and use it as an invoker. - -## Requisites - -- We will need to have Node.js installed since we will use a small script to create the CSRs of the certificates. -- An instance of CAPIF (If it is not local, certain variables would have to be modified both in the Node.js script and in the Postman environment variables). - -## First steps - -1. Install the Node dependencies to run the script with: - -``` -npm i -``` - -2. Run the script.js with the following command: - -``` -node script.js -``` - -3. Import Postman collection and environment variables (CAPIF.postman_collection.json and CAPIF.postman_environment.json) -4. Select CAPIF Environment before start testing. - -## Not Local CAPIF - -If the CAPIF is not local, the host and port of both the CAPIF and the register would have to be specified in the variables, and the CAPIF_HOSTNAME in the script, necessary to obtain the server certificate. - -**Enviroments in Postman** -``` -CAPIF_HOSTNAME capifcore -CAPIF_PORT 8080 -REGISTER_HOSTNAME register -REGISTER_PORT 8084 -``` - -**Const in script.js** -``` -CAPIF_HOSTNAME capifcore -``` - -# CAPIF Flows -Once the first steps have been taken, we can now use Postman requests. These requests are numbered in the order that must be followed to obtain everything necessary from CAPIF. - -## Publication of an API - -### **01-register_user_provider** - -![Flow](../images/flows/01a%20-%20Register%20(Only)%20AEF.png) - -### **02-getauth_provider** - -![Flow](../images/flows/01b%20-%20Register%20of%20AEF%20GetAuth.png) - -### **03-onboard_provider** - -![Flow](../images/flows/02%20-%20AEF%20API%20Provider%20registration.png) - -At this point we move on to using certificate authentication in CAPIF. In Postman it is necessary to add the certificates manually and using more than one certificate for the same host as we do in CAPIF complicates things. For this reason, we use the script to overwrite a certificate and a key when it is necessary to have a specific one. - -To configure go to **settings** in Postman and open the **certificates** section. - -- Here, activate the **CA certificates** option and add the **ca_cert.pem** file found in the **Responses** folder. -- Adds a client certificate specifying the CAPIF host being used and the files **client_cert.crt** and **client_key.key** in the **Responses** folder. - - -Once this is done, the node script will be in charge of changing the certificate that is necessary in each request. - -### **04-publish_api** - -![Flow](../images/flows/03%20-%20AEF%20Publish.png) - -Once the api is published, we can start it. In this case we have a test one created in python that can be executed with the following command: - -``` -python3 hello_api.py -``` - -The API publication interface is set to localhost with port 8088, so the service must be set up locally. If you wanted to build it on another site, you would have to change the interface description in the body of publish_api. - -With this the provider part would be finished. - -## Calling the API - -### **05-register_user_invoker** - -![Flow](../images/flows/04a%20-%20Invoker%20(Only)%20Register.png) - -### **06-getauth_invoker** - -![Flow](../images/flows/04b%20-%20Invoker%20Register%20GetAuth.png) - -### **07-onboard_invoker** - -![Flow](../images/flows/05%20-%20Invoker%20Onboarding.png) - -At this point we move on to using certificate authentication in CAPIF. **If you did not configure the provider's certificates, you would have to do it now**. - -### **08-discover** - -![Flow](../images/flows/06%20-%20Invoker%20Discover%20AEF.png) - -### **09-security_context** - -![Flow](../images/flows/07%20-%20Invoker%20Create%20Security%20Context.png) - -### **10-get_token** - -![Flow](../images/flows/08%20-%20Invoker%20Get%20Token.png) - -### **11-call_service** - -![Flow](../images/flows/09%20-%20Invoker%20Send%20Request%20to%20AEF%20Service%20API.png) - -With this, we would have made the API call and finished the flow. - -## Other requests - -Other requests that we have added are the following: - -- **offboard_provider** Performs offboarding of the provider, thereby eliminating the published APIs. -- **offboard_invoker** Offboards the invoker, also eliminating access to the APIs of that invoker. -- **remove_user_invoker** Delete the user created for the invoker. -- **remove_user_provider** Delete the user created for the provider. - -# Notes - -- This process is designed to teach how requests are made in Postman and the flow that should be followed to publish and use an API. -- It is possible that if external CAPIFs are used (Public CAPIF) the test data may already be used or the API already registered. -- It is necessary to have the Node service running to make the certificate change for the requests, otherwise it will not work. -- We are working on adding more requests to the Postman collection. -- This collection is a testing guide and is recommended for testing purposes only. - -[Return To Main]: ../../README.md#using-postman - diff --git a/docs/testing_with_postman/hello_api.py b/docs/testing_with_postman/hello_api.py deleted file mode 100644 index 0b2a35989ecfaa144489d1b6012f61453c91bd68..0000000000000000000000000000000000000000 --- a/docs/testing_with_postman/hello_api.py +++ /dev/null @@ -1,38 +0,0 @@ -from flask import Flask, jsonify, request -from flask_jwt_extended import jwt_required, JWTManager, get_jwt_identity, get_jwt -import ssl -from werkzeug import serving -import socket, ssl -import OpenSSL -from OpenSSL import crypto -import jwt -import pyone - -app = Flask(__name__) - -jwt_flask = JWTManager(app) - - -with open("Responses/cert_server.pem", "rb") as cert_file: - cert= cert_file.read() - -crtObj = crypto.load_certificate(crypto.FILETYPE_PEM, cert) -pubKeyObject = crtObj.get_pubkey() -pubKeyString = crypto.dump_publickey(crypto.FILETYPE_PEM,pubKeyObject) - -app.config['JWT_ALGORITHM'] = 'RS256' -app.config['JWT_PUBLIC_KEY'] = pubKeyString - - -@app.route("/hello", methods=["POST"]) -@jwt_required() -def hello(): - - request_data = request.get_json() - - user_name = request_data['name'] - - return jsonify(f"Hello: {user_name}, welcome to CAPIF.") - -if __name__ == '__main__': - serving.run_simple("0.0.0.0", 8088, app) diff --git a/docs/testing_with_postman/package.json b/docs/testing_with_postman/package.json deleted file mode 100644 index 6d612a702d5a9fa9a112f1a2f47c44f75725fa00..0000000000000000000000000000000000000000 --- a/docs/testing_with_postman/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "node-server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "body-parser": "^1.18.3", - "express": "^4.16.3", - "shelljs": "^0.8.2" - } - } \ No newline at end of file diff --git a/docs/testing_with_postman/script.js b/docs/testing_with_postman/script.js deleted file mode 100644 index 980f81f33b4bda4f48f55dcd13d8f436dface9a5..0000000000000000000000000000000000000000 --- a/docs/testing_with_postman/script.js +++ /dev/null @@ -1,199 +0,0 @@ -// Change this variable if another host is used for CAPIF -const CAPIF_HOSTNAME = 'capifcore'; - -const express = require('express'), - app = express(), - fs = require('fs'), - shell = require('shelljs'), - - - folderPath = './Responses/', - bodyParser = require('body-parser'), - path = require('path'); - -const { exec } = require('child_process'); - -// Create the folder path in case it doesn't exist -shell.mkdir('-p', folderPath); - - // Change the limits according to your response size -app.use(bodyParser.json({limit: '50mb', extended: true})); -app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })); -var opensslCommand = '' - -if (CAPIF_HOSTNAME.includes(':')){ - opensslCommand = `openssl s_client -connect ${CAPIF_HOSTNAME} | openssl x509 -text > ./Responses/cert_server.pem`; -} -else{ - opensslCommand = `openssl s_client -connect ${CAPIF_HOSTNAME}:443 | openssl x509 -text > ./Responses/cert_server.pem`; -} - -exec(opensslCommand, (error, stdout, stderr) => { - if (error) { - console.error(`Error generating CSR: ${stderr}`); - } -}); - -fs.writeFileSync('./Responses/client_cert.crt', ''); -fs.writeFileSync('./Responses/client_key.key', ''); - -app.get('/', (req, res) => res.send('Hello, I write data to file. Send them requests!')); - -app.post('/generate_csr', (req, res) => { - - console.log(req.body); - const csrFilePath = 'Responses/'+req.body.apiProvFuncRole+'_csr.pem'; - const privateKeyFilePath = 'Responses/'+req.body.apiProvFuncRole+'_key.key'; - - const subjectInfo = { - country: 'ES', - state: 'Madrid', - locality: 'Madrid', - organization: 'Telefonica I+D', - organizationalUnit: 'IT Department', - emailAddress: 'admin@example.com', - }; - - const opensslCommand = `openssl req -newkey rsa:2048 -nodes -keyout ${privateKeyFilePath} -out ${csrFilePath} -subj "/C=${subjectInfo.country}/ST=${subjectInfo.state}/L=${subjectInfo.locality}/O=${subjectInfo.organization}/OU=${subjectInfo.organizationalUnit}/emailAddress=${subjectInfo.emailAddress}"`; - - exec(opensslCommand, (error, stdout, stderr) => { - if (error) { - console.error(`Error generating CSR: ${stderr}`); - } else { - console.log('CSR generated successfully:'); - fs.readFile(csrFilePath, 'utf8', (readError, csrContent) => { - if (readError) { - console.error(`Error reading CSR: ${readError}`); - res.status(500).send('Error reading CSR'); - } else { - console.log('CSR read successfully:'); - // Send the CSR content in the response - fs.readFile(privateKeyFilePath, 'utf8', (readError, keyContent) => { - if (readError) { - console.error(`Error reading KEY: ${readError}`); - res.status(500).send('Error reading KEY'); - } else { - console.log('KEY read successfully:'); - // Send the CSR content in the response - fs.unlink(csrFilePath, (err) => { - if (err) { - console.error(`Error deleting file: ${err.message}`); - } - }); - fs.unlink(privateKeyFilePath, (err) => { - if (err) { - console.error(`Error deleting file: ${err.message}`); - } - }); - res.send({csr: csrContent, key: keyContent}); - } - }); - } - }); - } - }); -}); - -app.post('/generate_csr_invoker', (req, res) => { - - console.log(req.body); - const csrFilePath = 'Responses/invoker_csr.pem'; - const privateKeyFilePath = 'Responses/invoker_key.key'; - - const subjectInfo = { - country: 'ES', - state: 'Madrid', - locality: 'Madrid', - organization: 'Telefonica I+D', - organizationalUnit: 'IT Department', - emailAddress: 'admin@example.com', - }; - - const opensslCommand = `openssl req -newkey rsa:2048 -nodes -keyout ${privateKeyFilePath} -out ${csrFilePath} -subj "/C=${subjectInfo.country}/ST=${subjectInfo.state}/L=${subjectInfo.locality}/O=${subjectInfo.organization}/OU=${subjectInfo.organizationalUnit}/emailAddress=${subjectInfo.emailAddress}"`; - - exec(opensslCommand, (error, stdout, stderr) => { - if (error) { - console.error(`Error generating CSR: ${stderr}`); - } else { - console.log('CSR generated successfully:'); - fs.readFile(csrFilePath, 'utf8', (readError, csrContent) => { - if (readError) { - console.error(`Error reading CSR: ${readError}`); - res.status(500).send('Error reading CSR'); - } else { - console.log('CSR read successfuly:'); - // Send the CSR content in the response - fs.readFile(privateKeyFilePath, 'utf8', (readError, keyContent) => { - if (readError) { - console.error(`Error reading KEY: ${readError}`); - res.status(500).send('Error reading KEY'); - } else { - console.log('KEY read successfully:'); - // Send the CSR content in the response - fs.unlink(csrFilePath, (err) => { - if (err) { - console.error(`Error deleting file: ${err.message}`); - } - }); - fs.unlink(privateKeyFilePath, (err) => { - if (err) { - console.error(`Error deleting file: ${err.message}`); - } - }); - res.send({csr: csrContent, key: keyContent}); - } - }); - } - }); - } - }); -}); - - -app.post('/write_cert', (req, res) => { - let extension = 'crt', - fsMode = 'writeFile', - filename = "client_cert", - filePath = `${path.join(folderPath, filename)}.${extension}`, - options = {encoding: 'binary'}; - fs[fsMode](filePath, req.body.cert, options, (err) => { - if (err) { - console.log(err); - res.send('Error'); - } - }); - extension = 'key'; - filename = "client_key"; - filePath = `${path.join(folderPath, filename)}.${extension}`; - fs[fsMode](filePath, req.body.key, options, (err) => { - if (err) { - console.log(err); - res.send('Error'); - } - else { - res.send('Success'); - } - }); -}); - -app.post('/write_ca', (req, res) => { - let extension = 'pem', - fsMode = 'writeFile', - filename = "ca_cert", - filePath = `${path.join(folderPath, filename)}.${extension}`, - options = {encoding: 'binary'}; - fs[fsMode](filePath, req.body.ca_root, options, (err) => { - if (err) { - console.log(err); - res.send('Error'); - } - else { - res.send('Success'); - } - }); -}); - -app.listen(3000, () => { - console.log('ResponsesToFile App is listening now! Send them requests my way!'); - console.log(`Data is being stored at location: ${path.join(process.cwd(), folderPath)}`); -}); \ No newline at end of file diff --git a/docs/testing_with_robot/README.md b/docs/testing_with_robot/README.md deleted file mode 100644 index 71504c1fc5ab76377c54bf868516f33a5617f731..0000000000000000000000000000000000000000 --- a/docs/testing_with_robot/README.md +++ /dev/null @@ -1,74 +0,0 @@ -[**[Return To Main]**] -# Testing With Robot Framework - -- [Testing With Robot Framework](#testing-with-robot-framework) - - [Steps to Test](#steps-to-test) - - [Script Test Execution](#script-test-execution) - - [Manual Build And Test Execution](#manual-build-and-test-execution) - - [Test result review](#test-result-review) - -## Steps to Test - -To run any test locally you will need *docker* and *docker-compose* installed in order run services and execute test plan. Steps will be: -* **Run All Services**: See section [Run All CAPIF Services](../../README.md#run-all-capif-services-locally-with-docker-images) -* **Run desired tests**: At this point we have 2 options: - * **Using helper script**: [Script Test Execution](#script-test-execution) - * **Build robot docker image and execute manually robot docker**: [Manual Build And Test Execution](#manual-build-and-test-execution) - - -## Script Test Execution -This script will build robot docker image if it's need and execute tests selected by "include" option. Just go to service folder, execute and follow steps. -``` -./runCapifTests.sh --include -``` -Results will be stored at /results - -Please check parameters (include) under *Test Execution* at [Manual Build And Test Execution](#manual-build-and-test-execution). - -## Manual Build And Test Execution - -* **Build Robot docker image**: -``` -cd tools/robot -docker build . -t 5gnow-robot-test:latest -``` - -* **Tests Execution**: - -Execute all tests locally: -``` -=path in local machine to repository cloned. -=path to a folder on local machine to store results of Robot Framework execution. -=Is the hostname set when run.sh is executed, by default it will be capifcore. -=This is the port to reach when robot framework want to reach CAPIF deployment using http, this should be set to port without TLS set on Nginx, 8080 by default. - -To execute all tests run : -docker run -ti --rm --network="host" -v /tests:/opt/robot-tests/tests -v :/opt/robot-tests/results 5gnow-robot-test:latest --variable CAPIF_HOSTNAME:capifcore --variable CAPIF_HTTP_PORT:8080 --include all -``` - -Execute specific tests locally: -``` -To run more specific tests, for example, only one functionality: -=Select one from list: - "capif_api_discover_service", - "capif_api_invoker_management", - "capif_api_publish_service", - "capif_api_events", - "capif_security_api - -And Run: -docker run -ti --rm --network="host" -v /tests:/opt/robot-tests/tests -v :/opt/robot-tests/results 5gnow-robot-test:latest --variable CAPIF_HOSTNAME:capifcore --variable CAPIF_HTTP_PORT:8080 --include -``` - -## Test result review - -In order to Review results after tests, you can check general report at /report.html or if you need more detailed information /log.html, example: -* Report: -![Report](../images/robot_report_example.png) -* Detailed information: -![Log](../images/robot_log_example.png) - -**NOTE: If you need more detail at Robot Framework Logs you can set log level option just adding to command --loglevel DEBUG** - - -[Return To Main]: ../../README.md#robot-framework \ No newline at end of file