-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit imported interfaces for composed components (#83)
* Limit imported interfaces for composed components Components that are directly composed will never use any virtualized interface that it does not already import. Virtualizing additional interfaces limits the compatibility of the resulting component as it places an additional requirement on the host environment to satisfy each import, used or not. We now inspect the composed component to match the interfaces it imports with the virtualized capabilities. If the composed component does not import the respective interface the resulting component will not virtualize that interface. In effect, use of `--allow-all` will behave as if the caller specifically approved the interfaces actually used. The granularity of filtered imports is coarse. Interfaces that support a consumed capability may still appear as imports even if the composed component does not consume them explicitly. Signed-off-by: Scott Andrews <scott@andrews.me> * Review feedback - move filtering to be a separate method from finalize - perform composition in finalize when compose is requested - update readme Signed-off-by: Scott Andrews <scott@andrews.me> --------- Signed-off-by: Scott Andrews <scott@andrews.me>
- Loading branch information
Showing
7 changed files
with
238 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
component = "do-everything" | ||
compose = true | ||
|
||
[virt-opts] | ||
clocks = true | ||
# http will be filtered out because the "do-everything" component doesn't import it | ||
http = true | ||
stdio.stdin = "ignore" | ||
stdio.stdout = "ignore" | ||
stdio.stderr = "ignore" | ||
|
||
[expect.imports] | ||
required = [ | ||
"wasi:clocks/wall-clock", | ||
] | ||
disallowed = [ | ||
"wasi:http/incoming-handler", | ||
] |
Oops, something went wrong.