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
*** Settings ***
Resource /opt/robot-tests/tests/resources/common.resource
Library /opt/robot-tests/tests/libraries/bodyRequests.py
Library Collections
Resource /opt/robot-tests/tests/resources/common/basicRequests.robot
Resource ../../resources/common.resource
Test Setup Reset Testing Environment
Suite Teardown Reset Testing Environment
*** Variables ***
${AEF_ID_NOT_VALID} aef-example
${SERVICE_API_ID_NOT_VALID} not-valid
${API_INVOKER_NOT_VALID} not-valid
${NOTIFICATION_DESTINATION} http://robot.testing:1080
${API_VERSION_VALID} v1
${API_VERSION_NOT_VALID} v58
*** Test Cases ***
Get Log Entry
[Tags] capif_api_auditing_service-1
#Register APF
${register_user_info}= Provider Default Registration
Call Method ${CAPIF_USERS} update_capif_users_dicts ${register_user_info['resource_url'].path} ${AMF_PROVIDER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${PROVIDER_USERNAME}
# Publish one api
Publish Service Api ${register_user_info}
#Register INVOKER
${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding
Call Method ${CAPIF_USERS} update_capif_users_dicts ${url.path} ${INVOKER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${INVOKER_USERNAME}
${discover_response}= Get Request Capif
... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${INVOKER_USERNAME}
${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response}
# Create Log Entry
${request_body}= Create Log Entry ${register_user_info['aef_id']} ${register_user_info_invoker['api_invoker_id']} ${api_ids} ${api_names}
${resp_1}= Post Request Capif
... /api-invocation-logs/v1/${register_user_info['aef_id']}/logs
... json=${request_body}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AEF_PROVIDER_USERNAME}
${resp_2}= Get Request Capif
... /logs/v1/apiInvocationLogs?aef-id=${register_user_info['aef_id']}&api-invoker-id=${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AMF_PROVIDER_USERNAME}
# Check Results
Check Response Variable Type And Values ${resp_2} 200 InvocationLog
Length Should Be ${resp_2.json()["logs"]} 2
Get a log entry without entry created
[Tags] capif_api_auditing_service-2
#Register APF
${register_user_info}= Provider Default Registration
Call Method ${CAPIF_USERS} update_capif_users_dicts ${register_user_info['resource_url'].path} ${AMF_PROVIDER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${PROVIDER_USERNAME}
# Publish one api
Publish Service Api ${register_user_info}
#Register INVOKER
${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding
Call Method ${CAPIF_USERS} update_capif_users_dicts ${url.path} ${INVOKER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${INVOKER_USERNAME}
${resp_1}= Get Request Capif
... /logs/v1/apiInvocationLogs?aef-id=${register_user_info['aef_id']}&api-invoker-id=${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AMF_PROVIDER_USERNAME}
# Check Results
Check Response Variable Type And Values ${resp_1} 404 ProblemDetails
... title=Not Found
... status=404
... detail=aefId or/and apiInvokerId do not match any InvocationLogs
... cause=No log invocations found
Get a log entry withut aefid and apiInvokerId
[Tags] capif_api_auditing_service-3
#Register APF
${register_user_info}= Provider Default Registration
Call Method ${CAPIF_USERS} update_capif_users_dicts ${register_user_info['resource_url'].path} ${AMF_PROVIDER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${PROVIDER_USERNAME}
# Publish one api
Publish Service Api ${register_user_info}
#Register INVOKER
${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding
Call Method ${CAPIF_USERS} update_capif_users_dicts ${url.path} ${INVOKER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${INVOKER_USERNAME}
${discover_response}= Get Request Capif
... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${INVOKER_USERNAME}
${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response}
# Create Log Entry
${request_body}= Create Log Entry ${register_user_info['aef_id']} ${register_user_info_invoker['api_invoker_id']} ${api_ids} ${api_names}
${resp_1}= Post Request Capif
... /api-invocation-logs/v1/${AEF_ID_NOT_VALID}/logs
... json=${request_body}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AEF_PROVIDER_USERNAME}
${resp_2}= Get Request Capif
... /logs/v1/apiInvocationLogs
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AMF_PROVIDER_USERNAME}
# Check Results
Check Response Variable Type And Values ${resp_2} 400 ProblemDetails
... title=Bad Request
... status=400
... detail=aef_id and api_invoker_id parameters are mandatory
... cause=Mandatory parameters missing
Get Log Entry with apiVersion filter
[Tags] capif_api_auditing_service-4
#Register APF
${register_user_info}= Provider Default Registration
Call Method ${CAPIF_USERS} update_capif_users_dicts ${register_user_info['resource_url'].path} ${AMF_PROVIDER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${PROVIDER_USERNAME}
# Publish one api
Publish Service Api ${register_user_info}
#Register INVOKER
${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding
Call Method ${CAPIF_USERS} update_capif_users_dicts ${url.path} ${INVOKER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${INVOKER_USERNAME}
${discover_response}= Get Request Capif
... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${INVOKER_USERNAME}
${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response}
# Create Log Entry
${request_body}= Create Log Entry ${register_user_info['aef_id']} ${register_user_info_invoker['api_invoker_id']} ${api_ids} ${api_names}
${resp_1}= Post Request Capif
... /api-invocation-logs/v1/${register_user_info['aef_id']}/logs
... json=${request_body}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AEF_PROVIDER_USERNAME}
${resp_2}= Get Request Capif
... /logs/v1/apiInvocationLogs?aef-id=${register_user_info['aef_id']}&api-invoker-id=${register_user_info_invoker['api_invoker_id']}&api-version=${API_VERSION_VALID}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AMF_PROVIDER_USERNAME}
# Check Results
Check Response Variable Type And Values ${resp_2} 200 InvocationLog
Length Should Be ${resp_2.json()["logs"]} 1
Get Log Entry with no exist apiVersion filter
[Tags] capif_api_auditing_service-5
#Register APF
${register_user_info}= Provider Default Registration
Call Method ${CAPIF_USERS} update_capif_users_dicts ${register_user_info['resource_url'].path} ${AMF_PROVIDER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${PROVIDER_USERNAME}
# Publish one api
Publish Service Api ${register_user_info}
#Register INVOKER
${register_user_info_invoker} ${url} ${request_body}= Invoker Default Onboarding
Call Method ${CAPIF_USERS} update_capif_users_dicts ${url.path} ${INVOKER_USERNAME}
Call Method ${CAPIF_USERS} update_register_users ${INVOKER_USERNAME}
${discover_response}= Get Request Capif
... ${DISCOVER_URL}${register_user_info_invoker['api_invoker_id']}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${INVOKER_USERNAME}
${api_ids} ${api_names}= Get Api Ids And Names From Discover Response ${discover_response}
# Create Log Entry
${request_body}= Create Log Entry ${register_user_info['aef_id']} ${register_user_info_invoker['api_invoker_id']} ${api_ids} ${api_names}
${resp_1}= Post Request Capif
... /api-invocation-logs/v1/${register_user_info['aef_id']}/logs
... json=${request_body}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AEF_PROVIDER_USERNAME}
${resp_2}= Get Request Capif
... /logs/v1/apiInvocationLogs?aef-id=${register_user_info['aef_id']}&api-invoker-id=${register_user_info_invoker['api_invoker_id']}&api-version=${API_VERSION_NOT_VALID}
... server=${CAPIF_HTTPS_URL}
... verify=ca.crt
... username=${AMF_PROVIDER_USERNAME}
# Check Results
# Check Results
Check Response Variable Type And Values ${resp_2} 404 ProblemDetails
... title=Not Found
... status=404
... detail=Parameters do not match any log entry
... cause=No logs found