Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# 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.
## 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"