Skip to content

Commit f59e33d

Browse files
[uss_qualifier] Add USS credit for requirements enforced by DSS (#522)
* Add USS credit for requirements enforced by DSS * make format
1 parent 8c1d975 commit f59e33d

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ v1:
203203
specification:
204204
dss_instances:
205205
- participant_id: uss1
206+
user_participant_ids:
207+
# Participants using a DSS instance they do not provide should be listed as users of that DSS (so that they can take credit for USS requirements enforced by the DSS)
208+
- mock_uss # mock_uss uses this DSS instance; it does not provide its own instance
206209
base_url: http://dss.uss1.localutm
207210
has_private_address: true
208211
- participant_id: uss2

monitoring/uss_qualifier/configurations/dev/library/environment_containers.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ scd_dss_instances:
206206
specification:
207207
dss_instances:
208208
- participant_id: uss1
209+
user_participant_ids:
210+
- mock_uss
209211
base_url: http://dss.uss1.localutm
210212
has_private_address: true
211213
- participant_id: uss2

monitoring/uss_qualifier/configurations/dev/library/environment_localhost.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ scd_dss_instances:
206206
specification:
207207
dss_instances:
208208
- participant_id: uss1
209+
user_participant_ids:
210+
- mock_uss
209211
base_url: http://localhost:8082
210212
has_private_address: true
211213
- participant_id: uss2

monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class DSSInstanceSpecification(ImplicitDict):
5353
participant_id: str
5454
"""ID of the USS responsible for this DSS instance"""
5555

56+
user_participant_ids: Optional[List[str]]
57+
"""IDs of any participants using this DSS instance, apart from the USS responsible for this DSS instance."""
58+
5659
base_url: str
5760
"""Base URL for the DSS instance according to the ASTM F3548-21 API"""
5861

@@ -69,6 +72,7 @@ def __init__(self, *args, **kwargs):
6972

7073
class DSSInstance(object):
7174
participant_id: str
75+
user_participant_ids: List[str]
7276
base_url: str
7377
has_private_address: bool = False
7478
client: infrastructure.UTMClientSession
@@ -77,12 +81,14 @@ class DSSInstance(object):
7781
def __init__(
7882
self,
7983
participant_id: str,
84+
user_participant_ids: List[str],
8085
base_url: str,
8186
has_private_address: Optional[bool],
8287
auth_adapter: infrastructure.AuthAdapter,
8388
scopes_authorized: List[str],
8489
):
8590
self.participant_id = participant_id
91+
self.user_participant_ids = user_participant_ids
8692
self.base_url = base_url
8793
if has_private_address is not None:
8894
self.has_private_address = has_private_address
@@ -109,6 +115,7 @@ def with_different_auth(
109115
)
110116
return DSSInstance(
111117
participant_id=self.participant_id,
118+
user_participant_ids=self.user_participant_ids,
112119
base_url=self.base_url,
113120
has_private_address=self.has_private_address,
114121
auth_adapter=auth_adapter.adapter,
@@ -464,6 +471,10 @@ def get_instance(self, scopes_required: Dict[str, str]) -> DSSInstance:
464471
)
465472
return DSSInstance(
466473
self._specification.participant_id,
474+
self._specification.user_participant_ids
475+
if "user_participant_ids" in self._specification
476+
and self._specification.user_participant_ids
477+
else [],
467478
self._specification.base_url,
468479
self._specification.get("has_private_address"),
469480
self._auth_adapter.adapter,

monitoring/uss_qualifier/scenarios/astm/utm/op_intent_ref_access_control.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class OpIntentReferenceAccessControl(TestScenario):
3737
_dss: DSSInstance
3838
_pid: List[str]
3939

40+
# Participant IDs of users using this DSS instance
41+
_uids: List[str]
42+
4043
# The same DSS, available via a separate auth adapter
4144
_dss_separate_creds: DSSInstance
4245

@@ -64,6 +67,7 @@ def __init__(
6467
}
6568
self._dss = dss.get_instance(scopes)
6669
self._pid = [self._dss.participant_id]
70+
self._uids = self._dss.user_participant_ids
6771

6872
self._oid_1 = id_generator.id_factory.make_id(self.OP_INTENT_1)
6973
self._oid_2 = id_generator.id_factory.make_id(self.OP_INTENT_2)
@@ -407,7 +411,7 @@ def _ensure_credentials_are_different(self):
407411
def _check_mutation_on_non_owned_intent_fails(self):
408412
with self.check(
409413
"Non-owning credentials cannot modify operational intent",
410-
self._pid,
414+
self._pid + self._uids,
411415
) as check:
412416
try:
413417
# Attempt to update the state of the intent created with the main credentials using the second credentials
@@ -437,7 +441,7 @@ def _check_mutation_on_non_owned_intent_fails(self):
437441

438442
with self.check(
439443
"Non-owning credentials cannot modify operational intent",
440-
self._pid,
444+
self._pid + self._uids,
441445
) as check:
442446
try:
443447
# Attempt to update the base_url of the intent created with the main credentials using the second credentials
@@ -468,7 +472,7 @@ def _check_mutation_on_non_owned_intent_fails(self):
468472
# Try to delete
469473
with self.check(
470474
"Non-owning credentials cannot delete operational intent",
471-
self._pid,
475+
self._pid + self._uids,
472476
) as check:
473477
try:
474478
(_, _, dq) = self._dss_separate_creds.delete_op_intent(
@@ -510,7 +514,7 @@ def _check_mutation_on_non_owned_intent_fails(self):
510514

511515
with self.check(
512516
"Non-owning credentials cannot modify operational intent",
513-
self._pid,
517+
self._pid + self._uids,
514518
) as check:
515519
if op_1_current != self._current_ref_1:
516520
check.record_failed(

schemas/monitoring/uss_qualifier/resources/astm/f3548/v21/dss/DSSInstanceSpecification.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
"participant_id": {
2222
"description": "ID of the USS responsible for this DSS instance",
2323
"type": "string"
24+
},
25+
"user_participant_ids": {
26+
"description": "IDs of any participants using this DSS instance, apart from the USS responsible for this DSS instance.",
27+
"items": {
28+
"type": "string"
29+
},
30+
"type": [
31+
"array",
32+
"null"
33+
]
2434
}
2535
},
2636
"required": [

0 commit comments

Comments
 (0)