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] expand the authentication validation scenario to include constraint reference endpoints #690

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

Shastick
Copy link
Contributor

@Shastick Shastick commented May 10, 2024

This is heavily inspired from the existing validation logic for operational intent references.

Some additional updates:

  • scopes for any endpoint group may be missing without the whole scenario being skipped
  • if all scopes are missing (ie, impossible to test any group) then a MissingResourceError is raised (which should cause the scenario to be skipped entirely)
  • added a validation step to the utm_implementation_us configuration to make the expected number of skipped scenarios explicit, which should allow us to detect if scenarios suddenly start being skipped when we don't expect it.

Note: this also moves the instantiations of the authentication validator classes just before each validator is run, as they depend on the current time.

@Shastick Shastick force-pushed the constraint-ref-auth branch from 9db0eca to a26fbdc Compare August 2, 2024 11:02
@Shastick Shastick marked this pull request as ready for review August 2, 2024 12:29
@Shastick Shastick requested a review from mickmis August 2, 2024 12:29
@Shastick Shastick force-pushed the constraint-ref-auth branch from a26fbdc to 9bb0ab2 Compare August 5, 2024 07:28
Comment on lines 23 to 24
- `utm.constraint_management`
- `utm.constraint_processing`
Copy link
Member

Choose a reason for hiding this comment

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

Making these required makes this scenario unusable in jurisdictions that don't use these features (which is all of them I'm aware of right now). Probably the most important CI configuration currently is utm_implementation_us as it parallels a test configuration in active use for actual regulatory compliance in the US, and this causes the entire scenario to be skipped in that configuration. We should probably add a validation criterion to that configuration (and probably others) that the count of skipped actions doesn't exceed the number of actions we expect to be skipped -- that would catch newly-skipped scenarios like this.

Each of these scopes should be optional (and then the validation for them not performed if not provided), or else split this scenario into strategic coordination (existing), constraint management, and constraint processing.

Copy link
Contributor Author

@Shastick Shastick Aug 5, 2024

Choose a reason for hiding this comment

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

Ah yes, that's an oversight, thank you for pointing it out. I'll:

  • make the relevant scopes (utm.constraint_management, utm.constraint_processing) optional and make sure utm_implementation_us properly runs
  • possibly make the required scope for any endpoint group optional
  • add a validation criterion to utm_implementation_us

@@ -317,6 +318,146 @@ it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../require
If the DSS does not allow searching for operational intents when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.

### Constraint reference endpoints authentication test step
Copy link
Member

Choose a reason for hiding this comment

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

Probably not the highest priority for adjustment, but It seems like the "steps" in this scenario should actually be "cases". A step is supposed to be a single logical action (do one thing), reflecting what a manual checkout test card would look like ("(step 1) Ok, now we're going to X -- did things Q and P happen? (step 2) Now we're going Y -- did things R and S happen?"). I would imagine a good test case would be "test authentication of all the constraint management endpoints", and then each testing of each constraint management endpoint would be a test step (or, testing of each constraint management endpoint in a particular way would be a test step).

Copy link
Contributor Author

@Shastick Shastick Aug 5, 2024

Choose a reason for hiding this comment

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

This makes sense. it might be possible to easily do this as part of this PR, as I need to handle the optional utm.constraint_processing scopes, but I'm not entirely sure yet.

(Replacing the current steps with a test case having a single step would be easy in any case: I might keep splitting each test case into proper steps for later)

I created #742 to keep track of it in any case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given the current priorities I'll leave the splitting into separate test cases for later.

@mickmis mickmis removed their request for review August 6, 2024 09:41
@Shastick Shastick marked this pull request as draft August 6, 2024 13:49
@Shastick Shastick force-pushed the constraint-ref-auth branch 3 times, most recently from 0e0cf17 to ed0ff98 Compare August 7, 2024 07:57
@Shastick
Copy link
Contributor Author

Shastick commented Aug 7, 2024

Updated the PR: the various endpoint groups are now only optionally tested when the relevant scopes are available.

The scenario now runs as part of the utm_implementation_us configuration and skips the constraints references endpoints (I also added a validation step to the relevant configuration)

