Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] DSS0210,1b confirm subscription manager is synced #560

Merged

Conversation

Shastick
Copy link
Contributor

Indirectly check that the manager of a subscription is synchronized across a DSS deployment by attempting to delete the a subscription from a DSS to which the subscription was synchronized to, using separate credentials.

Note that this only checks the case where the wrong credentials are used: confirming that deletion through any DSS works will be added with #550

Resolves #548

@Shastick Shastick requested a review from barroco March 15, 2024 08:19

##### Separate subscription

Note that the subscription (or 'sub' claim, not to be confused with an SCD DSS subscription) of the token that will be obtained for this resource
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sub is short for "subject" rather than "subscription"

Checks that the manager of a subscription is properly synchronized across all DSS instances.

This is done by means of using a separate set of credentials to create a subscription on the primary DSS,
and then verifying that the main credentials are not able to mutate this subscription via one of the secondary DSS instances
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this check will be repeated for each instance?

Suggested change
and then verifying that the main credentials are not able to mutate this subscription via one of the secondary DSS instances
and then verifying that the main credentials are not able to mutate this subscription via any of the secondary DSS instances

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

@@ -63,6 +66,7 @@ def __init__(
other_instances: DSSInstancesResource,
id_generator: IDGeneratorResource,
planning_area: PlanningAreaResource,
second_utm_auth: Optional[AuthAdapterResource],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a default value (presumably None) to actually be considered optional by the framework

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I get why certain things confused me now. Thanks.


Verify that a subscription can be created on the primary DSS.

#### 🛑 Subscription deletion with different non-managing credentials on secondary DSS fails check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this check fails, doesn't that mean the subscription has been deleted so we should be able to simply proceed with the rest of the test (after skipping the next step since the subscription is already deleted)? If so, this should probably be a Medium-severity issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

if deleted_sub.status_code != 403:
check.record_failed(
"Subscription deletion with main credentials did not fail",
details=f"Subscription deletion with main credentials failed with status code {deleted_sub.status_code}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
details=f"Subscription deletion with main credentials failed with status code {deleted_sub.status_code}",
details=f"Subscription deletion with main credentials did not fail with the expected status code of 403; instead returned status code {deleted_sub.status_code}",

@@ -87,6 +91,7 @@ def __init__(
]

self._sub_id = id_generator.id_factory.make_id(self.SUB_TYPE)
self._acl_sub_id = self._sub_id[:-1] + "1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not make ad-hoc IDs; the reason to identify the purpose of the ID when calling make_id is to allow people to reverse-lookup the test that caused a particular object to be added to the DSS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side question for situations where we might want to generate a dynamic (or configurable) number of test IDs: could we update the reverse lookup logic to support derived IDs where we increment the last block of zeroes on the ID?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that makes sense. And IDs without reverse lookup are not the most important issue to deal with -- I just want to avoid adding more tech debt when practical.

@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch 2 times, most recently from 0e0cac3 to 7dbf130 Compare March 19, 2024 11:28
@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch from 9dcb897 to 849b534 Compare March 19, 2024 16:48
Copy link
Member

@BenjaminPelletier BenjaminPelletier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more comments on documentation but then I think this one's ready to go


This second set of credentials is required to validate that the DSS properly synchronizes the manager of a subscription to other DSS instances.

The participant under test is responsible for providing this second set of credentials along the primary ones used in most other scenarios.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test designer sets up the configuration which provides these resources and is therefore responsible for providing any needed resources; "participants" are the subjects of the test (e.g., USSs under test) and would not provide credentials or any other resource (though they would communicate with the test designer to ensure the test designer specifies the URLs of the USS under test correctly in the environmental resources).

Suggested change
The participant under test is responsible for providing this second set of credentials along the primary ones used in most other scenarios.
The test designer should provide this second set of credentials when full testing of manager synchronization behavior is desired.

Comment on lines 38 to 39
For the purpose of this scenario, these credentials must be allowed to create, modify and delete subscriptions on the DSS,
as well as querying them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement is redundant with the "Required scope" section since a scope determines what actions a client is allowed to perform. So, I think these lines can be removed (otherwise, we would need to explain how someone would know if the credentials are allowed to create, modify and delete subscriptions in the DSS as well as querying them)


* `utm.strategic_coordination`

##### Separate subscription
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate subject?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my, yes indeed that needs fixing too.

@@ -145,3 +199,8 @@ If a DSS returns a subscription that was previously successfully deleted from th
either one of the primary DSS or the DSS that returned the subscription is in violation of **[astm.f3548.v21.DSS0210,1a](../../../../../requirements/astm/f3548/v21.md)**.

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

This step ensures that no subscriptions with the known test IDs exists in the DSS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
This step ensures that no subscriptions with the known test IDs exists in the DSS.
This step ensures that no subscriptions with the known test IDs remain in the DSS by deleting them at this point if they do exist.

@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch from 849b534 to 2f4de7e Compare March 20, 2024 21:07
@Shastick
Copy link
Contributor Author

Shastick commented Mar 20, 2024

Just a few more comments on documentation but then I think this one's ready to go

Thanks!

While starting to integrate with the lastest state of main, I remembered that the subscription synchronization scenario still needed to be adapted to the conventions we converged to in #535:

I did this in #570. The present PR should probably come after it as it.

(Note: the present PR rebases without conflict, but some check names unrelated to this PR need to be changed)

@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch 2 times, most recently from 9df3732 to db909ca Compare March 20, 2024 21:19
@Shastick Shastick marked this pull request as draft March 20, 2024 23:24
@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch from db909ca to 8a8f82b Compare March 21, 2024 08:16
@Shastick Shastick marked this pull request as ready for review March 21, 2024 10:36
@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch from 8a8f82b to 0549f93 Compare March 21, 2024 10:39
@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch 3 times, most recently from 6433875 to 9b46e71 Compare March 21, 2024 16:24
@Shastick Shastick force-pushed the dss0210-sub-manager-synced branch from 3ef83fd to 26c7ed6 Compare March 22, 2024 15:40
@BenjaminPelletier BenjaminPelletier merged commit 951bf95 into interuss:main Mar 22, 2024
9 checks passed
@Shastick Shastick deleted the dss0210-sub-manager-synced branch March 22, 2024 16:37
github-actions bot added a commit that referenced this pull request Mar 22, 2024
* [uss_qualifier] DSS0210,1b confirm subscription manager is synced

* latest PR comments

* 2nd round of review 951bf95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DSS0210,1b – check that replicated SCD subscriptions retain their manager (standalone)
2 participants