Skip to content

Commit

Permalink
DSS0210,A2-7-2,7 OIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Feb 22, 2024
1 parent 57e5057 commit b1ea57a
Show file tree
Hide file tree
Showing 15 changed files with 524 additions and 389 deletions.
57 changes: 53 additions & 4 deletions monitoring/uss_qualifier/resources/astm/f3548/v21/planning_area.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import datetime
from typing import List, Dict, Any, Optional, Self
from typing import List, Optional

from implicitdict import ImplicitDict, StringBasedDateTime
from uas_standards.astm.f3548.v21.api import Volume4D
from implicitdict import ImplicitDict
from uas_standards.astm.f3548.v21.api import (
EntityOVN,
OperationalIntentState,
UssBaseURL,
EntityID,
PutOperationalIntentReferenceParameters,
ImplicitSubscriptionParameters,
)

from monitoring.monitorlib.geo import LatLngPoint, make_latlng_rect, Volume3D, Polygon
from monitoring.monitorlib.geo import make_latlng_rect, Volume3D
from monitoring.monitorlib.geotemporal import Volume4D
from monitoring.monitorlib.temporal import Time
from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import (
SubscriptionParams,
)
Expand Down Expand Up @@ -52,6 +61,46 @@ def get_new_subscription_params(
notify_for_constraints=notify_for_constraints,
)

def get_new_operational_intent_ref_params(
self,
key: List[EntityOVN],
state: OperationalIntentState,
uss_base_url: UssBaseURL,
time_start: datetime.datetime,
time_end: datetime.datetime,
subscription_id: Optional[EntityID],
implicit_sub_base_url: Optional[UssBaseURL] = None,
implicit_sub_for_constraints: Optional[bool] = None,
) -> PutOperationalIntentReferenceParameters:
"""
Build a PutOperationalIntentReferenceParameters object that can be used against the DSS OIR API.
The extents contained in these parameters contain a single 4DVolume, which may not be entirely realistic,
but is sufficient in situations where the content of the OIR is irrelevant as long as it is valid, such
as for testing authentication or parameter validation.
Note that this method allows building inconsistent parameters:
"""
return PutOperationalIntentReferenceParameters(
extents=[
Volume4D(
volume=self.volume,
time_start=Time(time_start),
time_end=Time(time_end),
).to_f3548v21()
],
key=key,
state=state,
uss_base_url=uss_base_url,
subscription_id=subscription_id,
new_subscription=ImplicitSubscriptionParameters(
uss_base_url=implicit_sub_base_url,
notify_for_constraints=implicit_sub_for_constraints,
)
if implicit_sub_base_url
else None,
)


class PlanningAreaResource(Resource[PlanningAreaSpecification]):
specification: PlanningAreaSpecification
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from .subscription_validation import SubscriptionValidation
from .subscription_simple import SubscriptionSimple
from .authentication_validation import AuthenticationValidation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .authentication_validation import AuthenticationValidation
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Note that this does not cover authorization.

### dss

[`DSSInstanceResource`](../../../../resources/astm/f3548/v21/dss.py) to be tested in this scenario.
[`DSSInstanceResource`](../../../../../resources/astm/f3548/v21/dss.py) to be tested in this scenario.

### id_generator

[`IDGeneratorResource`](../../../../resources/interuss/id_generator.py) providing the Subscription ID for this scenario.
[`IDGeneratorResource`](../../../../../resources/interuss/id_generator.py) providing the Subscription ID for this scenario.

### planning_area

[`PlanningAreaResource`](../../../../resources/astm/f3548/v21/planning_area.py) describes the 3D volume in which entities will be created.
[`PlanningAreaResource`](../../../../../resources/astm/f3548/v21/planning_area.py) describes the 3D volume in which entities will be created.

## Setup test case

### [Ensure clean workspace test step](clean_workspace.md)
### [Ensure clean workspace test step](../clean_workspace.md)

This step ensures that no entity with the known test IDs exists in the DSS.

Expand All @@ -34,131 +34,131 @@ This test case ensures that the DSS properly authenticates requests to all its e

#### 🛑 Unauthorized requests return the proper error message body check

If the DSS under test does not return a proper error message body when an unauthorized request is received, it fails to properly implement the OpenAPI specification that is part of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
If the DSS under test does not return a proper error message body when an unauthorized request is received, it fails to properly implement the OpenAPI specification that is part of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create subscription with missing credentials check

If the DSS under test allows the creation of a subscription without any credentials being presented, it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
If the DSS under test allows the creation of a subscription without any credentials being presented, it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create subscription with invalid credentials check

If the DSS under test allows the creation of a subscription with credentials that are well-formed but invalid,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create subscription with missing scope check

If the DSS under test allows the creation of a subscription with valid credentials but a missing scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create subscription with incorrect scope check

If the DSS under test allows the creation of a subscription with valid credentials but an incorrect scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create subscription with valid credentials check

If the DSS does not allow the creation of a subscription when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Get subscription with missing credentials check

If the DSS under test allows the fetching of a subscription without any credentials being presented, it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
If the DSS under test allows the fetching of a subscription without any credentials being presented, it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Get subscription with invalid credentials check

If the DSS under test allows the fetching of a subscription with credentials that are well-formed but invalid,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Get subscription with missing scope check

If the DSS under test allows the fetching of a subscription with valid credentials but a missing scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Get subscription with incorrect scope check

If the DSS under test allows the fetching of a subscription with valid credentials but an incorrect scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Get subscription with valid credentials check

If the DSS does not allow fetching a subscription when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Mutate subscription with missing credentials check

If the DSS under test allows the mutation of a subscription without any credentials being presented,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Mutate subscription with invalid credentials check

If the DSS under test allows the mutation of a subscription with credentials that are well-formed but invalid,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Mutate subscription with missing scope check

If the DSS under test allows the mutation of a subscription with valid credentials but a missing scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Mutate subscription with incorrect scope check

If the DSS under test allows the mutation of a subscription with valid credentials but an incorrect scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Mutate subscription with valid credentials check

If the DSS does not allow the mutation of a subscription when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Delete subscription with missing credentials check

If the DSS under test allows the deletion of a subscription without any credentials being presented,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Delete subscription with invalid credentials check

If the DSS under test allows the deletion of a subscription with credentials that are well-formed but invalid,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Delete subscription with missing scope check

If the DSS under test allows the deletion of a subscription with valid credentials but a missing scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Delete subscription with incorrect scope check

If the DSS under test allows the deletion of a subscription with valid credentials but an incorrect scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Delete subscription with valid credentials check

If the DSS does not allow the deletion of a subscription when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Search subscriptions with missing credentials check

If the DSS under test allows searching for subscriptions without any credentials being presented,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Search subscriptions with invalid credentials check

If the DSS under test allows searching for subscriptions with credentials that are well-formed but invalid,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Search subscriptions with missing scope check

If the DSS under test allows searching for subscriptions with valid credentials but a missing scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Search subscriptions with incorrect scope check

If the DSS under test allows searching for subscriptions with valid credentials but an incorrect scope,
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Search subscriptions with valid credentials check

If the DSS does not allow searching for subscriptions when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**.

## [Cleanup](./clean_workspace.md)
## [Cleanup](../clean_workspace.md)

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

0 comments on commit b1ea57a

Please sign in to comment.