Skip to content

Implementation of http.send builtin MK2 (rework of #218) #221

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Lupus
Copy link

@Lupus Lupus commented May 21, 2025

This PR is a derived work on top of matrix-org/rust-opa-wasm!218, which was originally authored by @MatMaul.

OPA Spec for http.send

This PR includes what was implemented in the original one:

  • url
  • method
  • body
  • raw_body
  • headers
  • enable_redirect
  • force_json_decode
  • force_yaml_decode
  • timeout
  • raise_error
  • max_retry_attempts

Changes from the original PR:

  • Irrelevant changes for migration from serde_yaml to serde_yml are omitted so as not to clutter this PR and allow easier review; yaml crate migration can be introduced separately
  • DefaultContext does not provide a working HTTP out of the box - rationale for this is security: integration should explicitly decide to allow HTTP requests, allowlist them, enrich them with authentication/tracing etc; uncontrolled HTTP client by-default seems dangerous, especially given how easy this can be done by the integration.
  • additional feature testing was introduced to gate TestContext, which depends on reqwest; opa-wasm itself does not depend on reqwest even when http-builtins feature is enabled so that final integration could customize HTTP appropriately without extra dependencies

@MatMaul @sandhose what do you folks think about this?

Lupus added 2 commits May 21, 2025 12:32
Signed-off-by: Konstantin A. Olkhovskiy <[email protected]>
This is largely a derived work on top of
[matrix-org/rust-opa-wasm!218](matrix-org#218)
which was authored by [@MatMaul](https://github.com/MatMaul).

Signed-off-by: Konstantin A. Olkhovskiy <[email protected]>
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.

1 participant