Skip to content

Commit fc6b021

Browse files
committed
DSS0210,A2-7-2,7 OIR
1 parent 2464516 commit fc6b021

File tree

6 files changed

+692
-6
lines changed

6 files changed

+692
-6
lines changed

monitoring/prober/infrastructure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
100100
resource_type_code_descriptions: Dict[ResourceType, str] = {}
101101

102102

103-
# Next code: 381
103+
# Next code: 382
104104
def register_resource_type(code: int, description: str) -> ResourceType:
105105
"""Register that the specified code refers to the described resource.
106106

monitoring/uss_qualifier/scenarios/astm/utm/dss/authentication/authentication_validation.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,138 @@ it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../require
173173
If the DSS does not allow searching for subscriptions when valid credentials are presented,
174174
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.
175175

176+
### Operational intents endpoints authentication test step
177+
178+
#### 🛑 Unauthorized requests return the proper error message body check
179+
180+
If the DSS under test does not return a proper error message body when an unauthorized request is received,
181+
it fails to properly implement the OpenAPI specification that is part of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
182+
183+
#### 🛑 Create operational intent reference with missing credentials check
184+
185+
If the DSS under test allows the creation of an operational intent without any credentials being presented,
186+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
187+
188+
#### 🛑 Create operational intent reference with invalid credentials check
189+
190+
If the DSS under test allows the creation of an operational intent with credentials that are well-formed but invalid,
191+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
192+
193+
#### 🛑 Create operational intent reference with missing scope check
194+
195+
If the DSS under test allows the creation of an operational intent with valid credentials but a missing scope,
196+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
197+
198+
#### 🛑 Create operational intent reference with incorrect scope check
199+
200+
If the DSS under test allows the creation of an operational intent with valid credentials but an incorrect scope,
201+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
202+
203+
#### 🛑 Create operational intent reference with valid credentials check
204+
205+
If the DSS does not allow the creation of an operational intent when valid credentials are presented,
206+
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
207+
208+
#### 🛑 Get operational intent reference with missing credentials check
209+
210+
If the DSS under test allows the fetching of an operational intent without any credentials being presented,
211+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
212+
213+
#### 🛑 Get operational intent reference with invalid credentials check
214+
215+
If the DSS under test allows the fetching of an operational intent with credentials that are well-formed but invalid,
216+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
217+
218+
#### 🛑 Get operational intent reference with missing scope check
219+
220+
If the DSS under test allows the fetching of an operational intent with valid credentials but a missing scope,
221+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
222+
223+
#### 🛑 Get operational intent reference with incorrect scope check
224+
225+
If the DSS under test allows the fetching of an operational intent with valid credentials but an incorrect scope,
226+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
227+
228+
#### 🛑 Get operational intent reference with valid credentials check
229+
230+
If the DSS does not allow fetching an operational intent when valid credentials are presented,
231+
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
232+
233+
#### 🛑 Mutate operational intent reference with missing credentials check
234+
235+
If the DSS under test allows the mutation of an operational intent without any credentials being presented,
236+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
237+
238+
#### 🛑 Mutate operational intent reference with invalid credentials check
239+
240+
If the DSS under test allows the mutation of an operational intent with credentials that are well-formed but invalid,
241+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
242+
243+
#### 🛑 Mutate operational intent reference with missing scope check
244+
245+
If the DSS under test allows the mutation of an operational intent with valid credentials but a missing scope,
246+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
247+
248+
#### 🛑 Mutate operational intent reference with incorrect scope check
249+
250+
If the DSS under test allows the mutation of an operational intent with valid credentials but an incorrect scope,
251+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
252+
253+
#### 🛑 Mutate operational intent reference with valid credentials check
254+
255+
If the DSS does not allow the mutation of an operational intent when valid credentials are presented,
256+
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
257+
258+
#### 🛑 Delete operational intent reference with missing credentials check
259+
260+
If the DSS under test allows the deletion of an operational intent without any credentials being presented,
261+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
262+
263+
#### 🛑 Delete operational intent reference with invalid credentials check
264+
265+
If the DSS under test allows the deletion of an operational intent with credentials that are well-formed but invalid,
266+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
267+
268+
#### 🛑 Delete operational intent reference with missing scope check
269+
270+
If the DSS under test allows the deletion of an operational intent with valid credentials but a missing scope,
271+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
272+
273+
#### 🛑 Delete operational intent reference with incorrect scope check
274+
275+
If the DSS under test allows the deletion of an operational intent with valid credentials but an incorrect scope,
276+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
277+
278+
#### 🛑 Delete operational intent reference with valid credentials check
279+
280+
If the DSS does not allow the deletion of an operational intent when valid credentials are presented,
281+
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
282+
283+
#### 🛑 Search operational intent references with missing credentials check
284+
285+
If the DSS under test allows searching for operational intents without any credentials being presented,
286+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
287+
288+
#### 🛑 Search operational intent references with invalid credentials check
289+
290+
If the DSS under test allows searching for operational intents with credentials that are well-formed but invalid,
291+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
292+
293+
#### 🛑 Search operational intent references with missing scope check
294+
295+
If the DSS under test allows searching for operational intents with valid credentials but a missing scope,
296+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
297+
298+
#### 🛑 Search operational intent references with incorrect scope check
299+
300+
If the DSS under test allows searching for operational intents with valid credentials but an incorrect scope,
301+
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.
302+
303+
#### 🛑 Search operational intent references with valid credentials check
304+
305+
If the DSS does not allow searching for operational intents when valid credentials are presented,
306+
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
307+
176308
## [Cleanup](../clean_workspace.md)
177309

178310
The cleanup phase of this test scenario removes the subscription with the known test ID if it has not been removed before.

monitoring/uss_qualifier/scenarios/astm/utm/dss/authentication/authentication_validation.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
)
77

88
from monitoring.monitorlib.auth import InvalidTokenSignatureAuth
9+
from monitoring.monitorlib.fetch import QueryError
910
from monitoring.monitorlib.geotemporal import Volume4D
1011
from monitoring.monitorlib.infrastructure import UTMClientSession
1112
from monitoring.prober.infrastructure import register_resource_type
@@ -18,6 +19,8 @@
1819
from monitoring.uss_qualifier.scenarios.astm.utm.dss.authentication.generic import (
1920
GenericAuthValidator,
2021
)
22+
from monitoring.uss_qualifier.scenarios.astm.utm.dss.authentication.oir_api_validator import \
23+
OperationalIntentRefAuthValidator
2124
from monitoring.uss_qualifier.scenarios.astm.utm.dss.authentication.sub_api_validator import (
2225
SubscriptionAuthValidator,
2326
)
@@ -37,7 +40,7 @@ class AuthenticationValidation(TestScenario):
3740
"""
3841