2024-08-07 07:23:07.532 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: missing_scope -> Missing scope testing disabled.
2024-08-07 07:23:07.532 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: scd -> Testing Strategic Coordination endpoints (Subscriptions and OIRs)
2024-08-07 07:23:07.532 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: scd_wrong_scope -> Incorrect scope testing enabled with scope interuss.flight_planning.direct_automated_test.
2024-08-07 07:23:07.763 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: constraints -> Skipping Constraint Reference endpoints
2024-08-07 07:23:07.763 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: availability -> Testing Availability endpoints
2024-08-07 07:23:07.763 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: availability_wrong_scope -> Incorrect scope testing enabled for availability endpoints with scope interuss.flight_planning.direct_automated_test.

@Shastick Shastick force-pushed the constraint-ref-auth branch from ed0ff98 to db7385b Compare August 7, 2024 08:01
@Shastick Shastick marked this pull request as ready for review August 7, 2024 08:01
@Shastick Shastick force-pushed the constraint-ref-auth branch from db7385b to 427263f Compare August 7, 2024 08:06
@Shastick
Copy link
Contributor Author

Shastick commented Aug 7, 2024

@BenjaminPelletier this PR ends up mixing two or three things now, some of them have been split:

(Will reopen once they are merged and integrated)

@Shastick
Copy link
Contributor Author

Ready for review: locally, using the f3548_self_contained configuration, all endpoints are tested:

2024-08-13 07:06:38.056 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: missing_scope -> Missing scope testing enabled.
2024-08-13 07:06:38.056 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: scd -> Testing Strategic Coordination endpoints (Subscriptions and OIRs)
2024-08-13 07:06:38.056 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: scd_wrong_scope -> Incorrect scope testing enabled with scope interuss.flight_planning.direct_automated_test.
2024-08-13 07:06:38.357 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: availability -> Testing Availability endpoints
2024-08-13 07:06:38.358 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: availability_wrong_scope -> Incorrect scope testing enabled for availability endpoints with scope interuss.flight_planning.direct_automated_test.
2024-08-13 07:06:38.402 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: constraints -> Testing Constraint Reference endpoints
2024-08-13 07:06:38.402 | INFO     | monitoring.uss_qualifier.scenarios.scenario:record_note:316 - Note: constraints_wrong_scope -> Incorrect scope testing enabled with scope interuss.flight_planning.direct_automated_test.

@Shastick Shastick force-pushed the constraint-ref-auth branch from ed3c9a9 to 857279e Compare August 20, 2024 14:28
@Shastick Shastick force-pushed the constraint-ref-auth branch from 857279e to b465580 Compare August 21, 2024 05:01
Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

Some minor comments, otherwise LGTM.

#### 🛑 Create constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

I believe this should be:

Suggested change
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,3](../../../../../requirements/astm/f3548/v21.md)**.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor

Choose a reason for hiding this comment

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

Still 1?

#### 🛑 Get constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

Suggested change
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,3](../../../../../requirements/astm/f3548/v21.md)**.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: no checking of the get response format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Added to the validator.

Copy link
Contributor

Choose a reason for hiding this comment

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

Still 1?

#### 🛑 Delete constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

Suggested change
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.
it is in violation of **[astm.f3548.v21.DSS0005,3](../../../../../requirements/astm/f3548/v21.md)**.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, no checking of delete response format?

Copy link
Contributor

Choose a reason for hiding this comment

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

Still 1?

@Shastick Shastick force-pushed the constraint-ref-auth branch from f435b47 to 09b67b3 Compare August 23, 2024 15:34
@Shastick Shastick requested a review from mickmis August 23, 2024 15:35
Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

Could you fix the missed requirements? Otherwise LGTM thanks!

#### 🛑 Delete constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

Still 1?

#### 🛑 Get constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

Still 1?

#### 🛑 Create constraint reference with valid credentials check

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

Choose a reason for hiding this comment

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

Still 1?

@Shastick
Copy link
Contributor Author

Could you fix the missed requirements? Otherwise LGTM thanks!

Thanks for catching them, they did not make it into the previous commit. Should be correct now.

@mickmis mickmis merged commit 4f4a63a into interuss:main Aug 27, 2024
20 checks passed
@Shastick Shastick deleted the constraint-ref-auth branch August 27, 2024 15:12
github-actions bot added a commit that referenced this pull request Aug 27, 2024
…ude constraint reference endpoints (#690)

* [uss_qualifier] constraint reference endpoint authentication checks

* comments

* correct spec number 4f4a63a
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.

3 participants