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
122 changes: 61 additions & 61 deletions .claude/CLAUDE.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ jobs:
publish_crate ap-error-macro
publish_crate ap-error
publish_crate ap-noise
publish_crate ap-proxy-protocol
publish_crate ap-proxy-client
publish_crate ap-proxy
publish_crate ap-relay-protocol
publish_crate ap-relay-client
publish_crate ap-relay
publish_crate ap-client

# Last crate — no need to wait for indexing
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ It contains:
* An end-to-end encrypted tunnel, using Noise
* A Rust SDK for establishing a tunnel, sending requests, and responding to them
* A CLI tool for requesting / releasing credentials
* A proxy server for demo/development purposes
* A relay server for demo/development purposes

## Crate Structure

* `ap-error` - Error handling utilities for access-protocol. Re-exports the `ap_error` proc macro and provides the `FlatError` trait.
* `ap-error-macro` - Proc macro for generating error types with `FlatError` trait implementation. Simplified version of `bitwarden-error-macro` that only supports the `flat` error type for CLI use.
* `ap-noise` - Multi-device Noise-based Protocol implementation using the NNpsk2 pattern for secure channel establishment with PSK-based authentication.
* `ap-proxy` - Zero-knowledge WebSocket proxy server enabling secure rendezvous between remote and user clients. Runs as a standalone binary with environment-based configuration.
* `ap-client` - Remote and user client implementations for connecting through the proxy using the Noise Protocol.
* `ap-cli` - CLI interface for connecting to a user-client through a proxy to request credentials over a secure Noise Protocol channel. Manages session caching and device keypair storage.
* `ap-relay` - Zero-knowledge WebSocket relay server enabling secure rendezvous between remote and user clients. Runs as a standalone binary with environment-based configuration.
* `ap-client` - Remote and user client implementations for connecting through the relay using the Noise Protocol.
* `ap-cli` - CLI interface for connecting to a user-client through a relay to request credentials over a secure Noise Protocol channel. Manages session caching and device keypair storage.

## Building

Run `cargo build` in this directory. This is a standalone workspace and has no dependencies on any other Bitwarden components. Requires Rust 1.85+.

## Running

### Proxy Server
### Relay Server

Run the `ap-proxy` binary to start the WebSocket proxy server:
Run the `ap-relay` binary to start the WebSocket relay server:

```shell
cargo run -p ap-proxy
cargo run -p ap-relay
```

The proxy binds to `127.0.0.1:8080` by default. Set the `BIND_ADDR` environment variable to override.
The relay binds to `127.0.0.1:8080` by default. Set the `BIND_ADDR` environment variable to override.

### CLI

Expand All @@ -48,13 +48,13 @@ Retrieve credentials from your password manager over a secure channel
Usage: aac [OPTIONS] [COMMAND]

Commands:
connect Connect to proxy and request credentials
connect Connect to relay and request credentials
listen Listen for remote client connections (user-client mode)
connections Manage connections
help Print this message or the help of the given subcommand(s)

Options:
--proxy-url <PROXY_URL> Proxy server URL [default: wss://ap.lesspassword.dev]
--relay-url <RELAY_URL> Relay server URL [default: wss://ap.lesspassword.dev]
--token <TOKEN> Token (rendezvous code or PSK token)
--session <SESSION> Session fingerprint to reconnect to (hex string)
--no-cache Disable session caching
Expand All @@ -65,7 +65,7 @@ Options:

### Demo Flow

1. Start the proxy server with `cargo run -p ap-proxy`
1. Start the relay server with `cargo run -p ap-relay`
2. Start the user-client side with `cargo run --bin aac -- listen`
3. Enter the pairing token from step 2 into the `--token` argument of `aac connect`
4. Now `aac`, taking the role of the remote client, will let you type in domains to request credentials for, and you will approve them on the `listen` side from step 2
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ members = [
"crates/ap-error-macro",
"crates/ap-client",
"crates/ap-noise",
"crates/ap-proxy",
"crates/ap-proxy-client",
"crates/ap-proxy-protocol",
"crates/ap-relay",
"crates/ap-relay-client",
"crates/ap-relay-protocol",
"crates/ap-cli",
"crates/ap-uniffi",
]
Expand All @@ -19,7 +19,7 @@ exclude = [
]

[workspace.package]
version = "0.11.0"
version = "0.12.0"
authors = ["Bitwarden Inc"]
edition = "2024"
rust-version = "1.85"
Expand All @@ -28,13 +28,13 @@ repository = "https://github.com/bitwarden/agent-access"

[workspace.dependencies]
# Internal crates
ap-error = { path = "crates/ap-error", version = "0.11.0" }
ap-error-macro = { path = "crates/ap-error-macro", version = "0.11.0" }
ap-client = { path = "crates/ap-client", version = "0.11.0" }
ap-noise = { path = "crates/ap-noise", version = "0.11.0" }
ap-proxy = { path = "crates/ap-proxy", version = "0.11.0" }
ap-proxy-client = { path = "crates/ap-proxy-client", version = "0.11.0", default-features = false }
ap-proxy-protocol = { path = "crates/ap-proxy-protocol", version = "0.11.0" }
ap-error = { path = "crates/ap-error", version = "0.12.0" }
ap-error-macro = { path = "crates/ap-error-macro", version = "0.12.0" }
ap-client = { path = "crates/ap-client", version = "0.12.0" }
ap-noise = { path = "crates/ap-noise", version = "0.12.0" }
ap-relay = { path = "crates/ap-relay", version = "0.12.0" }
ap-relay-client = { path = "crates/ap-relay-client", version = "0.12.0", default-features = false }
ap-relay-protocol = { path = "crates/ap-relay-protocol", version = "0.12.0" }

# External dependencies
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ It contains:
* An end-to-end encrypted tunnel, using Noise
* A Rust SDK for establishing a tunnel, sending requests, and responding to them
* A CLI tool for requesting / releasing credentials
* A proxy server for demo/development purposes
* A relay server for demo/development purposes

<p align="center">
<picture>
Expand Down
4 changes: 2 additions & 2 deletions crates/ap-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ path = "src/main.rs"

[dependencies]
ap-noise = { workspace = true }
ap-proxy-client = { workspace = true, features = ["native-websocket"] }
ap-proxy-protocol = { workspace = true }
ap-relay-client = { workspace = true, features = ["native-websocket"] }
ap-relay-protocol = { workspace = true }
ap-client = { workspace = true, features = ["native-websocket"] }
async-trait = { workspace = true }
clap = { workspace = true }
Expand Down
Loading
Loading