-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: read proxy origin from QubesDB when available; otherwise environment #1895
Commits on Mar 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 321fc9a - Browse repository at this point
Copy the full SHA 321fc9aView commit details -
Rewrite proxy in Rust, with v2 behavior
We identified multiple features that the current implementation of the proxy is unable to support (e.g. progress reporting, resuming downloads), necessitating a new protocol dubbed "v2". We are taking the opportunity to rewrite this component in Rust. Normal operation is mostly the same, input is received as a JSON blob (parsed and validated by serde) and output in our custom JSON response format. The `url` crate (from servo) is used to assemble and validate the target URL, and `reqwest` fires off the HTTP request. Downloads are now streamed back to the client over stdout, and metadata passed over stderr. Tests and further integration will happen in follow-up commits. Refs #1678. Co-authored-by: Kunal Mehta <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e40eefb - Browse repository at this point
Copy the full SHA e40eefbView commit details -
Rewrite the existing tests to be integration tests against a compiled Rust binary. We use the httpbin library to start up a Python webserver and instruct the proxy to connect to it. This allows to test connection properties that aren't recordable in the VCR format, like timeouts or streamed responses. The tests are reorganized to be split into proxy handling and error handling.
Configuration menu - View commit details
-
Copy full SHA for 6a78dcf - Browse repository at this point
Copy the full SHA 6a78dcfView commit details -
The SDK will now unconditionally use proxy v2: in development mode, it'll shell out directly, while production mode will invoke it over qrexec. The dev `./run.sh` script will compile the proxy so it's ready for use before the client starts up. New typed dataclasses represent the two types of responses that can be returned. No user-facting changes are happening at this stage, but this will enable future client features. The union return of send_json_request() means that we need instanceof assertions to make mypy happy. One minor logic bug in API.get_submission() was fixed in the case that no request is made (an undefined exception would've been raised previously).
Configuration menu - View commit details
-
Copy full SHA for fce59ed - Browse repository at this point
Copy the full SHA fce59edView commit details -
Refactor and update SDK tests to use lightweight VCR interface
We can't use VCR.py's "custom_patches" parameter because our API._send_json_request() is RPC- rather than connection-oriented. But we can just instrument _send_json_request() directly, which is what we do here. We subclass vcr.cassette.Cassette to handle identical requests with different responses, which was suggestd by @vickyliin as a workaround for kevin1024/vcrpy#753. Now that the SDK‒proxy connection is itself instrumented, there's only one path to test, with no special error-handling logic required, so merge TestAPIProxy into TestAPI. I considered merging TestAPI and TestShared as well, now that (without TestAPIProxy) TestAPI is the only subclass of TestShared. But reorganizing the alphabetized helpers in TestShared versus the strictly-sequenced TestAPI methods can wait. The tests are also now more patient with slow deletion operations. I'd want to DRY up this logic if this pattern shows up in more places, but it would require adding another level of indirection. A @Retry decorator isn't appropriate at the level of the test method, and a context manager can't loop over its closure. And re-apply the hack from 880635d by renaming test_logout to start with a "z" so it runs last.
Configuration menu - View commit details
-
Copy full SHA for 20c7035 - Browse repository at this point
Copy the full SHA 20c7035View commit details -
Add
make regenerate-sdk-cassettes
and use in SDK CIHelp the developer through regenerating SDK cassettes against a development server, as well as in CI.
Configuration menu - View commit details
-
Copy full SHA for dd37b00 - Browse repository at this point
Copy the full SHA dd37b00View commit details -
* Switch to `Arch: any` because the package contains compiled code and this enables debhelper's automatic shlibs dependency system. * Rename the binary to `securedrop-proxy` because that's the Rust name.
Configuration menu - View commit details
-
Copy full SHA for 7d4f3c2 - Browse repository at this point
Copy the full SHA 7d4f3c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8084a2b - Browse repository at this point
Copy the full SHA 8084a2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 669deac - Browse repository at this point
Copy the full SHA 669deacView commit details -
Switch functional tests to use custom VCR setup
Same as the SDK, use our custom VCRAPI wrapper instead of pytest-vcr. Because each of the functional tests log in and out, document the server hack needed to run them one after another in the README.
Configuration menu - View commit details
-
Copy full SHA for 2c5b29d - Browse repository at this point
Copy the full SHA 2c5b29dView commit details -
Remove Python implementation of proxy
Now replaced by the Rust version.
Configuration menu - View commit details
-
Copy full SHA for cc76caf - Browse repository at this point
Copy the full SHA cc76cafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bbdd6e - Browse repository at this point
Copy the full SHA 4bbdd6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c1df77 - Browse repository at this point
Copy the full SHA 3c1df77View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5161952 - Browse repository at this point
Copy the full SHA 5161952View commit details -
Configuration menu - View commit details
-
Copy full SHA for a99e6a3 - Browse repository at this point
Copy the full SHA a99e6a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9aa2290 - Browse repository at this point
Copy the full SHA 9aa2290View commit details -
feat(read): split implementation on "qubesdb" feature
Co-authored-by: Kunal Mehta <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 59564da - Browse repository at this point
Copy the full SHA 59564daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fec128 - Browse repository at this point
Copy the full SHA 1fec128View commit details -
Configuration menu - View commit details
-
Copy full SHA for 185a843 - Browse repository at this point
Copy the full SHA 185a843View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e17717 - Browse repository at this point
Copy the full SHA 6e17717View commit details -
Configuration menu - View commit details
-
Copy full SHA for 59259fd - Browse repository at this point
Copy the full SHA 59259fdView commit details
Commits on Mar 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4853d4b - Browse repository at this point
Copy the full SHA 4853d4bView commit details -
fix(read): explicitly handle qbd_read() = NUL
Since qdb_read() returns a pointer, not a byte-slice, we can't rely on the nul-byte handling of the CStr::from_bytes*() functions.
Configuration menu - View commit details
-
Copy full SHA for a615d80 - Browse repository at this point
Copy the full SHA a615d80View commit details
Commits on Mar 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 238a3f5 - Browse repository at this point
Copy the full SHA 238a3f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c477b7 - Browse repository at this point
Copy the full SHA 8c477b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for b132932 - Browse repository at this point
Copy the full SHA b132932View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14873c6 - Browse repository at this point
Copy the full SHA 14873c6View commit details