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

Remove redundant token BWC tests #89417

Merged

Conversation

n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented Aug 17, 2022

This PR removes YAML cluster upgrade tests for token backwards
compatibility. The Java REST test suite TokenBackwardsCompatibilityIT
fully covers all scenarios included in the YAML tests already. Due to
the complex test setup, and since this particular YAML test suite is
not meant to be tested with different clients, Java REST tests are more
appropriate.

The test suite we are removing is resource intensive, both in terms of
build times and maintenance, and as such not justified as a redundant
suite.

Relates: #77350

@n1v0lg n1v0lg added >test Issues or PRs that are addressing/adding tests :Security/Security Security issues without another label labels Aug 17, 2022
@n1v0lg n1v0lg self-assigned this Aug 17, 2022
@@ -1,130 +0,0 @@
---
"Create a token and reuse it across the upgrade":
Copy link
Contributor Author

@n1v0lg n1v0lg Aug 17, 2022

Choose a reason for hiding this comment

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

- match: { expires_in: 3600 }
- is_false: scope

# test refresh token (use it)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -1,180 +0,0 @@
---
"Get the indexed token and use if to authenticate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

- match: { hits.total: 8 }

---
"Get the indexed refreshed access token and use if to authenticate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

- match: { hits.total: 8 }

---
"Get the indexed refresh token and use it to get another access token and authenticate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Covered by: https://github.com/elastic/elasticsearch/blob/main/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java#L169

In the above Java REST test, we "verify new nodes can refresh tokens created by old nodes and vice versa" so the scenario of using an old token on a new node is covered

@@ -1,92 +0,0 @@
---
"Get the indexed token and use if to authenticate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

index: token_index

---
"Get the indexed refresh token and use if to get another access token and authenticate":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@n1v0lg
Copy link
Contributor Author

n1v0lg commented Aug 17, 2022

I will follow this PR up with an actual fix addressing #77350.

For the current PR, I just wanted another pair of eyes to confirm we are not losing coverage by dropping these.

@n1v0lg n1v0lg marked this pull request as ready for review August 17, 2022 11:37
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Aug 17, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the links to the tests with duplication

Copy link
Contributor

@albertzaharovits albertzaharovits left a comment

Choose a reason for hiding this comment

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

LGTM
I appreciate the effort to track down all these!

@n1v0lg n1v0lg merged commit 1403ab3 into elastic:main Aug 18, 2022
@n1v0lg n1v0lg deleted the remove-redundant-upgrade-tests-for-tokens branch August 18, 2022 12:10
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Aug 19, 2022
* upstream/main: (265 commits)
  Disable openid connect tests due to missing fixture (elastic#89478)
  Add periodic job for single processor node testing
  Updates to changelog processing after docs redesign (elastic#89463)
  Better support for multi cluster for run task (elastic#89442)
  Mute failing tests (elastic#89465)
  [ML] Performance improvements related to ECS Grok pattern usage (elastic#89424)
  Add source fallback support for date and date_nanos mapped types (elastic#89440)
  Reuse Info in lifecycle step (elastic#89419)
  feature: support metrics for multi value fields (elastic#88818)
  Upgrade OpenTelemetry API and remove workaround (elastic#89438)
  Remove LegacyClusterTaskResultActionListener (elastic#89459)
  Add YAML spec docs about matching errors (elastic#89370)
  Remove redundant cluster upgrade tests for auth tokens (elastic#89417)
  Return 400 error for GetUserPrivileges call with API keys (elastic#89333)
  User Profile - Detailed errors in hasPrivileges response (elastic#89224)
  Rollover min_* conditions docs and highlight (elastic#89434)
  REST tests for percentiles_bucket agg (elastic#88029)
  REST tests for cumulative pipeline aggs (elastic#88966)
  Clean-up file watcher keys. (elastic#89429)
  fix a typo in Security.java (elastic#89248)
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Security/Security Security issues without another label Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants