-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
#842 #1414 AuthenticationOptions
in global configuration
#2114
base: develop
Are you sure you want to change the base?
#842 #1414 AuthenticationOptions
in global configuration
#2114
Conversation
@jlukawska, very interesting PR, I would love to review it, ok @raman-m? |
No objections! But I'll review later this/next week... |
AuthenticationOptions
in global configuration
AuthenticationOptions
in global configurationAuthenticationOptions
in global configuration
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.
Excellent work, Jolanta!
Everything looks good; I've only added a few minor suggestions.
The main issue is the lack of documentation. However, you can reintroduce the draft docs from the previous PR, and then I will go over the docs and suggest possible revisions.
src/Ocelot/Configuration/Validator/FileAuthenticationOptionsValidator.cs
Outdated
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/Validation/FileAuthenticationOptionsValidatorTests.cs
Outdated
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/Validation/FileAuthenticationOptionsValidatorTests.cs
Outdated
Show resolved
Hide resolved
test/Ocelot.UnitTests/Configuration/Validation/FileAuthenticationOptionsValidatorTests.cs
Outdated
Show resolved
Hide resolved
.Then(x => x.ThenTheResultIsNotValid()) | ||
.And(x => ThenTheErrorMessageAtPositionIs(0, $"AuthenticationOptions: AuthenticationProviderKey:'JwtLads',AuthenticationProviderKeys:[]," + | ||
$"AllowedScopes:[] is unsupported authentication provider")) | ||
.BDDfy(); |
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.
Minor issue: BDDfy in unit tests
I'm all for a review! This PR seems solid as a rock. 🤩 But, oops, where did the docs for the new feature scamper off to? And about that |
I've fixed the code according to the code review suggestions. I've also added the docs based on the previous PR. |
TODO
|
919abc8
to
3688cc3
Compare
Closes #842 #1414
AuthenticationOptions
property in global configuration #842Proposed Changes
It is possible to configure
AuthenticationOptions
inGlobalConfiguration
. Then all routes use these settings. To configure an exception to this rule (e.g. for identity service),AllowAnonymous
property should be set to true in the routeAuthenticationOptions
.If a route has its own
AuthenticationOptions
withAuthenticationProviderKey
/AuthenticationProviderKeys
configured additionally, it has priority over the global one.At the moment if a route uses a global
AuthenticationProviderKey
/AuthenticationProviderKeys
(whenAuthenticationProviderKey
/AuthenticationProviderKeys
is not configured for route explicitly), it uses also globalAllowedScopes
, even ifAllowedScopes
is configured for the route additionally.Note
This PR was prepared 4 years ago →
The revival of the Ocelot brought many changes, also tightly connected with the PR code. Now there is additional property:
AuthenticationProviderKeys
. The merge was so hard that I created the PR from scratch and tried to apply all the code review comments.