-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Test] Replace all mock authentication with concrete objects #86424
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes in this PR enables marking the Authentication class to final in a future PR as part of the overall plan for closing down Authentication.
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
Member
Author
|
@elasticmachine update branch |
| queryApiKeyRequest.setFilterForCurrentUser(); | ||
| assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, queryApiKeyRequest, authentication), is(true)); | ||
| assertThat(kibanaRole.cluster().check(QueryApiKeyAction.NAME, queryApiKeyRequest, authentication), is(true)); | ||
|
|
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
albertzaharovits
approved these changes
May 6, 2022
Contributor
albertzaharovits
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Member
Author
|
@elasticmachine run elasticsearch-ci/part-1-fips |
ywangd
added a commit
to ywangd/elasticsearch
that referenced
this pull request
May 7, 2022
Internal users bypass operator check. So we should not use them for operator check test. Relates: elastic#86424 Resolves: elastic#86530
ywangd
added a commit
to ywangd/elasticsearch
that referenced
this pull request
May 9, 2022
This PR marks the Authentication class to be final which is the last step of locking down the Authentication class. The Authentication class is basically a record class and it has internal logics on what values can or cannot be used together. We don't expect it to be extended by any subclasses and a concrete object should always be created for tests instead of mocking. Relates: elastic#86424 Relates: elastic#86206
ywangd
added a commit
that referenced
this pull request
May 17, 2022
ywangd
added a commit
that referenced
this pull request
May 17, 2022
This PR marks the Authentication class to be final which is the last step of locking down the Authentication class. The Authentication class is basically a record class and it has internal logics on what values can or cannot be used together. We don't expect it to be extended by any subclasses and a concrete object should always be created for tests instead of mocking. Relates: #86424 Relates: #86206
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.3.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes in this PR enables marking the Authentication class to final in
a future PR as part of the overall plan for closing down Authentication.
Relates: #86206