-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Allow autoconfiguring bindings #27806
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
[DI] Allow autoconfiguring bindings #27806
Conversation
5614441
to
9032b03
Compare
Ah, so this basically allows a library to enable an optional "bind" based on an interface e.g. IF a user's service implements But, I don't understand the exact use you're describing. In #27801, you make it possible to configure the TokenProcessor with zero config (autoconfigure + autowiring will take care of everything). But then in this PR, you bind |
The goal is to not trigger authentication by adding the user to the logs as this would defeat the very purpose of lazy authentication. |
23c6d5e
to
d632ee9
Compare
d632ee9
to
7c29977
Compare
I removed the unrelated bits, PR ready to vote+merge. |
This PR was merged into the 4.2-dev branch. Discussion ---------- [DI] Allow autoconfiguring bindings | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I've come up with a case where we will need to inject a different service based on which interfaces a consumer service implements: injecting a different token storage for monolog processor than for everything else. Required in #27801. Commits ------- 7c29977 [DI] Allow autoconfiguring bindings
…ults (przemyslaw-bogusz) This PR was merged into the 4.3-dev branch. Discussion ---------- [DI] Fix bad error message for unused bind under _defaults | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27828 | License | MIT **Sidenote**: I originally included the fix in #29897, but I decided to close the previous PR and divide it into two separate PRs for clarity. **Description:** With this fix, the message regarding an unused bind will have a clear information about the type of the bind (defined under __defaults_, __instanceof_ or _per service_), as well as the name of the file, in which it was configurated. It's for, both, YAML and XML configurations. For the core team, please note, that the fix assumes a possibility of definings binds under __instanceof_, which was introduced in #27806. But since fixes are merged into other branches, I thought that it might be necessary to inlude this possibility. If this case requires making separate fixes for different branches, I will gladly do it. Commits ------- 35bf420 [DI] Fix bad error message for unused bind under _defaults
I've come up with a case where we will need to inject a different service based on which interfaces a consumer service implements: injecting a different token storage for monolog processor than for everything else. Required in #27801.