diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a767c04..df3d8782 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,10 +91,10 @@ jobs: - if: runner.os == 'Linux' name: Install maturin[zig] from PyPI - uses: install-pinned/maturin-with-zig@c69b784f32c6a34427a937c4887c928284a6d4cc + uses: install-pinned/maturin-with-zig@4d1a9421a8c84036989276ddf3dbd24aa48b8111 - if: runner.os != 'Linux' name: Install maturin from PyPI - uses: install-pinned/maturin@9f07e24f8a6ddec5e728f9a6ce2fd377213a9e4a + uses: install-pinned/maturin@239b89ed00a1af9a610f3623e6d8b07d1bd8f88f - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') run: python .github/scripts/pin-versions.py @@ -195,7 +195,7 @@ jobs: - uses: mhils/workflows/checkout@5b6540d578f48644ffa5e955cedadc81034cb7d8 # v18.0 - uses: ./.github/actions/setup - name: Install maturin[zig] from PyPI - uses: install-pinned/maturin-with-zig@c69b784f32c6a34427a937c4887c928284a6d4cc + uses: install-pinned/maturin-with-zig@4d1a9421a8c84036989276ddf3dbd24aa48b8111 - run: maturin build --release ${{ matrix.args }} working-directory: ./mitmproxy-linux - run: test -f target/wheels/*-py3-none-*.whl # ensure we have a universal wheel diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d9c51df4..47e83a3a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: # TODO: This should ideally just reuse the main CI artifacts. - uses: mhils/workflows/checkout@5b6540d578f48644ffa5e955cedadc81034cb7d8 # v18.0 - uses: ./.github/actions/setup - - uses: install-pinned/maturin-with-zig@c69b784f32c6a34427a937c4887c928284a6d4cc + - uses: install-pinned/maturin-with-zig@4d1a9421a8c84036989276ddf3dbd24aa48b8111 - uses: install-pinned/mypy@75779f141592e4909d64e13f8a1861f06aa9cd8d - uses: install-pinned/pdoc@69ba59f9699df21e1026110af4ec6b10a98cf5cd diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4739f89..553d39c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: environment: deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: token: ${{ secrets.GH_PUSH_TOKEN }} # this token works to push to the protected main branch. persist-credentials: true # needed by release tool diff --git a/src/ipc/mitmproxy_ipc/mitmproxy_ipc.rs b/src/ipc/mitmproxy_ipc/mitmproxy_ipc.rs new file mode 100644 index 00000000..2f2ac653 --- /dev/null +++ b/src/ipc/mitmproxy_ipc/mitmproxy_ipc.rs @@ -0,0 +1,100 @@ +// @generated +// This file is @generated by prost-build. +// Note: The protobuf definition is shared between the Rust and Swift parts. +// We are not using prost-build because providing protoc is a hassle on many platforms. +// See .github/workflows/autofix.yml for how to update the respective files, +// or file a PR and let CI handle it. + +/// Packet with associated tunnel info (Windows pipe to mitmproxy) +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PacketWithMeta { + #[prost(bytes="bytes", tag="1")] + pub data: ::prost::bytes::Bytes, + #[prost(message, optional, tag="2")] + pub tunnel_info: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TunnelInfo { + #[prost(uint32, optional, tag="1")] + pub pid: ::core::option::Option, + #[prost(string, optional, tag="2")] + pub process_name: ::core::option::Option<::prost::alloc::string::String>, +} +/// Packet or intercept spec (Windows pipe to redirector) +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct FromProxy { + #[prost(oneof="from_proxy::Message", tags="1, 2")] + pub message: ::core::option::Option, +} +/// Nested message and enum types in `FromProxy`. +pub mod from_proxy { + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] + pub enum Message { + #[prost(message, tag="1")] + Packet(super::Packet), + #[prost(message, tag="2")] + InterceptConf(super::InterceptConf), + } +} +/// Packet (macOS UDP Stream) +/// ⚠️ Bump network extension version on changes, +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Packet { + #[prost(bytes="bytes", tag="1")] + pub data: ::prost::bytes::Bytes, +} +/// Intercept conf (macOS Control Stream) +/// ⚠️ Bump network extension version on changes, +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct InterceptConf { + #[prost(string, repeated, tag="1")] + pub actions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// New flow (macOS TCP/UDP Stream) +/// ⚠️ Bump network extension version on changes, +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct NewFlow { + #[prost(oneof="new_flow::Message", tags="1, 2")] + pub message: ::core::option::Option, +} +/// Nested message and enum types in `NewFlow`. +pub mod new_flow { + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] + pub enum Message { + #[prost(message, tag="1")] + Tcp(super::TcpFlow), + #[prost(message, tag="2")] + Udp(super::UdpFlow), + } +} +/// ⚠️ Bump network extension version on changes, +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct TcpFlow { + #[prost(message, optional, tag="1")] + pub remote_address: ::core::option::Option
, + #[prost(message, optional, tag="2")] + pub tunnel_info: ::core::option::Option, +} +/// ⚠️ Bump network extension version on changes, +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UdpFlow { + #[prost(message, optional, tag="1")] + pub local_address: ::core::option::Option
, + #[prost(message, optional, tag="3")] + pub tunnel_info: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UdpPacket { + #[prost(bytes="bytes", tag="1")] + pub data: ::prost::bytes::Bytes, + #[prost(message, optional, tag="2")] + pub remote_address: ::core::option::Option
, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct Address { + #[prost(string, tag="1")] + pub host: ::prost::alloc::string::String, + #[prost(uint32, tag="2")] + pub port: u32, +} +// @@protoc_insertion_point(module)