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
# 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.
## 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**:
Loading
Loading full blame…