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 ITE-4 resolver interface provides a method to return the right resolver for a given artifact uri, e.g.:
Resolver.for_uri("file:path/to/foo") returns the FileResolver instance that was previously registered in the global RESOLVER_FOR_URI_SCHEME dictionary under the "file" scheme.
This design is above all useful to separate resolver configuration from usage, and to implement uri parsing and default dispatching behind the interface.
However, given that we currently configure and use resolvers in the same function, the design seems more complex and intransparent than useful:
The ITE-4 resolver interface provides a method to return the right resolver for a given artifact uri, e.g.:
Resolver.for_uri("file:path/to/foo")
returns theFileResolver
instance that was previously registered in the globalRESOLVER_FOR_URI_SCHEME
dictionary under the "file" scheme.This design is above all useful to separate resolver configuration from usage, and to implement uri parsing and default dispatching behind the interface.
However, given that we currently configure and use resolvers in the same function, the design seems more complex and intransparent than useful:
in-toto/in_toto/runlib.py
Lines 162 to 192 in 4581e4b
Unless we detach resolver configuration from resolver usage, I think, it would be easier to keep a local resolver map and also dispatch locally.
The text was updated successfully, but these errors were encountered: