Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
--prost_opt="bytes=data"
--swift_out=./mitmproxy-macos/redirector/ipc
- run: cargo fmt --all
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
- uses: autofix-ci/action@7a166d7532b277f34e16238930461bf77f9d7ed8

rustfmt:
runs-on: ${{ matrix.os }}
Expand All @@ -50,4 +50,4 @@ jobs:
- run: cargo fmt --all
- run: git checkout src/ipc/mitmproxy_ipc.rs

- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
- uses: autofix-ci/action@7a166d7532b277f34e16238930461bf77f9d7ed8
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ jobs:

- if: runner.os == 'Linux'
name: Install maturin[zig] from PyPI
uses: install-pinned/maturin-with-zig@17e01ecf067c35a61d38260946eb540d1183b4c6
uses: install-pinned/maturin-with-zig@182730d9f5f861f22dc318d3642d4aaf90ede346
- if: runner.os != 'Linux'
name: Install maturin from PyPI
uses: install-pinned/maturin@a6142e16d31c3112487eabfb98d9cda8f08ba35d
uses: install-pinned/maturin@35386cad05abd059f2e16ecf94c909ed7bb9c46e

- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: python .github/scripts/pin-versions.py
Expand All @@ -107,7 +107,7 @@ jobs:
- if: contains(matrix.args, 'sdist')
run: pip install --no-dependencies target/wheels/*.tar.gz

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.name }}
path: target/wheels
Expand All @@ -117,7 +117,7 @@ jobs:
steps:
- uses: mhils/workflows/checkout@5b6540d578f48644ffa5e955cedadc81034cb7d8 # v18.0
- if: ${{ !startsWith(github.ref, 'refs/tags/') }} # harden against cache poisoning
uses: actions/cache@v4
uses: actions/cache@v5
id: cache-app
with:
path: mitmproxy-macos/redirector/dist/
Expand All @@ -132,7 +132,7 @@ jobs:
APPLE_PROVISIONING_PROFILE_EXT: ${{ secrets.APPLE_PROVISIONING_PROFILE_EXT }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: macos-app
path: mitmproxy-macos/redirector/dist/
Expand All @@ -148,7 +148,7 @@ jobs:
- run: cargo build --release --package windows-redirector

- run: python -m build --wheel ./mitmproxy-windows --outdir target/wheels/
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: wheels-os-windows
path: target/wheels
Expand All @@ -168,13 +168,13 @@ jobs:
cargo build --release --package macos-certificate-truster --target x86_64-apple-darwin
cargo build --release --package macos-certificate-truster --target aarch64-apple-darwin
lipo -create -output target/release/macos-certificate-truster target/x86_64-apple-darwin/release/macos-certificate-truster target/aarch64-apple-darwin/release/macos-certificate-truster
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: macos-app
path: mitmproxy-macos/redirector/dist/

- run: python -m build --wheel ./mitmproxy-macos --outdir target/wheels/
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: wheels-os-macos
path: target/wheels
Expand All @@ -195,12 +195,12 @@ jobs:
- uses: mhils/workflows/checkout@5b6540d578f48644ffa5e955cedadc81034cb7d8 # v18.0
- uses: ./.github/actions/setup
- name: Install maturin[zig] from PyPI
uses: install-pinned/maturin-with-zig@17e01ecf067c35a61d38260946eb540d1183b4c6
uses: install-pinned/maturin-with-zig@182730d9f5f861f22dc318d3642d4aaf90ede346
- run: maturin build --release ${{ matrix.args }}
working-directory: ./mitmproxy-linux
- run: test -f target/wheels/*-py3-none-*.whl # ensure we have a universal wheel

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: wheels-os-${{ matrix.name }}
path: target/wheels
Expand All @@ -211,7 +211,7 @@ jobs:
steps:
- uses: mhils/workflows/checkout@5b6540d578f48644ffa5e955cedadc81034cb7d8 # v18.0
- uses: ./.github/actions/setup
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: wheels-os-linux-x86_64
path: target/wheels
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@17e01ecf067c35a61d38260946eb540d1183b4c6
- uses: install-pinned/maturin-with-zig@182730d9f5f861f22dc318d3642d4aaf90ede346
- uses: install-pinned/mypy@75779f141592e4909d64e13f8a1861f06aa9cd8d
- uses: install-pinned/pdoc@69ba59f9699df21e1026110af4ec6b10a98cf5cd

Expand All @@ -34,7 +34,7 @@ jobs:

- run: pdoc -o docs/ mitmproxy_rs

- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v4
with:
path: docs/

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
environment: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
Expand Down
86 changes: 29 additions & 57 deletions mitmproxy-macos/redirector/ipc/mitmproxy_ipc.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
}

/// Packet with associated tunnel info (Windows pipe to mitmproxy)
struct MitmproxyIpc_PacketWithMeta: @unchecked Sendable {
struct MitmproxyIpc_PacketWithMeta: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var data: Data = Data()

var tunnelInfo: MitmproxyIpc_TunnelInfo {
get {return _tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
get {_tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
set {_tunnelInfo = newValue}
}
/// Returns true if `tunnelInfo` has been explicitly set.
var hasTunnelInfo: Bool {return self._tunnelInfo != nil}
var hasTunnelInfo: Bool {self._tunnelInfo != nil}
/// Clears the value of `tunnelInfo`. Subsequent reads from it will return its default value.
mutating func clearTunnelInfo() {self._tunnelInfo = nil}

Expand All @@ -51,20 +51,20 @@ struct MitmproxyIpc_TunnelInfo: Sendable {
// methods supported on all messages.

var pid: UInt32 {
get {return _pid ?? 0}
get {_pid ?? 0}
set {_pid = newValue}
}
/// Returns true if `pid` has been explicitly set.
var hasPid: Bool {return self._pid != nil}
var hasPid: Bool {self._pid != nil}
/// Clears the value of `pid`. Subsequent reads from it will return its default value.
mutating func clearPid() {self._pid = nil}

var processName: String {
get {return _processName ?? String()}
get {_processName ?? String()}
set {_processName = newValue}
}
/// Returns true if `processName` has been explicitly set.
var hasProcessName: Bool {return self._processName != nil}
var hasProcessName: Bool {self._processName != nil}
/// Clears the value of `processName`. Subsequent reads from it will return its default value.
mutating func clearProcessName() {self._processName = nil}

Expand Down Expand Up @@ -113,7 +113,7 @@ struct MitmproxyIpc_FromProxy: Sendable {

/// Packet (macOS UDP Stream)
/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_Packet: @unchecked Sendable {
struct MitmproxyIpc_Packet: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand Down Expand Up @@ -182,20 +182,20 @@ struct MitmproxyIpc_TcpFlow: Sendable {
// methods supported on all messages.

var remoteAddress: MitmproxyIpc_Address {
get {return _remoteAddress ?? MitmproxyIpc_Address()}
get {_remoteAddress ?? MitmproxyIpc_Address()}
set {_remoteAddress = newValue}
}
/// Returns true if `remoteAddress` has been explicitly set.
var hasRemoteAddress: Bool {return self._remoteAddress != nil}
var hasRemoteAddress: Bool {self._remoteAddress != nil}
/// Clears the value of `remoteAddress`. Subsequent reads from it will return its default value.
mutating func clearRemoteAddress() {self._remoteAddress = nil}

var tunnelInfo: MitmproxyIpc_TunnelInfo {
get {return _tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
get {_tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
set {_tunnelInfo = newValue}
}
/// Returns true if `tunnelInfo` has been explicitly set.
var hasTunnelInfo: Bool {return self._tunnelInfo != nil}
var hasTunnelInfo: Bool {self._tunnelInfo != nil}
/// Clears the value of `tunnelInfo`. Subsequent reads from it will return its default value.
mutating func clearTunnelInfo() {self._tunnelInfo = nil}

Expand All @@ -214,20 +214,20 @@ struct MitmproxyIpc_UdpFlow: Sendable {
// methods supported on all messages.

var localAddress: MitmproxyIpc_Address {
get {return _localAddress ?? MitmproxyIpc_Address()}
get {_localAddress ?? MitmproxyIpc_Address()}
set {_localAddress = newValue}
}
/// Returns true if `localAddress` has been explicitly set.
var hasLocalAddress: Bool {return self._localAddress != nil}
var hasLocalAddress: Bool {self._localAddress != nil}
/// Clears the value of `localAddress`. Subsequent reads from it will return its default value.
mutating func clearLocalAddress() {self._localAddress = nil}

var tunnelInfo: MitmproxyIpc_TunnelInfo {
get {return _tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
get {_tunnelInfo ?? MitmproxyIpc_TunnelInfo()}
set {_tunnelInfo = newValue}
}
/// Returns true if `tunnelInfo` has been explicitly set.
var hasTunnelInfo: Bool {return self._tunnelInfo != nil}
var hasTunnelInfo: Bool {self._tunnelInfo != nil}
/// Clears the value of `tunnelInfo`. Subsequent reads from it will return its default value.
mutating func clearTunnelInfo() {self._tunnelInfo = nil}

Expand All @@ -239,19 +239,19 @@ struct MitmproxyIpc_UdpFlow: Sendable {
fileprivate var _tunnelInfo: MitmproxyIpc_TunnelInfo? = nil
}

struct MitmproxyIpc_UdpPacket: @unchecked Sendable {
struct MitmproxyIpc_UdpPacket: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

var data: Data = Data()

var remoteAddress: MitmproxyIpc_Address {
get {return _remoteAddress ?? MitmproxyIpc_Address()}
get {_remoteAddress ?? MitmproxyIpc_Address()}
set {_remoteAddress = newValue}
}
/// Returns true if `remoteAddress` has been explicitly set.
var hasRemoteAddress: Bool {return self._remoteAddress != nil}
var hasRemoteAddress: Bool {self._remoteAddress != nil}
/// Clears the value of `remoteAddress`. Subsequent reads from it will return its default value.
mutating func clearRemoteAddress() {self._remoteAddress = nil}

Expand Down Expand Up @@ -282,10 +282,7 @@ fileprivate let _protobuf_package = "mitmproxy_ipc"

extension MitmproxyIpc_PacketWithMeta: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".PacketWithMeta"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "data"),
2: .standard(proto: "tunnel_info"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}data\0\u{3}tunnel_info\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -324,10 +321,7 @@ extension MitmproxyIpc_PacketWithMeta: SwiftProtobuf.Message, SwiftProtobuf._Mes

extension MitmproxyIpc_TunnelInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TunnelInfo"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "pid"),
2: .standard(proto: "process_name"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}pid\0\u{3}process_name\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -366,10 +360,7 @@ extension MitmproxyIpc_TunnelInfo: SwiftProtobuf.Message, SwiftProtobuf._Message

extension MitmproxyIpc_FromProxy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".FromProxy"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "packet"),
2: .standard(proto: "intercept_conf"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}packet\0\u{3}intercept_conf\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -436,9 +427,7 @@ extension MitmproxyIpc_FromProxy: SwiftProtobuf.Message, SwiftProtobuf._MessageI

extension MitmproxyIpc_Packet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".Packet"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "data"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}data\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -468,9 +457,7 @@ extension MitmproxyIpc_Packet: SwiftProtobuf.Message, SwiftProtobuf._MessageImpl

extension MitmproxyIpc_InterceptConf: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".InterceptConf"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "actions"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}actions\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -500,10 +487,7 @@ extension MitmproxyIpc_InterceptConf: SwiftProtobuf.Message, SwiftProtobuf._Mess

extension MitmproxyIpc_NewFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".NewFlow"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "tcp"),
2: .same(proto: "udp"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}tcp\0\u{1}udp\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -570,10 +554,7 @@ extension MitmproxyIpc_NewFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImp

extension MitmproxyIpc_TcpFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TcpFlow"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "remote_address"),
2: .standard(proto: "tunnel_info"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}remote_address\0\u{3}tunnel_info\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -612,10 +593,7 @@ extension MitmproxyIpc_TcpFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImp

extension MitmproxyIpc_UdpFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".UdpFlow"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "local_address"),
3: .standard(proto: "tunnel_info"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}local_address\0\u{4}\u{2}tunnel_info\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -654,10 +632,7 @@ extension MitmproxyIpc_UdpFlow: SwiftProtobuf.Message, SwiftProtobuf._MessageImp

extension MitmproxyIpc_UdpPacket: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".UdpPacket"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "data"),
2: .standard(proto: "remote_address"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}data\0\u{3}remote_address\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -696,10 +671,7 @@ extension MitmproxyIpc_UdpPacket: SwiftProtobuf.Message, SwiftProtobuf._MessageI

extension MitmproxyIpc_Address: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".Address"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "host"),
2: .same(proto: "port"),
]
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}host\0\u{1}port\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down
Loading
Loading