3942
SUB_TYPE = register_resource_type(
40-
380, "Subscription, Operational Entity Id, Constraint"
43+
381, "Subscription, Operational Entity Id, Constraint"
4144
)
4245

4346
# Reuse the same ID for every type of entity.
@@ -126,6 +129,17 @@ def __init__(
126129
test_missing_scope=self._test_missing_scope,
127130
)
128131

132+
self._oir_validator = OperationalIntentRefAuthValidator(
133+
scenario=self,
134+
generic_validator=generic_validator,
135+
dss=self._dss,
136+
test_id=self._test_id,
137+
planning_area=self._planning_area,
138+
planning_area_volume4d=self._planning_area_volume4d,
139+
no_auth_session=self._no_auth_session,
140+
invalid_token_session=self._invalid_token_session,
141+
)
142+
129143
def run(self, context: ExecutionContext):
130144
self.begin_test_scenario(context)
131145
self._setup_case()
@@ -146,8 +160,15 @@ def run(self, context: ExecutionContext):
146160

147161
self.begin_test_step("Subscription endpoints authentication")
148162
self._sub_validator.verify_sub_endpoints_authentication()
163+
149164
self.end_test_step()
150165

166+
self.begin_test_step("Operational intents endpoints authentication")
167+
self._oir_validator.verify_oir_endpoints_authentication()
168+
self.end_test_step()
169+
170+
# TODO consider adding test cases for:
171+
# - valid credentials without the required scopes
151172
self.end_test_case()
152173
self.end_test_scenario()
153174

@@ -167,6 +188,20 @@ def _ensure_clean_workspace_step(self):
167188
self.end_test_step()
168189

169190
def _ensure_test_entities_dont_exist(self):
191+
192+
# Drop OIR's first: subscriptions may be tied to them and can't be deleted
193+
# as long as they exist
194+
# TODO migrate the below to use existing test fragments or add it to them
195+
try:
196+
oir, q = self._dss.get_op_intent_reference(self._test_id)
197+
self.record_query(q)
198+
self._dss.delete_op_intent(oir.id, oir.ovn)
199+
except QueryError as qe:
200+
if qe.queries[0].response.status_code == 404:
201+
pass # All is good
202+
else:
203+
raise qe
204+
# TODO confirm this is the way we want to be handling expected 4XX errors
170205
test_step_fragments.cleanup_sub(self, self._dss, self._test_id)
171206

172207
def _ensure_no_active_subs_exist(self):

0 commit comments

Comments
 (0)