-
Notifications
You must be signed in to change notification settings - Fork 164
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
DefaultContextResolver should respect the defaultRealm configuration #309
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3b549fb
apply fix
eric-maynard 9d3f890
autolint
eric-maynard 9961af5
be extra safe
eric-maynard 59bb502
simplify
eric-maynard 54e1a83
autolint
eric-maynard d1b8d93
rebase
eric-maynard 0373a5a
revert back to interface
eric-maynard 1a0ac4c
autolint
eric-maynard 90e4400
Merge branch 'main' into issue-281
eric-maynard 9eab509
Merge branch 'main' into issue-281
flyrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
Can we combine these two fields(
defaultRealm
,realmContextResolver
) to one? I don't see a reason to keep both of them. I'd prefer to keep the resolver, which may have different implementations.What we can do is to mimic the rate limiter. The default realm name can be picked up by the implementation itself, instead of setting a string field then pass it to the resolver.
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.
I'm confused by this suggestion; the linked issue is about users not being able to pass an explicit string default via the config. Are you suggesting that we remove the config?
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.
ah, I wasn't clear in the first place. I think we can combine these two configs to one.
To
With that, we don't have to keep two fields in the config class, and I think it is a nice way to manage the lifecycle of
realmContextResolver
. It could be immutable object without any setting methods.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.
If we made the above change, I think we don't have to make the interface changes in
RealmContextResolver
. We just need to add a constructor in the classDefaultContextResolver
like thisNot setter and getter are needed in this way. WDYT?
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.
Removing the default constructor is still a breaking change, so is this materially better?
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.
Also, to be clear, we are not just changing how this works for
DefaultContextResolver
but for allRealmContextResolver
implementationsThere 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.
It is cleaner solution unless the config
defaultRealm
would be used by other places thanRealmContextResolver
. Do we?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.
The
defaultRealm
is just the default realm used byRealmContextResolver
when the realm cannot be parsed from the requestThere 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.
Synced with @eric-maynard offline, we agreed on pushing this break change to another PR.