Skip to content
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

Implement a WebAssembly content policy in the server. #121

Merged
merged 3 commits into from
May 26, 2023

Conversation

peterhuene
Copy link
Member

This PR implements a content policy in the server that incrementally validates that content uploaded to the server is valid WebAssembly.

Currently the policy is not exposed via the CLI, but the integration tests use the policy to expect that all content should be WebAssembly.

We may want to expose enabling some policies via the CLI in the future, but for now this should allow for consumers of the warg-server crate to enable policies for custom server implementations.

This commit implements a content policy in the server that incrementally
validates that content uploaded to the server is valid WebAssembly.

Currently the policy is not exposed via the CLI, but the integration tests use
the policy to expect that all content should be WebAssembly.

We may want to expose enabling some policies via the CLI in the future, but for
now this should allow for consumers of the `warg-server` crate to enable
policies for custom server implementations.
This commit updates the error message for rejecting a record to include the
content digest when the rejection is due to content policy.
This commit updates `PackageError` (and related error enums) so that there is a
more generic `Rejection` variant that will encapsulate any reason (content
policy, record policy, etc) the record might have been rejected by the server.
@peterhuene peterhuene requested a review from esoterra May 26, 2023 17:25
@esoterra
Copy link
Collaborator

I think there will need to be more work in the future to generalize kinds of policies and where they hook in, but that doesn't need to be part of this PR.

LGTM other than one remaining comment.

@peterhuene peterhuene merged commit c242f3b into bytecodealliance:main May 26, 2023
@peterhuene peterhuene deleted the content-policy branch May 26, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants