You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interface exposes a type and the name of the currently resolved instance and provides a method to get other dependencies by calling Resolve(otherType, otherName). The method automatically checks if any dependency overrides are provided an returns matching overrides as necessary.
Problem
The interface declaration presents two problems:
It is derived from IPolicyList
It exposes IUnityContainer
IPolicyList interface
IPolicyList interface allows setting and retrieving container internal policies and makes it vulnerable. In other words, a simple resolver could redefine the container's behavior without any limit.
IUnityContainer member
The container's instance exposed to the resolver allows bypassing of resolution pipeline code and creates situations with a nondeterministic state.
Solution
The new interface should remove both: IPolicyList and IUnityContainer interfaces and will be defined as follows:
IResolveContext interface
During resolution, the
IResolveContext
interface provides a way for the build pipeline to resolve dependencies.Usage
It is used in every resolver pipeline as this:
It is defined as follows:
The interface exposes a type and the name of the currently resolved instance and provides a method to get other dependencies by calling
Resolve(otherType, otherName)
. The method automatically checks if any dependency overrides are provided an returns matching overrides as necessary.Problem
The interface declaration presents two problems:
IPolicyList
IUnityContainer
IPolicyList interface
IPolicyList
interface allows setting and retrieving container internal policies and makes it vulnerable. In other words, a simple resolver could redefine the container's behavior without any limit.IUnityContainer
memberThe container's instance exposed to the resolver allows bypassing of resolution pipeline code and creates situations with a nondeterministic state.
Solution
The new interface should remove both:
IPolicyList
andIUnityContainer
interfaces and will be defined as follows:The text was updated successfully, but these errors were encountered: