The Authentication class is now final#86544
Merged
ywangd merged 2 commits intoelastic:masterfrom May 17, 2022
Merged
Conversation
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
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
albertzaharovits
approved these changes
May 16, 2022
Contributor
albertzaharovits
left a comment
There was a problem hiding this comment.
LGTM
Well done pushing this through 🎊
Member
Author
|
@elasticmachine update branch |
ywangd
added a commit
to ywangd/elasticsearch
that referenced
this pull request
Jul 13, 2022
This PR is a follow-up of elastic#86246 to further clean up the Authentication class by: * Promoting usage of the Subject class. The User field and a few other related fields are now removed from Authentication. Relevant methods have their implementation replaced by using Subjects and same behaviours are retained. * Removed the temporary internal RunAsUser class. It essence is about wire serialisation which is now merged into Authentication itself. * Simplify serialisation of regular User object. All the complexities of handling inner user is now completely within the Authentication class itself. * Cosnolidate assertions in different places into a single method that is called in constructors. Also removed a few assertions because there is no RunAsUser class anymore and a User object is just a simple user. Relates: elastic#86246 Relates: elastic#86544
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jul 14, 2022
This PR is a follow-up of #86246 to further clean up the Authentication class by: * Promote usage of the Subject class. The User field and a few other related fields are now removed from Authentication. Relevant methods have their implementation replaced by using Subjects and same behaviours are retained. * Remove the temporary internal RunAsUser class. Its essence is about wire serialisation which is now merged into Authentication itself. * Simplify serialisation of regular User object. All the complexities of handling inner user is now completely within the Authentication class itself. * Consolidate assertions in different places into a single method that is called in constructors. Also removed a few assertions because there is no RunAsUser class anymore and a User object is just a simple user. Relates: #86246 Relates: #86544 Resolves: #80117
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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