Skip to content
Snippets Groups Projects
Commit 0e5bd0a4 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF-Doc4-upgrade-documentation-with-new-tests' into 'develop'

Ocf doc4 upgrade documentation with new tests

See merge request ocf/documentation!8
parents a76fd14e ec55e4d6
No related branches found
No related tags found
1 merge request!8Ocf doc4 upgrade documentation with new tests
Pipeline #7958 passed
...@@ -1281,7 +1281,7 @@ At this documentation you will have all information and related files and exampl ...@@ -1281,7 +1281,7 @@ At this documentation you will have all information and related files and exampl
[access token req body]: ./access_token_req.json "Access Token Request" [access token req body]: ./access_token_req.json "Access Token Request"
[example]: ./access_token_req.json "Access Token Request Example" [example]: ./access_token_req.json "Access Token Request Example"
[invoker onboarding]: ../common_operations/README.md#register-an-invoker "Invoker Onboarding" [invoker onboarding]: ../common_operations/README.md#onboard-an-invoker "Invoker Onboarding"
[provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration"
# Common Operations # Common Operations
## Register an Invoker ## Register new user
In order to use OpenCAPIF we must add a new user. This new user can onboard/register any Invokers or Providers.
That new user **must be created by administrator** of Register Service and with the credentials shared by administrator, the new user can get the **access_token** by requesting it to Register service.
The steps to register a new user at Register Service are:
### Admin create User
1) **Login as Admin to get access_token:**
* Send **POST** to **https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/login**
* **Include basic Auth Header with Admin credentials**
* Get **access_token** and **refresh_token** from response
![Flow](../../../images/flows/01_Login_Admin.png)
2) **Create User:**
* Send **POST** to **https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/createUser**
* Include Admin **access_token** in **Authorization Bearer Header**
* Body [user_registration_body]
![Flow](../../../images/flows/02_Creation_of_user.png)
### User Retrieve access token and other information
1) **Retrieve access_token by User:**
* Send **GET** to **https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/getauth**
* Include **basic Auth Header with User credentials**
* Retrieve **access_token** and the urls needed for next requests from response body [user_getauth_response_body_example]
![Flow](../../../images/flows/03_Register_of_AEF_GetAuth.png)
## Onboard an Invoker
### Steps to perform operation ### Steps to perform operation
***Preconditions: The administrator must have previously registered the User.***
1. Create public and private key at invoker 1. Create public and private key at invoker
2. Register of Invoker at CCF: 2. Retrieve access_token by User:
* Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
* Body [invoker register body] * Send **GET** to **https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/getauth**
* Include basic Auth Header with Admin user/password
* Retrieve **access_token** and the urls needed for next requests from response body [user_getauth_response_body_example]
3. Obtain Access Token: 3. Onboard Invoker:
* 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**
* Send POST to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers * Reference Request Body: [invoker onboarding body]
* Reference Request Body: [invoker onboarding body] * "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker.
* "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker. * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token})
* Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token})
### Checks to ensure onboarding ### Checks to ensure onboarding
1. Response to Register:
1. **201 Created**
2. Response to Get Auth: 2. Response to Get Auth:
1. **200 OK** 1. **200 OK**
...@@ -33,20 +66,21 @@ ...@@ -33,20 +66,21 @@
* onboardingInformation->apiInvokerCertificate must contain the public key signed. * 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 Header **Location** must be received with URI to new resource created, following this structure: *{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}*
### Example Flow
![Flow](../../../images/flows/07_Invoker_Onboarding.png)
## Register a Provider ## Register a Provider
### Steps to Perform operation ### Steps to Perform operation
1. Create public and private key at provider for provider itself and each function (apf, aef and amf) 1. Create public and private key at provider for provider itself and each function (apf, aef and amf)
2. Register of Provider at CCF: 2. Retrieve access_token by User:
* Send POST to *http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register*
* body [provider register body]
3. Obtain Access Token: * Send **GET** to **https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/getauth**
* Send POST to *http://{CAPIF_HOSTNAME}/getauth* * Include basic Auth Header with Admin user/password
* Body [provider getauth body] * Retrieve **access_token** and the urls needed for next requests from response body [user_getauth_response_body_example]
3. Register Provider:
4. Register Provider:
* Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations* * Send POST *https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations*
* body [provider request body] * body [provider request body]
* Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token}) * Send at Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token})
...@@ -68,20 +102,17 @@ ...@@ -68,20 +102,17 @@
2. **apiProvCert** under **regInfo** is set properly 2. **apiProvCert** under **regInfo** is set properly
4. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}* 4. Location Header must contain the new resource URL *{apiRoot}/api-provider-management/v1/registrations/{registrationId}*
### Example Flow
![Flow](../../../images/flows/07_Invoker_Onboarding.png)
[user_registration_body]: ./user_registration_body.json "User Registration Body"
[user_getauth_response_body_example]: ./user_getauth_response_body_example.json "User GetAuth response Body Example"
[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 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" [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 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 [Return To All Test Plans]: ../README.md
{
"access_token": "eyJhbGciOiJS...",
"ca_root": "-----BEGIN CERTIFICATE----- ...",
"ccf_api_onboarding_url": "api-provider-management/v1/registrations",
"ccf_discover_url": "service-apis/v1/allServiceAPIs?api-invoker-id=",
"ccf_onboarding_url": "api-invoker-management/v1/onboardedInvokers",
"ccf_publish_url": "published-apis/v1/<apfId>/service-apis",
"ccf_security_url": "capif-security/v1/trustedInvokers/<apiInvokerId>",
"message": "Token and CA root returned successfully"
}
\ No newline at end of file
{
"username": "customUser",
"password": "password",
"description": "description",
"email": "customuser@telefonica.com"
}
\ No newline at end of file
...@@ -74,6 +74,8 @@ extra: ...@@ -74,6 +74,8 @@ extra:
nav: nav:
- Overview: - Overview:
- Introduction: index.md - Introduction: index.md
- Release Notes: releasenotes.md
- Architecture: architecture.md
- Getting Started: - Getting Started:
- How to Run: ./gettingstarted/howtorun.md - How to Run: ./gettingstarted/howtorun.md
- Testing: - Testing:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment