Skip to content
Closed
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
22de8ba
Add trusted manual host mobile pairing
austinywang Jul 3, 2026
9cd18dc
Address manual host pairing CI review
austinywang Jul 3, 2026
eb8edd6
Address manual host trust review feedback
austinywang Jul 3, 2026
c114fcd
Address manual host pairing review gaps
austinywang Jul 3, 2026
5560ec7
Tighten manual host edge cases
austinywang Jul 3, 2026
4f0ac49
Address manual host validation feedback
austinywang Jul 3, 2026
affae04
Keep mobile root view within line budget
austinywang Jul 3, 2026
8c305ce
Tighten trusted manual host route safety
austinywang Jul 3, 2026
f796928
Reject loopback manual host advertisements
austinywang Jul 3, 2026
c7171dd
Align manual host validation with pairing QR
austinywang Jul 3, 2026
43c3e2a
Preserve normalized IPv6 manual hosts
austinywang Jul 3, 2026
012e2af
Clear stale manual host approval state
austinywang Jul 3, 2026
5a89f63
Keep mobile status routes on host service
austinywang Jul 3, 2026
5d06d6c
Trim mobile host status snapshot footprint
austinywang Jul 3, 2026
abfd752
Localize manual host pairing strings
austinywang Jul 3, 2026
4c5ae7f
Move mobile manual host route state
austinywang Jul 3, 2026
9c8a00c
Fit mobile host service budget
austinywang Jul 3, 2026
b411a70
Satisfy mobile manual host policy gate
austinywang Jul 3, 2026
3c3420f
Defer manual host fallback approval
austinywang Jul 3, 2026
abdc2d3
Address manual host trust review feedback
austinywang Jul 3, 2026
859e947
Prompt when manual fallback is selected
austinywang Jul 3, 2026
d34e00b
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 3, 2026
f2d334f
Fix manual host SwiftPM package checks
austinywang Jul 4, 2026
f488758
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 4, 2026
73b58e4
Address manual host autoreview findings
austinywang Jul 4, 2026
5b20ddf
Fix mobile feature route selection test
austinywang Jul 4, 2026
1f6b9d9
Address manual host autoreview gaps
austinywang Jul 4, 2026
73282bc
Preserve active mobile sessions on pairing failure
austinywang Jul 4, 2026
c334040
Return explicit manual host approval result
austinywang Jul 4, 2026
3c87599
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 4, 2026
2d494f1
Keep workspace detail within line budget
austinywang Jul 4, 2026
172fe3e
Satisfy manual host policy closeout
austinywang Jul 4, 2026
82340e2
Add stale manual host approval reconnect test
austinywang Jul 4, 2026
7b4ce79
Clear stale manual host approval after reconnect
austinywang Jul 4, 2026
20ac5f4
Fix manual host closeout blockers
austinywang Jul 4, 2026
46f6d58
Address manual host autoreview findings
austinywang Jul 4, 2026
43ae450
Fix manual host pairing review follow-ups
austinywang Jul 4, 2026
ac86a7b
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 9, 2026
8dcf1f1
Fix mobile shell reconnect CI closeout
austinywang Jul 9, 2026
16cf3ed
Fix mobile shell deinit isolation
austinywang Jul 9, 2026
a20649f
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
5d4ded0
Add manual host approval race regressions
austinywang Jul 9, 2026
6816449
Fix manual host approval closeout races
austinywang Jul 9, 2026
490679f
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
e0f7d6f
Add pairing view stale approval regression
austinywang Jul 9, 2026
02f4337
Clear stale pairing approvals before validation
austinywang Jul 9, 2026
08870c0
Add cancelled manual host approval regression
austinywang Jul 9, 2026
a21f667
Fix cancelled manual host approvals
austinywang Jul 9, 2026
7938034
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 9, 2026
5fa6edc
Fix manual host switch approval lifecycle
austinywang Jul 9, 2026
f59fbd5
Keep mobile shell composite under budget
austinywang Jul 9, 2026
476aec4
Preserve trusted manual host route semantics
austinywang Jul 9, 2026
dc01505
Preserve manual host approval route context
austinywang Jul 9, 2026
fe51733
Harden manual host approval lifecycle
austinywang Jul 9, 2026
b767ed1
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
13b5c8d
Add failing manual host trust lifecycle regressions
austinywang Jul 9, 2026
4264ce9
Revalidate manual host trust per request
austinywang Jul 9, 2026
bf24e29
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
991e617
Add failing manual host authorization ownership regressions
austinywang Jul 9, 2026
ee589ca
Scope manual host trust recovery to connection owners
austinywang Jul 9, 2026
494cfc2
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
b33cc7d
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 9, 2026
fd3e691
test(ios): cover manual host connection ownership races
austinywang Jul 9, 2026
84796c1
Add failing manual host security regressions
austinywang Jul 9, 2026
dc019a6
test(ios): cover manual host scope generations
austinywang Jul 9, 2026
5b9915e
test(ios): cover final manual-host auth races
austinywang Jul 9, 2026
523b20a
Secure manual host authorization epochs
austinywang Jul 10, 2026
a438eb3
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 10, 2026
8c7a854
Preserve main dictation capture semantics
austinywang Jul 10, 2026
e43754e
Extract mobile pairing entry points
austinywang Jul 10, 2026
b14f15f
Fix manual host persistence test identity
austinywang Jul 10, 2026
be98064
Avoid main actor deadlock in pairing retry test
austinywang Jul 10, 2026
d688304
Stabilize terminal replay barrier test
austinywang Jul 10, 2026
e741dfb
Stabilize pairing retry deadline test
austinywang Jul 10, 2026
44eb0cd
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
284b428
test(ios): cover same-interface manual host resume
austinywang Jul 10, 2026
916175c
Revoke manual host trust on foreground resume
austinywang Jul 10, 2026
804910d
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
471eb39
test(ios): cover path and secondary route fallbacks
austinywang Jul 10, 2026
89edd58
Handle same-interface paths and secondary fallbacks
austinywang Jul 10, 2026
70640f8
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
e675177
test(ios): cover final network trust lifecycle
austinywang Jul 10, 2026
73b36ae
fix(ios): close final network trust lifecycle gaps
austinywang Jul 10, 2026
dde44ca
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
0833c7f
test(ios): preserve queued auth cancellation
austinywang Jul 10, 2026
8d31371
fix(ios): preserve revoked send semantics
austinywang Jul 10, 2026
288842c
test(ios): cover repeated network approval race
austinywang Jul 10, 2026
55b7efc
fix(ios): rotate every network approval epoch
austinywang Jul 10, 2026
867d0bd
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
1a9d25a
test(ios): cover network recovery and route provenance
austinywang Jul 10, 2026
39b59c7
fix(ios): preserve latest recovery and manual provenance
austinywang Jul 10, 2026
abf02e5
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
a01b45f
test(ios): cover scene and trust expiry lifecycle
austinywang Jul 10, 2026
44accd5
fix(ios): own trust expiry and background boundaries
austinywang Jul 10, 2026
8368e54
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
ce15f09
test(ios): cover secondary trust and queue expiry
austinywang Jul 10, 2026
32db478
fix(ios): expire secondary trust and skip dead auth
austinywang Jul 10, 2026
2a01969
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
e4443e1
Organize manual host authorization helpers
austinywang Jul 10, 2026
b6a8538
Fix iOS manual host feature fixtures
austinywang Jul 10, 2026
d2c16ec
test(ios): cover pairing cancellation commit races
austinywang Jul 10, 2026
c9c8501
fix(ios): bind pairing commits to attempt ownership
austinywang Jul 10, 2026
83c6e69
Address final iOS review feedback
austinywang Jul 10, 2026
769ae4a
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 10, 2026
fb3fd5e
test(ios): cover final trust lifecycle races
austinywang Jul 14, 2026
84cdc18
fix(ios): close final trust ownership gaps
austinywang Jul 14, 2026
6671359
Merge remote-tracking branch 'origin/main' into issue-7230-trusted-ma…
austinywang Jul 15, 2026
693b4af
refactor(ios): split trust lifecycle fixtures
austinywang Jul 15, 2026
01c89c3
Merge origin/main into issue-7230-trusted-manual-host
austinywang Jul 15, 2026
402f5b6
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 15, 2026
2ff6501
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 16, 2026
848bcd6
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 16, 2026
7483ec4
Address review policy findings: DocC, file-scope helper, TestClock in…
austinywang Jul 16, 2026
b3f06a5
Add failing test: manual route priority must continue emitted sequence
austinywang Jul 16, 2026
836be17
Fix manual route priority to continue the emitted tailscale sequence
austinywang Jul 17, 2026
0987a6d
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 17, 2026
a4fba4c
Add failing test: second manual candidate must not clobber pending sw…
austinywang Jul 17, 2026
3f93301
Stop manual-host candidate iteration once an approval or supersession…
austinywang Jul 17, 2026
2874bc5
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang Jul 18, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Foundation

/// A normalized user-entered host for explicit manual mobile pairing routes.
///
/// Manual hosts are DNS names or IP literals that a user deliberately chooses
/// outside automatic Tailscale discovery. The value is only a host, never a URL:
/// schemes, paths, query/fragment markers, user-info markers, bare colon host
/// text, non-QR-safe characters, whitespace, and control characters are rejected
/// before the host is advertised or dialed.
public struct CmxManualHost: Equatable, Sendable {
/// The normalized bare host, with IPv6 brackets removed when present.
public let rawValue: String

/// Whether this host may be published as a remote manual pairing route.
///
/// Loopback names the publishing machine itself, so advertising it to a
/// phone would make the phone dial its own local process instead of the Mac.
public var isAdvertisable: Bool {
!CmxLoopbackHost().matches(rawValue)
}

/// Creates a normalized manual host.
///
/// - Parameter rawHost: A DNS name or IP literal. IPv6 literals must be
/// bracketed (`[fd00::1]`) so ordinary hostnames cannot hide colons.
public init?(_ rawHost: String) {
guard let host = CmxManualHostParser(
rawHost: rawHost,
acceptsBareIPv6: false
).normalizedHost else { return nil }
self.rawValue = host
}

/// Creates a manual host from attach-route endpoint form.
///
/// User-entered IPv6 must be bracketed so a typo like `my:host` is rejected
/// up front. Attach routes store IPv6 without brackets, so route/reconnect
/// paths use this initializer when they are validating an already-normalized
/// endpoint host.
/// - Parameter rawHost: A DNS name, IP literal, or already-normalized bare IPv6 endpoint host.
public init?(routeHost rawHost: String) {
guard let host = CmxManualHostParser(
rawHost: rawHost,
acceptsBareIPv6: true
).normalizedHost else { return nil }
self.rawValue = host
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Darwin
import Foundation

struct CmxManualHostParser {
let rawHost: String
let acceptsBareIPv6: Bool

var normalizedHost: String? {
let trimmed = rawHost.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else {
return nil
}

let host: String
let isBracketedHost: Bool
if trimmed.hasPrefix("[") || trimmed.hasSuffix("]") {
guard trimmed.hasPrefix("["),
trimmed.hasSuffix("]"),
trimmed.count > 2 else {
return nil
}
host = String(trimmed.dropFirst().dropLast())
isBracketedHost = true
} else {
host = trimmed
isBracketedHost = false
}

guard !host.isEmpty,
host.rangeOfCharacter(from: .whitespacesAndNewlines) == nil,
host.rangeOfCharacter(from: .controlCharacters) == nil,
host.range(of: "://") == nil else {
return nil
}
if isBracketedHost || acceptsBareIPv6, isIPv6Literal(host) {
return host
}
guard !isBracketedHost, isUnbracketedQRHost(host) else {
return nil
}
return host
}

private func isUnbracketedQRHost(_ host: String) -> Bool {
host.utf8.allSatisfy { byte in
(48...57).contains(byte) // 0-9
|| (65...90).contains(byte) // A-Z
|| (97...122).contains(byte) // a-z
|| byte == UInt8(ascii: ".")
|| byte == UInt8(ascii: "-")
|| byte == UInt8(ascii: "_")
}
}

private func isIPv6Literal(_ host: String) -> Bool {
var address = in6_addr()
return host.withCString { inet_pton(AF_INET6, $0, &address) } == 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ public struct CmxManualPairingEntry: Equatable, Sendable {
/// The port the user types into the phone's port field.
public let port: Int

/// The host value copied into the phone's manual-entry field.
///
/// IPv6 endpoint hosts are stored bare in attach routes, but the iOS manual
/// host parser requires brackets so the host/port boundary stays
/// unambiguous.
public var hostFieldValue: String {
host.contains(":") && !(host.hasPrefix("[") && host.hasSuffix("]"))
? "[\(host)]"
: host
}

/// Creates a manual-entry pair.
/// - Parameters:
/// - host: The address for the phone's host field.
Expand Down
Loading
Loading