-
Notifications
You must be signed in to change notification settings - Fork 591
AddXyz() binds to default config section #1180
Conversation
@HaoK, |
@Tratcher I'm going to merge this into the mega security changes PR |
I'll keep this PR open to keep it obvious what the changes specifically for the AddXyz overloads were |
@HaoK so these overloads require (manually) registering an Curious: do you plan to adopt this design in other ASP.NET Core components? |
Yeah so hosting is adding configuration to DI now, so there's the concept of a default configuration. As a result we can add a default AddXyz() overloads to anything where it makes sense to auto bind to a default config section in that configuration. |
RE binding complex arguments, I'm sure it will throw or fail. We likely will need to give the binder lots more love as a result of lighting things up this way... |
What would the config need to look like for each provider? How much can realistically be bound? |
I see the minimum binding in the tests. Can you add to the tests all properties you can currently bind to? |
Added the config binding to the core AddXyz, so its always added by default, with the Action overriding. Added all the properties that can be set to the test. The one we might want to fix is the ability to bind to PathString which currently doesn't work with the binder. Merging this to the main PR, if there are any other concerns we can deal with them there |
Rolled into #1170 |
I didn't add these overloads for Cookies/generic OAuth since those are more likely to have multiple instances, but I can if we want.
cc @glennc @ajcvickers @Tratcher @divega @davidfowl