Skip to content

Fix test in AnonymousUserIntegTests #82977

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

Merged

Conversation

albertzaharovits
Copy link
Contributor

All nodes should be using the same setting for AuthorizationService.ANONYMOUS_AUTHORIZATION_EXCEPTION_SETTING.

Fixes https://gradle-enterprise.elastic.co/s/5ms2ktf4h5s3i/console-log?task=:x-pack:plugin:security:internalClusterTest

@albertzaharovits albertzaharovits added >test Issues or PRs that are addressing/adding tests :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v8.1.0 labels Jan 24, 2022
@albertzaharovits albertzaharovits self-assigned this Jan 24, 2022
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Jan 24, 2022
@elasticmachine
Copy link
Collaborator

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

@albertzaharovits albertzaharovits merged commit 229784e into elastic:master Jan 24, 2022
@albertzaharovits albertzaharovits deleted the fix-anon-user-integ-test branch January 24, 2022 20:15
@albertzaharovits
Copy link
Contributor Author

Most likely this started manifesting when other test methods have been added to the test suite class.
The test method was seeing a different value for authorizationExceptionsEnabled from the nodes.
The test method is invoked on a different instance of AnonymousUserIntegTests than was used to construct the nodes, but the reasoning is still unclear because the test method is invoked by reflection.

In any case, the value should be static for the test suite.

ywangd added a commit to ywangd/elasticsearch that referenced this pull request Jan 24, 2022
Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

Thanks Albert! LGTM

The test was muted in #82972
I am unmuting it with #83003 and also resolving #82971

elasticsearchmachine pushed a commit that referenced this pull request Jan 25, 2022
The failure is fixed by #82977

Resolves: #82971
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Feb 1, 2022
All test cluster nodes should be using the same value for setting
ANONYMOUS_AUTHORIZATION_EXCEPTION_SETTING.
elasticsearchmachine pushed a commit that referenced this pull request Feb 1, 2022
* Fix test in AnonymousUserIntegTests #82977

All test cluster nodes should be using the same value for setting
ANONYMOUS_AUTHORIZATION_EXCEPTION_SETTING.

* [Test] Fix header value assertion for 401 error (#83037)

The WWW-Authenticate header is multi-valued. In rare cases, the first
value may not be the one beginning with "Basic". The PR makes the
assertion agnostic to the order and also asserts for all possible header
values.

Resolves: #83022

Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants