Skip to content

Fix mock object creation in DelegatePki HLRC test#84468

Merged
elasticsearchmachine merged 2 commits intoelastic:8.1from
tvernum:fix/test/84433-api-key-hlrc-response
Mar 1, 2022
Merged

Fix mock object creation in DelegatePki HLRC test#84468
elasticsearchmachine merged 2 commits intoelastic:8.1from
tvernum:fix/test/84433-api-key-hlrc-response

Conversation

@tvernum
Copy link
Copy Markdown
Contributor

@tvernum tvernum commented Mar 1, 2022

This test would create objects with an authentication_type of
"API_KEY", but with a real authentication realm (rather than the API
key synthetic realm).

It is not possible to create an object like that on the server, so the
test was asserting behaviour that cannot exist, and should not be
subject to test constraints.

This commit fixes the mock object creation to always create more
realistic objects.

Relates: #84396
Resolves: #84433

This test would create objects with an authentication_type of
"API_KEY", but with a real authentication realm (rather than the API
key synthetic realm).

It is not possible to create an object like that on the server, so the
test was asserting behaviour that cannot exist, and should not be
subject to test constraints.

This commit fixes the mock object creation to always create more
realistic objects.

Relates: elastic#84396
Resolves: elastic#84433
@tvernum tvernum added >test Issues or PRs that are addressing/adding tests :Data Management/Java High Level REST Client :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v8.1.1 labels Mar 1, 2022
@tvernum tvernum requested a review from ywangd March 1, 2022 01:35
@elasticmachine elasticmachine added Team:Data Management (obsolete) DO NOT USE. This team no longer exists. Team:Security Meta label for security team labels Mar 1, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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.

LGTM

I have a task to prevent creation of invalid Authentication on the server side which should help get rid of these problems (especially since we don't have HLRC in 8.2+). But it's a big changeset and I need find time for it.

@tvernum tvernum added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 1, 2022
@tvernum
Copy link
Copy Markdown
Contributor Author

tvernum commented Mar 1, 2022

@elasticmachine update branch

@elasticsearchmachine elasticsearchmachine merged commit 8ea44df into elastic:8.1 Mar 1, 2022
@tvernum tvernum deleted the fix/test/84433-api-key-hlrc-response branch March 1, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Data Management (obsolete) DO NOT USE. This team no longer exists. Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v8.1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants