Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
8062933
Add scoped temporary credential authentication
acking-you Aug 17, 2026
1884717
Make codec test configuration-independent
acking-you Aug 17, 2026
2fa4c46
Harden temporary credential authentication
acking-you Aug 17, 2026
781637f
Document module boundaries
acking-you Aug 17, 2026
93b501f
Reject conflicting auth configuration
acking-you Aug 17, 2026
5cec089
Distinguish invalid administrator keys
acking-you Aug 17, 2026
13c5df2
Bound timing wheel catch-up work
acking-you Aug 17, 2026
8e3a54c
Warn on invalid auth limits
acking-you Aug 17, 2026
6a5857a
Expire overdue timing wheel entries promptly
acking-you Aug 17, 2026
866d200
Harden auth lifecycle cleanup
acking-you Aug 17, 2026
aa69499
Persist temporary key tombstone times
acking-you Aug 17, 2026
5d485f3
Remove implicit credential authentication
acking-you Aug 17, 2026
86c2a1c
Defend against conflicting server key modes
acking-you Aug 17, 2026
a3b1c4b
Migrate missing tombstone timestamps safely
acking-you Aug 17, 2026
7466b4c
Fix authentication review findings
acking-you Aug 18, 2026
03799cd
Fix remaining authentication review findings
acking-you Aug 18, 2026
91e9e7e
Fix remaining isolated-relay, replay, and key-lifecycle review findings
acking-you Aug 18, 2026
460c540
Share auth and protocol helpers for later reuse
acking-you Aug 18, 2026
4d68a2c
Harden key initialization, slot generations, WAL, and stream auth
acking-you Aug 18, 2026
e07aa5c
Deny legacy framing in safe mode and cap legacy first flights
acking-you Aug 18, 2026
e5801bb
Document WAL rollback retryable contract
acking-you Aug 18, 2026
e3d4b3f
Harden safe-mode compaction, WAL durability, and first-flight admission
acking-you Aug 18, 2026
d3b23d7
Persist first-flight replay and close remaining auth gaps
acking-you Aug 18, 2026
ba02af7
Surface the exhausted salt-replay error on the second admin attempt
acking-you Aug 18, 2026
df7dcf5
Harden the durable replay log and exclusive auth-state ownership
acking-you Aug 18, 2026
b8a1e5d
Recover interrupted root rotation and release auth locks on shutdown
acking-you Aug 18, 2026
60b7582
Gate the embedded relay administrator key behind an explicit reveal
acking-you Aug 18, 2026
9ab8f0a
Recover interrupted resets and lock before first-start key creation
acking-you Aug 18, 2026
f85bbb0
Discard leftover WAL when recovering an interrupted reset
acking-you Aug 18, 2026
47b84ea
Flush the parent directory after Windows auth-state replacements
acking-you Aug 18, 2026
0042cf4
Discard leftover WAL when recovering an interrupted root rotation
acking-you Aug 18, 2026
d54a053
Wait for aborted connections and flush Windows dirs with write access
acking-you Aug 18, 2026
90c2b35
Return temporary_key_rotated after root rotation or reset
acking-you Aug 18, 2026
2026801
Fail closed on replay rollback and keep auth.lock in the actor
acking-you Aug 18, 2026
a81fa13
Refuse replacing live admin.key while encrypted state exists
acking-you Aug 18, 2026
a142d0f
Keep rotated errors after slot reuse and abort timed-out UI shutdown
acking-you Aug 18, 2026
82d9b0b
Harden replay recovery and stop accumulating wheel owners
acking-you Aug 18, 2026
45458e7
Retain admin replay claims from server acceptance time
acking-you Aug 18, 2026
3873d69
Harden replay I/O and keep previous root for rotated errors
acking-you Aug 18, 2026
e0be4d2
Skip machine-key reinit and pin running client credentials
acking-you Aug 18, 2026
0d78941
Pin registration workers and replace canceled renew leases
acking-you Aug 18, 2026
8bd5224
Bind tunneled checksums and finish actor/UI credential shutdown
acking-you Aug 18, 2026
33c8811
Bind local tunneled frames to the pinned credential key
acking-you Aug 18, 2026
566b213
Cover high-slot keys and unread first-flight errors
acking-you Aug 18, 2026
b71bf55
Keep lease cancel causes and bound first-flight load
acking-you Aug 19, 2026
80730a0
Wait for actor abort and avoid replay GCM reuse
acking-you Aug 19, 2026
5914473
Retry admin commands only before they are sent
acking-you Aug 19, 2026
717edae
Keep replay nonces unique and stream quotas live
acking-you Aug 19, 2026
ec32d78
Admit first flights under one blocking lock
acking-you Aug 19, 2026
baddd54
Claim limited and stale-root first flights
acking-you Aug 19, 2026
9ef2dde
Bound denial claims and verify container keys
acking-you Aug 19, 2026
ec52ab4
Claim auth errors and schedule high-slot expiry
acking-you Aug 19, 2026
22ae9d7
Bound actor abort and fail register/status
acking-you Aug 19, 2026
f113b3d
Abort pooled workers and keep Compose keys
acking-you Aug 19, 2026
86e4c2b
Reap connections and batch tombstones
acking-you Aug 19, 2026
71b99cd
Simplify auth expiry, first-flight, and UI pinning
acking-you Aug 19, 2026
8281780
Split auth persistence and first-flight modules
acking-you Aug 19, 2026
d25c448
Pin tunnel credentials once and share first-flight IO
acking-you Aug 19, 2026
6af7d24
Gate the Linux auth state dir helper by platform
acking-you Aug 20, 2026
bc2d708
Drive credential cleanup from timing-wheel callbacks
acking-you Aug 20, 2026
b8a61d4
Separate the timing wheel from what it schedules
acking-you Aug 20, 2026
d3d6ac4
Rebuild the timer wheel around nested routes; move to parking_lot
acking-you Aug 20, 2026
06542ba
Teach the CI path filter about crates/
acking-you Aug 21, 2026
c31eb3b
Drop dead code left over from earlier refactors
acking-you Aug 21, 2026
cadcb5e
Move to Rust 1.98.0, still on edition 2021
acking-you Aug 21, 2026
6c763ba
Move DNS resolution to hickory-resolver
acking-you Aug 21, 2026
9d9f65f
Upgrade the remaining dependencies
acking-you Aug 21, 2026
601bb9e
Migrate to edition 2024
acking-you Aug 21, 2026
9351bfa
Extract pb-mapper-core
acking-you Aug 21, 2026
cbffba4
Extract pb-mapper-auth
acking-you Aug 21, 2026
c064b46
Extract pb-mapper-protocol
acking-you Aug 21, 2026
96a627e
Split out server, client, and the CLI; root becomes virtual
acking-you Aug 21, 2026
1611554
Deny unwrap and expect across the workspace
acking-you Aug 21, 2026
7b7cebe
Correct the documentation for the split, and the drift it uncovered
acking-you Aug 21, 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
16 changes: 15 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Verify release tag matches Cargo version
shell: bash
run: |
set -euo pipefail
package_version="$(awk '
/^\[workspace.package\]$/ { in_workspace = 1; next }
in_workspace && /^version = / {
gsub(/"/, "", $3)
print $3
exit
}
' Cargo.toml)"
test "${GITHUB_REF_NAME}" = "v${package_version}"

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -47,7 +61,7 @@ jobs:
uses: houseabsolute/actions-rust-cross@v1
with:
target: ${{ matrix.target.arch }}-unknown-linux-musl
toolchain: 1.88.0
toolchain: 1.98.0
args: "--locked --release --bin pb-mapper"
strip: true

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
- name: Build latest Windows FFI
run: |
make build-pb-mapper-ffi-windows
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
- name: Install dependencies
run: |
sudo apt-get update -y
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
- name: Set up Android NDK
uses: nttld/setup-ndk@v1
with:
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
- name: Install appdmg
run: |
npm install -g appdmg
Expand Down Expand Up @@ -480,7 +480,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
- name: Build latest iOS FFI
run: |
make build-pb-mapper-ffi-ios
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
uses: houseabsolute/actions-rust-cross@v1
with:
target: ${{ matrix.platform.target }}
toolchain: 1.88.0
toolchain: 1.98.0
args: "--locked --release --bin pb-mapper"
strip: true

Expand All @@ -77,3 +77,7 @@ jobs:
LICENSE
README.md
README.zh-CN.md
docs/authentication-v2.md
docs/authentication-v2.zh-CN.md
docs/user-guide.md
docs/user-guide.zh-CN.md
7 changes: 5 additions & 2 deletions .github/workflows/syntax-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ jobs:
# belongs to the Rust side and must be matched before ui/*.
ui/native/*) rust=true ;;
ui/*) flutter=true ;;
src/*|tests/*|examples/*) rust=true ;;
crates/*|src/*|tests/*|examples/*) rust=true ;;
Cargo.toml|Cargo.lock|rust-toolchain.toml|rustfmt.toml) rust=true ;;
# Per-crate manifests. `case` patterns match the whole path, so
# the unanchored entry above only ever catches the root manifest.
*/Cargo.toml|*/Cargo.lock) rust=true ;;
# A change to this workflow has to prove itself on both.
.github/workflows/syntax-check.yml) rust=true; flutter=true ;;
esac
Expand All @@ -88,7 +91,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
toolchain: 1.98.0
components: clippy, rustfmt

- name: Cache Rust dependencies
Expand Down
21 changes: 14 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# Repository Guidelines

## Architecture Overview
- One `pb-mapper` binary in `src/bin/` with four role commands:
- One `pb-mapper` binary in `crates/pb-mapper-cli/src/bin/` with five role commands:
- `server`: central router (default port 7666)
- `register`: registers local TCP/UDP services with the router
- `connect`: connects to a registered service and exposes a local port
- `status`: queries router IDs and registered keys
- Core crates: `src/pb_server`, `src/local/{server,client}`, `src/common` (protocol, streams, listeners), `src/utils`.
- `admin`: issues, lists, and revokes credentials; rotates the administrator key
- Crates, bottom-up: `pb-mapper-core` (credentials, checksum, config, addressing)
→ `pb-mapper-auth` (credential lifecycle and persistence) → `pb-mapper-protocol`
(framing and secure sessions) → `pb-mapper-server` and `pb-mapper-client`, which
are peers → `pb-mapper-cli`. `ui/native/pb_mapper_ffi` is the C ABI cdylib.

## Project Structure & Modules
- `src/`: Rust backend and CLI
- `src/bin/pb-mapper.rs`: unified CLI entry point
- `src/pb_server`, `src/local`, `src/common`, `src/utils`
- `crates/`: the Rust workspace; the root `Cargo.toml` is a virtual manifest
- `crates/pb-mapper-cli/src/bin/pb-mapper.rs`: unified CLI entry point
- `crates/pb-mapper-{core,auth,protocol,server,client,cli}`
- `crates/pb-mapper-cli/tests/`: integration tests; loads env from `tests/.env`
- `crates/pb-mapper-cli/examples/`: runnable examples
- `ui/`: Flutter UI; Rust bridge under `ui/native/*`
- `tests/`: integration tests; loads env from `tests/.env`
- `docker/`, `services/`, `scripts/`: container, systemd, build/release

## Build, Test, and Development Commands
Expand All @@ -28,7 +33,9 @@
Notes: CI builds release artifacts on tags `vX.Y.Z` (see `.github/workflows/release.yml`).

## Coding Style & Naming Conventions
- Rust 2021; toolchain pinned via `rust-toolchain.toml` (CI uses 1.88.0)
- Edition is set once in `[workspace.package]`; the toolchain is pinned in
`rust-toolchain.toml`, which CI installs. Both are deliberately not repeated
here — a version in prose goes stale on the next upgrade.
- Format: `cargo fmt --all` (4 spaces; import grouping per `rustfmt.toml`)
- Lint: `cargo clippy --all-targets -- -D warnings`
- Naming: modules/functions `snake_case`, types/traits `PascalCase`, consts `SCREAMING_SNAKE_CASE`
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## [0.4.0] - 2026-08-18
- Added a sole administrator credential plus renewable, expiring, and immediately revocable `pbmt1_` temporary credentials with fixed-slot O(1) lookup and isolated per-key service namespaces.
- Added single-flight protocol-v2 authentication with directional AES-256-GCM keys, monotonic frame counters, authenticated routing metadata, durable first-flight replay protection, and optional legacy framing during migration.
- Added encrypted snapshot/WAL authentication state, exclusive `auth.lock`, lifecycle audit records, hierarchical timing-wheel expiry, hard closure of revoked live connections, recoverable root-key rotation, and explicit auth-state reset.
- Extended the unified CLI with temporary-key lifecycle, service/connection inventory, auth status, protocol policy, root rotation, namespace targeting, and human/JSON/NDJSON output.
- Replaced insecure default-key fallback with first-start random administrator-key generation, retained machine-derived keys only for explicit compatibility, and updated Flutter, installers, systemd, Docker, release metadata, and bilingual documentation.
- Recovery keys must decrypt existing snapshot or WAL state before they are persisted. Interrupted rotation and reset recover from staged `admin.key.next` and `server-instance-id.next`.
- First-flight salts are unique for nonce 0: admission is atomic under one lock, torn replay records fail closed, and a nonce-0 error frame is sent only after that salt is reserved.
- Pinned UI and local tunnels to the credential and relay address captured at start, and bound tunneled-frame checksums to each hop's authenticated session key.
- Aborted pooled registration workers and accepted connection tasks on shutdown; the relay reaps connection tasks with a `JoinSet`.

## [0.3.0] - 2026-08-18
- Replaced the three role-specific executables with one `pb-mapper` CLI and explicit `server`, `register`, `connect`, and `status` commands.
- Consolidated release archives into one cross-platform binary artifact per target and updated Docker, installers, systemd templates, build scripts, deployment skills, and documentation to use it.
Expand Down
Loading
Loading