Compare commits
4 Commits
terrors-re
...
security-b
| Author | SHA1 | Date | |
|---|---|---|---|
| 075d33219e | |||
| 8cb6f4abe0 | |||
|
|
4bac70a6e9 | ||
|
|
54a41743be |
6
.gitignore
vendored
@@ -1,5 +1 @@
|
|||||||
target/
|
target/
|
||||||
scripts/__pycache__/
|
|
||||||
.DS_Store
|
|
||||||
.cargo/config.toml
|
|
||||||
.vscode/
|
|
||||||
@@ -8,7 +8,7 @@ when:
|
|||||||
include: ['.woodpecker/server-*.yaml', 'server/**']
|
include: ['.woodpecker/server-*.yaml', 'server/**']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: audit
|
- name: test
|
||||||
image: jdxcode/mise:latest
|
image: jdxcode/mise:latest
|
||||||
directory: server
|
directory: server
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
path:
|
|
||||||
include: ['.woodpecker/server-*.yaml', 'server/**']
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
path:
|
|
||||||
include: ['.woodpecker/server-*.yaml', 'server/**']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: lint
|
|
||||||
image: jdxcode/mise:latest
|
|
||||||
directory: server
|
|
||||||
environment:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
CARGO_TARGET_DIR: /usr/local/cargo/target
|
|
||||||
CARGO_HOME: /usr/local/cargo/registry
|
|
||||||
volumes:
|
|
||||||
- cargo-target:/usr/local/cargo/target
|
|
||||||
- cargo-registry:/usr/local/cargo/registry
|
|
||||||
commands:
|
|
||||||
- apt-get update && apt-get install -y pkg-config
|
|
||||||
- mise install rust
|
|
||||||
- mise install protoc
|
|
||||||
- mise exec rust -- cargo clippy --all -- -D warnings
|
|
||||||
@@ -8,7 +8,7 @@ when:
|
|||||||
include: ['.woodpecker/server-*.yaml', 'server/**']
|
include: ['.woodpecker/server-*.yaml', 'server/**']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: vet
|
- name: test
|
||||||
image: jdxcode/mise:latest
|
image: jdxcode/mise:latest
|
||||||
directory: server
|
directory: server
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
path:
|
|
||||||
include: ['.woodpecker/useragent-*.yaml', 'useragent/**']
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
path:
|
|
||||||
include: ['.woodpecker/useragent-*.yaml', 'useragent/**']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: analyze
|
|
||||||
image: jdxcode/mise:latest
|
|
||||||
commands:
|
|
||||||
- mise install flutter
|
|
||||||
- mise install protoc
|
|
||||||
# Reruns codegen to catch protocol drift
|
|
||||||
- mise codegen
|
|
||||||
- cd useragent/ && flutter analyze
|
|
||||||
128
AGENTS.md
@@ -1,128 +0,0 @@
|
|||||||
# AGENTS.md
|
|
||||||
|
|
||||||
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Project Overview
|
|
||||||
|
|
||||||
Arbiter is a **permissioned signing service** for cryptocurrency wallets. It consists of:
|
|
||||||
- **`server/`** — Rust gRPC daemon that holds encrypted keys and enforces policies
|
|
||||||
- **`useragent/`** — Flutter desktop app (macOS/Windows) with a Rust backend via Rinf
|
|
||||||
- **`protobufs/`** — Protocol Buffer definitions shared between server and client
|
|
||||||
|
|
||||||
The vault never exposes key material; it only produces signatures when requests satisfy configured policies.
|
|
||||||
|
|
||||||
## Toolchain Setup
|
|
||||||
|
|
||||||
Tools are managed via [mise](https://mise.jdx.dev/). Install all required tools:
|
|
||||||
```sh
|
|
||||||
mise install
|
|
||||||
```
|
|
||||||
|
|
||||||
Key versions: Rust 1.93.0 (with clippy), Flutter 3.38.9-stable, protoc 29.6, diesel_cli 2.3.6 (sqlite).
|
|
||||||
|
|
||||||
## Server (Rust workspace at `server/`)
|
|
||||||
|
|
||||||
### Crates
|
|
||||||
|
|
||||||
| Crate | Purpose |
|
|
||||||
|---|---|
|
|
||||||
| `arbiter-proto` | Generated gRPC stubs + protobuf types; compiled from `protobufs/*.proto` via `tonic-prost-build` |
|
|
||||||
| `arbiter-server` | Main daemon — actors, DB, EVM policy engine, gRPC service implementation |
|
|
||||||
| `arbiter-useragent` | Rust client library for the user agent side of the gRPC protocol |
|
|
||||||
| `arbiter-client` | Rust client library for SDK clients |
|
|
||||||
|
|
||||||
### Common Commands
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd server
|
|
||||||
|
|
||||||
# Build
|
|
||||||
cargo build
|
|
||||||
|
|
||||||
# Run the server daemon
|
|
||||||
cargo run -p arbiter-server
|
|
||||||
|
|
||||||
# Run all tests (preferred over cargo test)
|
|
||||||
cargo nextest run
|
|
||||||
|
|
||||||
# Run a single test
|
|
||||||
cargo nextest run <test_name>
|
|
||||||
|
|
||||||
# Lint
|
|
||||||
cargo clippy
|
|
||||||
|
|
||||||
# Security audit
|
|
||||||
cargo audit
|
|
||||||
|
|
||||||
# Check unused dependencies
|
|
||||||
cargo shear
|
|
||||||
|
|
||||||
# Run snapshot tests and update snapshots
|
|
||||||
cargo insta review
|
|
||||||
```
|
|
||||||
|
|
||||||
### Architecture
|
|
||||||
|
|
||||||
The server is actor-based using the **kameo** crate. All long-lived state lives in `GlobalActors`:
|
|
||||||
|
|
||||||
- **`Bootstrapper`** — Manages the one-time bootstrap token written to `~/.arbiter/bootstrap_token` on first run.
|
|
||||||
- **`KeyHolder`** — Holds the encrypted root key and manages the Sealed/Unsealed vault state machine. On unseal, decrypts the root key into a `memsafe` hardened memory cell.
|
|
||||||
- **`MessageRouter`** — Coordinates streaming messages between user agents and SDK clients.
|
|
||||||
- **`EvmActor`** — Handles EVM transaction policy enforcement and signing.
|
|
||||||
|
|
||||||
Per-connection actors live under `actors/user_agent/` and `actors/client/`, each with `auth` (challenge-response authentication) and `session` (post-auth operations) sub-modules.
|
|
||||||
|
|
||||||
**Database:** SQLite via `diesel-async` + `bb8` connection pool. Schema managed by embedded Diesel migrations in `crates/arbiter-server/migrations/`. DB file lives at `~/.arbiter/arbiter.sqlite`. Tests use a temp-file DB via `db::create_test_pool()`.
|
|
||||||
|
|
||||||
**Cryptography:**
|
|
||||||
- Authentication: ed25519 (challenge-response, nonce-tracked per peer)
|
|
||||||
- Encryption at rest: XChaCha20-Poly1305 (versioned via `scheme` field for transparent migration on unseal)
|
|
||||||
- Password KDF: Argon2
|
|
||||||
- Unseal transport: X25519 ephemeral key exchange
|
|
||||||
- TLS: self-signed certificate (aws-lc-rs backend), fingerprint distributed via `ArbiterUrl`
|
|
||||||
|
|
||||||
**Protocol:** gRPC with Protocol Buffers. The `ArbiterUrl` type encodes host, port, CA cert, and bootstrap token into a single shareable string (printed to console on first run).
|
|
||||||
|
|
||||||
### Proto Regeneration
|
|
||||||
|
|
||||||
When `.proto` files in `protobufs/` change, rebuild to regenerate:
|
|
||||||
```sh
|
|
||||||
cd server && cargo build -p arbiter-proto
|
|
||||||
```
|
|
||||||
|
|
||||||
### Database Migrations
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Create a new migration
|
|
||||||
diesel migration generate <name> --migration-dir crates/arbiter-server/migrations
|
|
||||||
|
|
||||||
# Run migrations manually (server also runs them on startup)
|
|
||||||
diesel migration run --migration-dir crates/arbiter-server/migrations
|
|
||||||
```
|
|
||||||
|
|
||||||
## User Agent (Flutter + Rinf at `useragent/`)
|
|
||||||
|
|
||||||
The Flutter app uses [Rinf](https://rinf.cunarist.org) to call Rust code. The Rust logic lives in `useragent/native/hub/` as a separate crate that uses `arbiter-useragent` for the gRPC client.
|
|
||||||
|
|
||||||
Communication between Dart and Rust uses typed **signals** defined in `useragent/native/hub/src/signals/`. After modifying signal structs, regenerate Dart bindings:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd useragent && rinf gen
|
|
||||||
```
|
|
||||||
|
|
||||||
### Common Commands
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd useragent
|
|
||||||
|
|
||||||
# Run the app (macOS or Windows)
|
|
||||||
flutter run
|
|
||||||
|
|
||||||
# Regenerate Rust↔Dart signal bindings
|
|
||||||
rinf gen
|
|
||||||
|
|
||||||
# Analyze Dart code
|
|
||||||
flutter analyze
|
|
||||||
```
|
|
||||||
|
|
||||||
The Rinf Rust entry point is `useragent/native/hub/src/lib.rs`. It spawns actors defined in `useragent/native/hub/src/actors/` which handle Dart↔server communication via signals.
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
Arbiter is a permissioned signing service for cryptocurrency wallets. It runs as a background service on the user's machine with an optional client application for vault management.
|
Arbiter is a permissioned signing service for cryptocurrency wallets. It runs as a background service on the user's machine with an optional client application for vault management.
|
||||||
|
|
||||||
**Core principle:** The vault NEVER exposes key material. It only produces signatures when a request satisfies the configured policies.
|
**Core principle:** The vault NEVER exposes key material. It only produces signatures when a request satisfies the configured policies.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 1. Peer Types
|
## 1. Peer Types
|
||||||
|
|||||||
128
CLAUDE.md
@@ -1,128 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Project Overview
|
|
||||||
|
|
||||||
Arbiter is a **permissioned signing service** for cryptocurrency wallets. It consists of:
|
|
||||||
- **`server/`** — Rust gRPC daemon that holds encrypted keys and enforces policies
|
|
||||||
- **`useragent/`** — Flutter desktop app (macOS/Windows) with a Rust backend via Rinf
|
|
||||||
- **`protobufs/`** — Protocol Buffer definitions shared between server and client
|
|
||||||
|
|
||||||
The vault never exposes key material; it only produces signatures when requests satisfy configured policies.
|
|
||||||
|
|
||||||
## Toolchain Setup
|
|
||||||
|
|
||||||
Tools are managed via [mise](https://mise.jdx.dev/). Install all required tools:
|
|
||||||
```sh
|
|
||||||
mise install
|
|
||||||
```
|
|
||||||
|
|
||||||
Key versions: Rust 1.93.0 (with clippy), Flutter 3.38.9-stable, protoc 29.6, diesel_cli 2.3.6 (sqlite).
|
|
||||||
|
|
||||||
## Server (Rust workspace at `server/`)
|
|
||||||
|
|
||||||
### Crates
|
|
||||||
|
|
||||||
| Crate | Purpose |
|
|
||||||
|---|---|
|
|
||||||
| `arbiter-proto` | Generated gRPC stubs + protobuf types; compiled from `protobufs/*.proto` via `tonic-prost-build` |
|
|
||||||
| `arbiter-server` | Main daemon — actors, DB, EVM policy engine, gRPC service implementation |
|
|
||||||
| `arbiter-useragent` | Rust client library for the user agent side of the gRPC protocol |
|
|
||||||
| `arbiter-client` | Rust client library for SDK clients |
|
|
||||||
|
|
||||||
### Common Commands
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd server
|
|
||||||
|
|
||||||
# Build
|
|
||||||
cargo build
|
|
||||||
|
|
||||||
# Run the server daemon
|
|
||||||
cargo run -p arbiter-server
|
|
||||||
|
|
||||||
# Run all tests (preferred over cargo test)
|
|
||||||
cargo nextest run
|
|
||||||
|
|
||||||
# Run a single test
|
|
||||||
cargo nextest run <test_name>
|
|
||||||
|
|
||||||
# Lint
|
|
||||||
cargo clippy
|
|
||||||
|
|
||||||
# Security audit
|
|
||||||
cargo audit
|
|
||||||
|
|
||||||
# Check unused dependencies
|
|
||||||
cargo shear
|
|
||||||
|
|
||||||
# Run snapshot tests and update snapshots
|
|
||||||
cargo insta review
|
|
||||||
```
|
|
||||||
|
|
||||||
### Architecture
|
|
||||||
|
|
||||||
The server is actor-based using the **kameo** crate. All long-lived state lives in `GlobalActors`:
|
|
||||||
|
|
||||||
- **`Bootstrapper`** — Manages the one-time bootstrap token written to `~/.arbiter/bootstrap_token` on first run.
|
|
||||||
- **`KeyHolder`** — Holds the encrypted root key and manages the Sealed/Unsealed vault state machine. On unseal, decrypts the root key into a `memsafe` hardened memory cell.
|
|
||||||
- **`MessageRouter`** — Coordinates streaming messages between user agents and SDK clients.
|
|
||||||
- **`EvmActor`** — Handles EVM transaction policy enforcement and signing.
|
|
||||||
|
|
||||||
Per-connection actors live under `actors/user_agent/` and `actors/client/`, each with `auth` (challenge-response authentication) and `session` (post-auth operations) sub-modules.
|
|
||||||
|
|
||||||
**Database:** SQLite via `diesel-async` + `bb8` connection pool. Schema managed by embedded Diesel migrations in `crates/arbiter-server/migrations/`. DB file lives at `~/.arbiter/arbiter.sqlite`. Tests use a temp-file DB via `db::create_test_pool()`.
|
|
||||||
|
|
||||||
**Cryptography:**
|
|
||||||
- Authentication: ed25519 (challenge-response, nonce-tracked per peer)
|
|
||||||
- Encryption at rest: XChaCha20-Poly1305 (versioned via `scheme` field for transparent migration on unseal)
|
|
||||||
- Password KDF: Argon2
|
|
||||||
- Unseal transport: X25519 ephemeral key exchange
|
|
||||||
- TLS: self-signed certificate (aws-lc-rs backend), fingerprint distributed via `ArbiterUrl`
|
|
||||||
|
|
||||||
**Protocol:** gRPC with Protocol Buffers. The `ArbiterUrl` type encodes host, port, CA cert, and bootstrap token into a single shareable string (printed to console on first run).
|
|
||||||
|
|
||||||
### Proto Regeneration
|
|
||||||
|
|
||||||
When `.proto` files in `protobufs/` change, rebuild to regenerate:
|
|
||||||
```sh
|
|
||||||
cd server && cargo build -p arbiter-proto
|
|
||||||
```
|
|
||||||
|
|
||||||
### Database Migrations
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Create a new migration
|
|
||||||
diesel migration generate <name> --migration-dir crates/arbiter-server/migrations
|
|
||||||
|
|
||||||
# Run migrations manually (server also runs them on startup)
|
|
||||||
diesel migration run --migration-dir crates/arbiter-server/migrations
|
|
||||||
```
|
|
||||||
|
|
||||||
## User Agent (Flutter + Rinf at `useragent/`)
|
|
||||||
|
|
||||||
The Flutter app uses [Rinf](https://rinf.cunarist.org) to call Rust code. The Rust logic lives in `useragent/native/hub/` as a separate crate that uses `arbiter-useragent` for the gRPC client.
|
|
||||||
|
|
||||||
Communication between Dart and Rust uses typed **signals** defined in `useragent/native/hub/src/signals/`. After modifying signal structs, regenerate Dart bindings:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd useragent && rinf gen
|
|
||||||
```
|
|
||||||
|
|
||||||
### Common Commands
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd useragent
|
|
||||||
|
|
||||||
# Run the app (macOS or Windows)
|
|
||||||
flutter run
|
|
||||||
|
|
||||||
# Regenerate Rust↔Dart signal bindings
|
|
||||||
rinf gen
|
|
||||||
|
|
||||||
# Analyze Dart code
|
|
||||||
flutter analyze
|
|
||||||
```
|
|
||||||
|
|
||||||
The Rinf Rust entry point is `useragent/native/hub/src/lib.rs`. It spawns actors defined in `useragent/native/hub/src/actors/` which handle Dart↔server communication via signals.
|
|
||||||
@@ -4,66 +4,6 @@ This document covers concrete technology choices and dependencies. For the archi
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Client Connection Flow
|
|
||||||
|
|
||||||
### Authentication Result Semantics
|
|
||||||
|
|
||||||
Authentication no longer uses an implicit success-only response shape. Both `client` and `user-agent` return explicit auth status enums over the wire.
|
|
||||||
|
|
||||||
- **Client:** `AuthResult` may return `SUCCESS`, `INVALID_KEY`, `INVALID_SIGNATURE`, `APPROVAL_DENIED`, `NO_USER_AGENTS_ONLINE`, or `INTERNAL`
|
|
||||||
- **User-agent:** `AuthResult` may return `SUCCESS`, `INVALID_KEY`, `INVALID_SIGNATURE`, `BOOTSTRAP_REQUIRED`, `TOKEN_INVALID`, or `INTERNAL`
|
|
||||||
|
|
||||||
This makes transport-level failures and actor/domain-level auth failures distinct:
|
|
||||||
|
|
||||||
- **Transport/protocol failures** are surfaced as stream/status errors
|
|
||||||
- **Authentication failures** are surfaced as successful protocol responses carrying an explicit auth status
|
|
||||||
|
|
||||||
Clients are expected to handle these status codes directly and present the concrete failure reason to the user.
|
|
||||||
|
|
||||||
### New Client Approval
|
|
||||||
|
|
||||||
When a client whose public key is not yet in the database connects, all connected user agents are asked to approve the connection. The first agent to respond determines the outcome; remaining requests are cancelled via a watch channel.
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
flowchart TD
|
|
||||||
A([Client connects]) --> B[Receive AuthChallengeRequest]
|
|
||||||
B --> C{pubkey in DB?}
|
|
||||||
|
|
||||||
C -- yes --> D[Read nonce\nIncrement nonce in DB]
|
|
||||||
D --> G
|
|
||||||
|
|
||||||
C -- no --> E[Ask all UserAgents:\nClientConnectionRequest]
|
|
||||||
E --> F{First response}
|
|
||||||
F -- denied --> Z([Reject connection])
|
|
||||||
F -- approved --> F2[Cancel remaining\nUserAgent requests]
|
|
||||||
F2 --> F3[INSERT client\nnonce = 1]
|
|
||||||
F3 --> G[Send AuthChallenge\nwith nonce]
|
|
||||||
|
|
||||||
G --> H[Receive AuthChallengeSolution]
|
|
||||||
H --> I{Signature valid?}
|
|
||||||
I -- no --> Z
|
|
||||||
I -- yes --> J([Session started])
|
|
||||||
```
|
|
||||||
|
|
||||||
### Known Issue: Concurrent Registration Race (TOCTOU)
|
|
||||||
|
|
||||||
Two connections presenting the same previously-unknown public key can race through the approval flow simultaneously:
|
|
||||||
|
|
||||||
1. Both check the DB → neither is registered.
|
|
||||||
2. Both request approval from user agents → both receive approval.
|
|
||||||
3. Both `INSERT` the client record → the second insert silently overwrites the first, resetting the nonce.
|
|
||||||
|
|
||||||
This means the first connection's nonce is invalidated by the second, causing its challenge verification to fail. A fix requires either serialising new-client registration (e.g. an in-memory lock keyed on pubkey) or replacing the separate check + insert with an `INSERT OR IGNORE` / upsert guarded by a unique constraint on `public_key`.
|
|
||||||
|
|
||||||
### Nonce Semantics
|
|
||||||
|
|
||||||
The `program_client.nonce` column stores the **next usable nonce** — i.e. it is always one ahead of the nonce last issued in a challenge.
|
|
||||||
|
|
||||||
- **New client:** inserted with `nonce = 1`; the first challenge is issued with `nonce = 0`.
|
|
||||||
- **Existing client:** the current DB value is read and used as the challenge nonce, then immediately incremented within the same exclusive transaction, preventing replay.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Cryptography
|
## Cryptography
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
@@ -82,97 +22,9 @@ The `program_client.nonce` column stores the **next usable nonce** — i.e. it i
|
|||||||
## Communication
|
## Communication
|
||||||
|
|
||||||
- **Protocol:** gRPC with Protocol Buffers
|
- **Protocol:** gRPC with Protocol Buffers
|
||||||
- **Request/response matching:** multiplexed over a single bidirectional stream using per-connection request IDs
|
|
||||||
- **Server identity distribution:** `ServerInfo` protobuf struct containing the TLS public key fingerprint
|
- **Server identity distribution:** `ServerInfo` protobuf struct containing the TLS public key fingerprint
|
||||||
- **Future consideration:** grpc-web lacks bidirectional stream support, so a browser-based wallet may require protojson over WebSocket
|
- **Future consideration:** grpc-web lacks bidirectional stream support, so a browser-based wallet may require protojson over WebSocket
|
||||||
|
|
||||||
### Request Multiplexing
|
|
||||||
|
|
||||||
Both `client` and `user-agent` connections support multiple in-flight requests over one gRPC bidi stream.
|
|
||||||
|
|
||||||
- Every request carries a monotonically increasing request ID
|
|
||||||
- Every normal response echoes the request ID it corresponds to
|
|
||||||
- Out-of-band server messages omit the response ID entirely
|
|
||||||
- The server rejects already-seen request IDs at the transport adapter boundary before business logic sees the message
|
|
||||||
|
|
||||||
This keeps request correlation entirely in transport/client connection code while leaving actor and domain handlers unaware of request IDs.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## EVM Policy Engine
|
|
||||||
|
|
||||||
### Overview
|
|
||||||
|
|
||||||
The EVM engine classifies incoming transactions, enforces grant constraints, and records executions. It is the sole path through which a wallet key is used for signing.
|
|
||||||
|
|
||||||
The central abstraction is the `Policy` trait. Each implementation handles one semantic transaction category and owns its own database tables for grant storage and transaction logging.
|
|
||||||
|
|
||||||
### Transaction Evaluation Flow
|
|
||||||
|
|
||||||
`Engine::evaluate_transaction` runs the following steps in order:
|
|
||||||
|
|
||||||
1. **Classify** — Each registered policy's `analyze(context)` inspects the transaction fields (`chain`, `to`, `value`, `calldata`). The first one returning `Some(meaning)` wins. If none match, the transaction is rejected as `UnsupportedTransactionType`.
|
|
||||||
2. **Find grant** — `Policy::try_find_grant` queries for a non-revoked grant covering this wallet, client, chain, and target address.
|
|
||||||
3. **Check shared constraints** — `check_shared_constraints` runs in the engine before any policy-specific logic. It enforces the validity window, gas fee caps, and transaction count rate limit (see below).
|
|
||||||
4. **Evaluate** — `Policy::evaluate` checks the decoded meaning against the grant's policy-specific constraints and returns any violations.
|
|
||||||
5. **Record** — If `RunKind::Execution` and there are no violations, the engine writes to `evm_transaction_log` and calls `Policy::record_transaction` for any policy-specific logging (e.g., token transfer volume).
|
|
||||||
|
|
||||||
### Policy Trait
|
|
||||||
|
|
||||||
| Method | Purpose |
|
|
||||||
|---|---|
|
|
||||||
| `analyze` | Pure — classifies a transaction into a typed `Meaning`, or `None` if this policy doesn't apply |
|
|
||||||
| `evaluate` | Checks the `Meaning` against a `Grant`; returns a list of `EvalViolation`s |
|
|
||||||
| `create_grant` | Inserts policy-specific rows; returns the specific grant ID |
|
|
||||||
| `try_find_grant` | Finds a matching non-revoked grant for the given `EvalContext` |
|
|
||||||
| `find_all_grants` | Returns all non-revoked grants (used for listing) |
|
|
||||||
| `record_transaction` | Persists policy-specific data after execution |
|
|
||||||
|
|
||||||
`analyze` and `evaluate` are intentionally separate: classification is pure and cheap, while evaluation may involve DB queries (e.g., fetching past transfer volume).
|
|
||||||
|
|
||||||
### Registered Policies
|
|
||||||
|
|
||||||
**EtherTransfer** — plain ETH transfers (empty calldata)
|
|
||||||
|
|
||||||
- Grant requires: allowlist of recipient addresses + one volumetric rate limit (max ETH over a time window)
|
|
||||||
- Violations: recipient not in allowlist, cumulative ETH volume exceeded
|
|
||||||
|
|
||||||
**TokenTransfer** — ERC-20 `transfer(address,uint256)` calls
|
|
||||||
|
|
||||||
- Recognised by ABI-decoding the `transfer(address,uint256)` selector against a static registry of known token contracts (`arbiter_tokens_registry`)
|
|
||||||
- Grant requires: token contract address, optional recipient restriction, zero or more volumetric rate limits
|
|
||||||
- Violations: recipient mismatch, any volumetric limit exceeded
|
|
||||||
|
|
||||||
### Grant Model
|
|
||||||
|
|
||||||
Every grant has two layers:
|
|
||||||
|
|
||||||
- **Shared (`evm_basic_grant`)** — wallet, chain, validity period, gas fee caps, transaction count rate limit. One row per grant regardless of type.
|
|
||||||
- **Specific** — policy-owned tables (`evm_ether_transfer_grant`, `evm_token_transfer_grant`, etc.) holding type-specific configuration.
|
|
||||||
|
|
||||||
`find_all_grants` uses a `#[diesel::auto_type]` base join between the specific and shared tables, then batch-loads related rows (targets, volume limits) in two additional queries to avoid N+1.
|
|
||||||
|
|
||||||
The engine exposes `list_all_grants` which collects across all policy types into `Vec<Grant<SpecificGrant>>` via a blanket `From<Grant<S>> for Grant<SpecificGrant>` conversion.
|
|
||||||
|
|
||||||
### Shared Constraints (enforced by the engine)
|
|
||||||
|
|
||||||
These are checked centrally in `check_shared_constraints` before policy evaluation:
|
|
||||||
|
|
||||||
| Constraint | Fields | Behaviour |
|
|
||||||
|---|---|---|
|
|
||||||
| Validity window | `valid_from`, `valid_until` | Emits `InvalidTime` if current time is outside the range |
|
|
||||||
| Gas fee cap | `max_gas_fee_per_gas`, `max_priority_fee_per_gas` | Emits `GasLimitExceeded` if either cap is breached |
|
|
||||||
| Tx count rate limit | `rate_limit` (`count` + `window`) | Counts rows in `evm_transaction_log` within the window; emits `RateLimitExceeded` if at or above the limit |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Known Limitations
|
|
||||||
|
|
||||||
- **Only EIP-1559 transactions are supported.** Legacy and EIP-2930 types are rejected outright.
|
|
||||||
- **No opaque-calldata (unknown contract) grant type.** The architecture describes a category for unrecognised contracts, but no policy implements it yet. Any transaction that is not a plain ETH transfer or a known ERC-20 transfer is unconditionally rejected.
|
|
||||||
- **Token registry is static.** Tokens are recognised only if they appear in the hard-coded `arbiter_tokens_registry` crate. There is no mechanism to register additional contracts at runtime.
|
|
||||||
- **Nonce management is not implemented.** The architecture lists nonce deduplication as a core responsibility, but no nonce tracking or enforcement exists yet.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Memory Protection
|
## Memory Protection
|
||||||
|
|||||||
190
LICENSE
@@ -1,190 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
Copyright 2026 MarketTakers
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
13
README.md
@@ -1,13 +0,0 @@
|
|||||||
# Arbiter
|
|
||||||
> Policy-first multi-client wallet daemon, allowing permissioned transactions across blockchains
|
|
||||||
|
|
||||||
## Security warning
|
|
||||||
Arbiter can't meaningfully protect against host compromise. Potential attack flow:
|
|
||||||
- Attacker steals TLS keys from database
|
|
||||||
- Pretends to be server; just accepts user agent challenge solutions
|
|
||||||
- Pretend to be in sealed state and performing DH with client
|
|
||||||
- Steals user password and derives seal key
|
|
||||||
|
|
||||||
While this attack is highly targetive, it's still possible.
|
|
||||||
|
|
||||||
> This software is experimental. Do not use with funds you cannot afford to lose.
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
Extension Discovery Cache
|
|
||||||
=========================
|
|
||||||
|
|
||||||
This folder is used by `package:extension_discovery` to cache lists of
|
|
||||||
packages that contains extensions for other packages.
|
|
||||||
|
|
||||||
DO NOT USE THIS FOLDER
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
* Do not read (or rely) the contents of this folder.
|
|
||||||
* Do write to this folder.
|
|
||||||
|
|
||||||
If you're interested in the lists of extensions stored in this folder use the
|
|
||||||
API offered by package `extension_discovery` to get this information.
|
|
||||||
|
|
||||||
If this package doesn't work for your use-case, then don't try to read the
|
|
||||||
contents of this folder. It may change, and will not remain stable.
|
|
||||||
|
|
||||||
Use package `extension_discovery`
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
If you want to access information from this folder.
|
|
||||||
|
|
||||||
Feel free to delete this folder
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
Files in this folder act as a cache, and the cache is discarded if the files
|
|
||||||
are older than the modification time of `.dart_tool/package_config.json`.
|
|
||||||
|
|
||||||
Hence, it should never be necessary to clear this cache manually, if you find a
|
|
||||||
need to do please file a bug.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":2,"entries":[{"package":"app","rootUri":"../","packageUri":"lib/"}]}
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
{
|
|
||||||
"configVersion": 2,
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "async",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/async-2.13.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "boolean_selector",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "characters",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/characters-1.4.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clock",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/clock-1.1.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cupertino_icons",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fake_async",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter",
|
|
||||||
"rootUri": "file:///Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable/packages/flutter",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_lints",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/flutter_lints-6.0.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_test",
|
|
||||||
"rootUri": "file:///Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable/packages/flutter_test",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_flutter_testing",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_testing",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "lints",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/lints-6.1.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "matcher",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/matcher-0.12.17",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "material_color_utilities",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "2.17"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "meta",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/meta-1.17.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/path-1.9.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sky_engine",
|
|
||||||
"rootUri": "file:///Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable/bin/cache/pkg/sky_engine",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "source_span",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/source_span-1.10.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stack_trace",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream_channel",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "string_scanner",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "term_glyph",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test_api",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/test_api-0.7.7",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vector_math",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/vector_math-2.2.0",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vm_service",
|
|
||||||
"rootUri": "file:///Users/kaska/.pub-cache/hosted/pub.dev/vm_service-15.0.2",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "app",
|
|
||||||
"rootUri": "../",
|
|
||||||
"packageUri": "lib/",
|
|
||||||
"languageVersion": "3.10"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"generator": "pub",
|
|
||||||
"generatorVersion": "3.10.8",
|
|
||||||
"flutterRoot": "file:///Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable",
|
|
||||||
"flutterVersion": "3.38.9",
|
|
||||||
"pubCache": "file:///Users/kaska/.pub-cache"
|
|
||||||
}
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
{
|
|
||||||
"roots": [
|
|
||||||
"app"
|
|
||||||
],
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "app",
|
|
||||||
"version": "1.0.0+1",
|
|
||||||
"dependencies": [
|
|
||||||
"cupertino_icons",
|
|
||||||
"flutter"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"flutter_lints",
|
|
||||||
"flutter_test"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_lints",
|
|
||||||
"version": "6.0.0",
|
|
||||||
"dependencies": [
|
|
||||||
"lints"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter_test",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"dependencies": [
|
|
||||||
"clock",
|
|
||||||
"collection",
|
|
||||||
"fake_async",
|
|
||||||
"flutter",
|
|
||||||
"leak_tracker_flutter_testing",
|
|
||||||
"matcher",
|
|
||||||
"meta",
|
|
||||||
"path",
|
|
||||||
"stack_trace",
|
|
||||||
"stream_channel",
|
|
||||||
"test_api",
|
|
||||||
"vector_math"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cupertino_icons",
|
|
||||||
"version": "1.0.8",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flutter",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"dependencies": [
|
|
||||||
"characters",
|
|
||||||
"collection",
|
|
||||||
"material_color_utilities",
|
|
||||||
"meta",
|
|
||||||
"sky_engine",
|
|
||||||
"vector_math"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "lints",
|
|
||||||
"version": "6.1.0",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream_channel",
|
|
||||||
"version": "2.1.4",
|
|
||||||
"dependencies": [
|
|
||||||
"async"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "meta",
|
|
||||||
"version": "1.17.0",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "collection",
|
|
||||||
"version": "1.19.1",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_flutter_testing",
|
|
||||||
"version": "3.0.10",
|
|
||||||
"dependencies": [
|
|
||||||
"flutter",
|
|
||||||
"leak_tracker",
|
|
||||||
"leak_tracker_testing",
|
|
||||||
"matcher",
|
|
||||||
"meta"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vector_math",
|
|
||||||
"version": "2.2.0",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stack_trace",
|
|
||||||
"version": "1.12.1",
|
|
||||||
"dependencies": [
|
|
||||||
"path"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clock",
|
|
||||||
"version": "1.1.2",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fake_async",
|
|
||||||
"version": "1.3.3",
|
|
||||||
"dependencies": [
|
|
||||||
"clock",
|
|
||||||
"collection"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"version": "1.9.1",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "matcher",
|
|
||||||
"version": "0.12.17",
|
|
||||||
"dependencies": [
|
|
||||||
"async",
|
|
||||||
"meta",
|
|
||||||
"stack_trace",
|
|
||||||
"term_glyph",
|
|
||||||
"test_api"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test_api",
|
|
||||||
"version": "0.7.7",
|
|
||||||
"dependencies": [
|
|
||||||
"async",
|
|
||||||
"boolean_selector",
|
|
||||||
"collection",
|
|
||||||
"meta",
|
|
||||||
"source_span",
|
|
||||||
"stack_trace",
|
|
||||||
"stream_channel",
|
|
||||||
"string_scanner",
|
|
||||||
"term_glyph"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sky_engine",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "material_color_utilities",
|
|
||||||
"version": "0.11.1",
|
|
||||||
"dependencies": [
|
|
||||||
"collection"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "characters",
|
|
||||||
"version": "1.4.0",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "async",
|
|
||||||
"version": "2.13.0",
|
|
||||||
"dependencies": [
|
|
||||||
"collection",
|
|
||||||
"meta"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker_testing",
|
|
||||||
"version": "3.0.2",
|
|
||||||
"dependencies": [
|
|
||||||
"leak_tracker",
|
|
||||||
"matcher",
|
|
||||||
"meta"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leak_tracker",
|
|
||||||
"version": "11.0.2",
|
|
||||||
"dependencies": [
|
|
||||||
"clock",
|
|
||||||
"collection",
|
|
||||||
"meta",
|
|
||||||
"path",
|
|
||||||
"vm_service"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "term_glyph",
|
|
||||||
"version": "1.2.2",
|
|
||||||
"dependencies": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "string_scanner",
|
|
||||||
"version": "1.4.1",
|
|
||||||
"dependencies": [
|
|
||||||
"source_span"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "source_span",
|
|
||||||
"version": "1.10.2",
|
|
||||||
"dependencies": [
|
|
||||||
"collection",
|
|
||||||
"path",
|
|
||||||
"term_glyph"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "boolean_selector",
|
|
||||||
"version": "2.1.2",
|
|
||||||
"dependencies": [
|
|
||||||
"source_span",
|
|
||||||
"string_scanner"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vm_service",
|
|
||||||
"version": "15.0.2",
|
|
||||||
"dependencies": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configVersion": 1
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.38.9
|
|
||||||
0
useragent/.gitignore → app/.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
# useragent
|
# app
|
||||||
|
|
||||||
A new Flutter project.
|
A new Flutter project.
|
||||||
|
|
||||||
122
app/lib/main.dart
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
runApp(const MyApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatelessWidget {
|
||||||
|
const MyApp({super.key});
|
||||||
|
|
||||||
|
// This widget is the root of your application.
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
title: 'Flutter Demo',
|
||||||
|
theme: ThemeData(
|
||||||
|
// This is the theme of your application.
|
||||||
|
//
|
||||||
|
// TRY THIS: Try running your application with "flutter run". You'll see
|
||||||
|
// the application has a purple toolbar. Then, without quitting the app,
|
||||||
|
// try changing the seedColor in the colorScheme below to Colors.green
|
||||||
|
// and then invoke "hot reload" (save your changes or press the "hot
|
||||||
|
// reload" button in a Flutter-supported IDE, or press "r" if you used
|
||||||
|
// the command line to start the app).
|
||||||
|
//
|
||||||
|
// Notice that the counter didn't reset back to zero; the application
|
||||||
|
// state is not lost during the reload. To reset the state, use hot
|
||||||
|
// restart instead.
|
||||||
|
//
|
||||||
|
// This works for code too, not just values: Most code changes can be
|
||||||
|
// tested with just a hot reload.
|
||||||
|
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
|
||||||
|
),
|
||||||
|
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyHomePage extends StatefulWidget {
|
||||||
|
const MyHomePage({super.key, required this.title});
|
||||||
|
|
||||||
|
// This widget is the home page of your application. It is stateful, meaning
|
||||||
|
// that it has a State object (defined below) that contains fields that affect
|
||||||
|
// how it looks.
|
||||||
|
|
||||||
|
// This class is the configuration for the state. It holds the values (in this
|
||||||
|
// case the title) provided by the parent (in this case the App widget) and
|
||||||
|
// used by the build method of the State. Fields in a Widget subclass are
|
||||||
|
// always marked "final".
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MyHomePage> createState() => _MyHomePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyHomePageState extends State<MyHomePage> {
|
||||||
|
int _counter = 0;
|
||||||
|
|
||||||
|
void _incrementCounter() {
|
||||||
|
setState(() {
|
||||||
|
// This call to setState tells the Flutter framework that something has
|
||||||
|
// changed in this State, which causes it to rerun the build method below
|
||||||
|
// so that the display can reflect the updated values. If we changed
|
||||||
|
// _counter without calling setState(), then the build method would not be
|
||||||
|
// called again, and so nothing would appear to happen.
|
||||||
|
_counter++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// This method is rerun every time setState is called, for instance as done
|
||||||
|
// by the _incrementCounter method above.
|
||||||
|
//
|
||||||
|
// The Flutter framework has been optimized to make rerunning build methods
|
||||||
|
// fast, so that you can just rebuild anything that needs updating rather
|
||||||
|
// than having to individually change instances of widgets.
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
// TRY THIS: Try changing the color here to a specific color (to
|
||||||
|
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
|
||||||
|
// change color while the other colors stay the same.
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||||
|
// Here we take the value from the MyHomePage object that was created by
|
||||||
|
// the App.build method, and use it to set our appbar title.
|
||||||
|
title: Text(widget.title),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
// Center is a layout widget. It takes a single child and positions it
|
||||||
|
// in the middle of the parent.
|
||||||
|
child: Column(
|
||||||
|
// Column is also a layout widget. It takes a list of children and
|
||||||
|
// arranges them vertically. By default, it sizes itself to fit its
|
||||||
|
// children horizontally, and tries to be as tall as its parent.
|
||||||
|
//
|
||||||
|
// Column has various properties to control how it sizes itself and
|
||||||
|
// how it positions its children. Here we use mainAxisAlignment to
|
||||||
|
// center the children vertically; the main axis here is the vertical
|
||||||
|
// axis because Columns are vertical (the cross axis would be
|
||||||
|
// horizontal).
|
||||||
|
//
|
||||||
|
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
|
||||||
|
// action in the IDE, or press "p" in the console), to see the
|
||||||
|
// wireframe for each widget.
|
||||||
|
mainAxisAlignment: .center,
|
||||||
|
children: [
|
||||||
|
const Text('You have pushed the button this many times:'),
|
||||||
|
Text(
|
||||||
|
'$_counter',
|
||||||
|
style: Theme.of(context).textTheme.headlineMedium,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: _incrementCounter,
|
||||||
|
tooltip: 'Increment',
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
app/macos/Flutter/Flutter-Debug.xcconfig
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
1
app/macos/Flutter/Flutter-Release.xcconfig
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
10
app/macos/Flutter/GeneratedPluginRegistrant.swift
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
import FlutterMacOS
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/kaska/Documents/Projects/Major/arbiter/app
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=1.0.0
|
|
||||||
FLUTTER_BUILD_NUMBER=1
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This is a generated file; do not edit or check into version control.
|
|
||||||
export "FLUTTER_ROOT=/Users/kaska/.local/share/mise/installs/flutter/3.38.9-stable"
|
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/kaska/Documents/Projects/Major/arbiter/app"
|
|
||||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
|
||||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
|
||||||
export "FLUTTER_BUILD_NUMBER=1"
|
|
||||||
export "DART_OBFUSCATION=false"
|
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
|
||||||
export "TREE_SHAKE_ICONS=false"
|
|
||||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
|
||||||
@@ -27,8 +27,6 @@
|
|||||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||||
89374438F7FC24C1E409AC55 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84BA779FA182F4B90ADDD656 /* Pods_RunnerTests.framework */; };
|
|
||||||
9812E904D4443BD8157BA2CD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFE2551831D6F491FC95F4C0 /* Pods_Runner.framework */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -66,7 +64,7 @@
|
|||||||
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||||
33CC10ED2044A3C60003C045 /* useragent.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = useragent.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
33CC10ED2044A3C60003C045 /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "app.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||||
@@ -78,16 +76,8 @@
|
|||||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||||
5385F9987FF8E7FD3BA4E87E /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||||
84BA779FA182F4B90ADDD656 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
989E0AE288EA0AECFF244CAB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
ADF8B0EB51CA38AE67931C44 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
DC537F8D4AE9B12FB802E110 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
F06E58390BD453D6E42AD67C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
F9C83BBEBB84A7F9ACC93B93 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
FFE2551831D6F491FC95F4C0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -95,7 +85,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
89374438F7FC24C1E409AC55 /* Pods_RunnerTests.framework in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -103,7 +92,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
9812E904D4443BD8157BA2CD /* Pods_Runner.framework in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -137,14 +125,13 @@
|
|||||||
331C80D6294CF71000263BE5 /* RunnerTests */,
|
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||||
33CC10EE2044A3C60003C045 /* Products */,
|
33CC10EE2044A3C60003C045 /* Products */,
|
||||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||||
C5764DB16A5CAE65539863D1 /* Pods */,
|
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
33CC10EE2044A3C60003C045 /* Products */ = {
|
33CC10EE2044A3C60003C045 /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
33CC10ED2044A3C60003C045 /* useragent.app */,
|
33CC10ED2044A3C60003C045 /* app.app */,
|
||||||
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
|
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
@@ -185,24 +172,9 @@
|
|||||||
path = Runner;
|
path = Runner;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
C5764DB16A5CAE65539863D1 /* Pods */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
989E0AE288EA0AECFF244CAB /* Pods-Runner.debug.xcconfig */,
|
|
||||||
F06E58390BD453D6E42AD67C /* Pods-Runner.release.xcconfig */,
|
|
||||||
F9C83BBEBB84A7F9ACC93B93 /* Pods-Runner.profile.xcconfig */,
|
|
||||||
DC537F8D4AE9B12FB802E110 /* Pods-RunnerTests.debug.xcconfig */,
|
|
||||||
5385F9987FF8E7FD3BA4E87E /* Pods-RunnerTests.release.xcconfig */,
|
|
||||||
ADF8B0EB51CA38AE67931C44 /* Pods-RunnerTests.profile.xcconfig */,
|
|
||||||
);
|
|
||||||
path = Pods;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
FFE2551831D6F491FC95F4C0 /* Pods_Runner.framework */,
|
|
||||||
84BA779FA182F4B90ADDD656 /* Pods_RunnerTests.framework */,
|
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -214,7 +186,6 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
72217D999FDDB4A0040A839E /* [CP] Check Pods Manifest.lock */,
|
|
||||||
331C80D1294CF70F00263BE5 /* Sources */,
|
331C80D1294CF70F00263BE5 /* Sources */,
|
||||||
331C80D2294CF70F00263BE5 /* Frameworks */,
|
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||||
331C80D3294CF70F00263BE5 /* Resources */,
|
331C80D3294CF70F00263BE5 /* Resources */,
|
||||||
@@ -233,13 +204,11 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
4909404BD2C11CE7688B3B73 /* [CP] Check Pods Manifest.lock */,
|
|
||||||
33CC10E92044A3C60003C045 /* Sources */,
|
33CC10E92044A3C60003C045 /* Sources */,
|
||||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||||
33CC10EB2044A3C60003C045 /* Resources */,
|
33CC10EB2044A3C60003C045 /* Resources */,
|
||||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||||
2AF2BC4AB258588AFC797EA4 /* [CP] Embed Pods Frameworks */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -248,7 +217,7 @@
|
|||||||
);
|
);
|
||||||
name = Runner;
|
name = Runner;
|
||||||
productName = Runner;
|
productName = Runner;
|
||||||
productReference = 33CC10ED2044A3C60003C045 /* useragent.app */;
|
productReference = 33CC10ED2044A3C60003C045 /* app.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
@@ -322,23 +291,6 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
2AF2BC4AB258588AFC797EA4 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
@@ -377,50 +329,6 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||||
};
|
};
|
||||||
4909404BD2C11CE7688B3B73 /* [CP] Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
||||||
"${PODS_ROOT}/Manifest.lock",
|
|
||||||
);
|
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
72217D999FDDB4A0040A839E /* [CP] Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
||||||
"${PODS_ROOT}/Manifest.lock",
|
|
||||||
);
|
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -472,49 +380,43 @@
|
|||||||
/* Begin XCBuildConfiguration section */
|
/* Begin XCBuildConfiguration section */
|
||||||
331C80DB294CF71000263BE5 /* Debug */ = {
|
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = DC537F8D4AE9B12FB802E110 /* Pods-RunnerTests.debug.xcconfig */;
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.useragent.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.app.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/useragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/useragent";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/app";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
331C80DC294CF71000263BE5 /* Release */ = {
|
331C80DC294CF71000263BE5 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 5385F9987FF8E7FD3BA4E87E /* Pods-RunnerTests.release.xcconfig */;
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.useragent.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.app.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/useragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/useragent";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/app";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
331C80DD294CF71000263BE5 /* Profile */ = {
|
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = ADF8B0EB51CA38AE67931C44 /* Pods-RunnerTests.profile.xcconfig */;
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.useragent.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.app.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/useragent.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/useragent";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/app";
|
||||||
};
|
};
|
||||||
name = Profile;
|
name = Profile;
|
||||||
};
|
};
|
||||||
@@ -562,7 +464,6 @@
|
|||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
|
||||||
SWIFT_COMPILATION_MODE = wholemodule;
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
};
|
};
|
||||||
@@ -575,22 +476,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEVELOPMENT_TEAM = 8L884L537J;
|
|
||||||
ENABLE_APP_SANDBOX = YES;
|
|
||||||
ENABLE_INCOMING_NETWORK_CONNECTIONS = YES;
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 26.0;
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.markettakers.arbiter;
|
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
RUNTIME_EXCEPTION_ALLOW_JIT = YES;
|
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Profile;
|
name = Profile;
|
||||||
@@ -599,7 +492,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Profile;
|
name = Profile;
|
||||||
@@ -655,7 +547,6 @@
|
|||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
};
|
};
|
||||||
@@ -705,7 +596,6 @@
|
|||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
|
||||||
SWIFT_COMPILATION_MODE = wholemodule;
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
};
|
};
|
||||||
@@ -718,22 +608,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEVELOPMENT_TEAM = 8L884L537J;
|
|
||||||
ENABLE_APP_SANDBOX = YES;
|
|
||||||
ENABLE_INCOMING_NETWORK_CONNECTIONS = YES;
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 26.0;
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.markettakers.arbiter;
|
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
RUNTIME_EXCEPTION_ALLOW_JIT = YES;
|
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
@@ -746,22 +628,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEVELOPMENT_TEAM = 8L884L537J;
|
|
||||||
ENABLE_APP_SANDBOX = YES;
|
|
||||||
ENABLE_INCOMING_NETWORK_CONNECTIONS = YES;
|
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 26.0;
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.markettakers.arbiter;
|
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
RUNTIME_EXCEPTION_ALLOW_JIT = YES;
|
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -770,7 +644,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -779,7 +652,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
BuildableName = "useragent.app"
|
BuildableName = "app.app"
|
||||||
BlueprintName = "Runner"
|
BlueprintName = "Runner"
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
BuildableName = "useragent.app"
|
BuildableName = "app.app"
|
||||||
BlueprintName = "Runner"
|
BlueprintName = "Runner"
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
BuildableName = "useragent.app"
|
BuildableName = "app.app"
|
||||||
BlueprintName = "Runner"
|
BlueprintName = "Runner"
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
|
||||||
BuildableName = "useragent.app"
|
BuildableName = "app.app"
|
||||||
BlueprintName = "Runner"
|
BlueprintName = "Runner"
|
||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
@@ -4,7 +4,4 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
<FileRef
|
|
||||||
location = "group:Pods/Pods.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 520 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -5,10 +5,10 @@
|
|||||||
// 'flutter create' template.
|
// 'flutter create' template.
|
||||||
|
|
||||||
// The application's name. By default this is also the title of the Flutter window.
|
// The application's name. By default this is also the title of the Flutter window.
|
||||||
PRODUCT_NAME = useragent
|
PRODUCT_NAME = app
|
||||||
|
|
||||||
// The application's bundle identifier
|
// The application's bundle identifier
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.useragent
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.app
|
||||||
|
|
||||||
// The copyright displayed in application information
|
// The copyright displayed in application information
|
||||||
PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved.
|
PRODUCT_COPYRIGHT = Copyright © 2026 com.example. All rights reserved.
|
||||||
@@ -2,9 +2,11 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>keychain-access-groups</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<array/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -4,9 +4,5 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>keychain-access-groups</key>
|
|
||||||
<array/>
|
|
||||||
<key>com.apple.security.network.client</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
213
app/pubspec.lock
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
# Generated by pub
|
||||||
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
|
packages:
|
||||||
|
async:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: async
|
||||||
|
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.13.0"
|
||||||
|
boolean_selector:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: boolean_selector
|
||||||
|
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
characters:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: characters
|
||||||
|
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
|
clock:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: clock
|
||||||
|
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.2"
|
||||||
|
collection:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: collection
|
||||||
|
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.19.1"
|
||||||
|
cupertino_icons:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: cupertino_icons
|
||||||
|
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.8"
|
||||||
|
fake_async:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fake_async
|
||||||
|
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.3"
|
||||||
|
flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
flutter_lints:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_lints
|
||||||
|
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.0"
|
||||||
|
flutter_test:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
leak_tracker:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker
|
||||||
|
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "11.0.2"
|
||||||
|
leak_tracker_flutter_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_flutter_testing
|
||||||
|
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.10"
|
||||||
|
leak_tracker_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_testing
|
||||||
|
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
|
lints:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lints
|
||||||
|
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
|
matcher:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: matcher
|
||||||
|
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.12.17"
|
||||||
|
material_color_utilities:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: material_color_utilities
|
||||||
|
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.11.1"
|
||||||
|
meta:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: meta
|
||||||
|
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.17.0"
|
||||||
|
path:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path
|
||||||
|
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.9.1"
|
||||||
|
sky_engine:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
source_span:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: source_span
|
||||||
|
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.10.2"
|
||||||
|
stack_trace:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stack_trace
|
||||||
|
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.12.1"
|
||||||
|
stream_channel:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stream_channel
|
||||||
|
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.4"
|
||||||
|
string_scanner:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: string_scanner
|
||||||
|
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.1"
|
||||||
|
term_glyph:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: term_glyph
|
||||||
|
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
|
test_api:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: test_api
|
||||||
|
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.7.7"
|
||||||
|
vector_math:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_math
|
||||||
|
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0"
|
||||||
|
vm_service:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vm_service
|
||||||
|
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "15.0.2"
|
||||||
|
sdks:
|
||||||
|
dart: ">=3.10.8 <4.0.0"
|
||||||
|
flutter: ">=3.18.0-18.0.pre.54"
|
||||||
89
app/pubspec.yaml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
name: app
|
||||||
|
description: "A new Flutter project."
|
||||||
|
# The following line prevents the package from being accidentally published to
|
||||||
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
|
# The following defines the version and build number for your application.
|
||||||
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
|
# followed by an optional build number separated by a +.
|
||||||
|
# Both the version and the builder number may be overridden in flutter
|
||||||
|
# build by specifying --build-name and --build-number, respectively.
|
||||||
|
# In Android, build-name is used as versionName while build-number used as versionCode.
|
||||||
|
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
|
||||||
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
||||||
|
# Read more about iOS versioning at
|
||||||
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
|
version: 1.0.0+1
|
||||||
|
|
||||||
|
environment:
|
||||||
|
sdk: ^3.10.8
|
||||||
|
|
||||||
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
|
# consider running `flutter pub upgrade --major-versions`. Alternatively,
|
||||||
|
# dependencies can be manually updated by changing the version numbers below to
|
||||||
|
# the latest version available on pub.dev. To see which dependencies have newer
|
||||||
|
# versions available, run `flutter pub outdated`.
|
||||||
|
dependencies:
|
||||||
|
flutter:
|
||||||
|
sdk: flutter
|
||||||
|
|
||||||
|
# The following adds the Cupertino Icons font to your application.
|
||||||
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
|
cupertino_icons: ^1.0.8
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
flutter_test:
|
||||||
|
sdk: flutter
|
||||||
|
|
||||||
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
|
# package. See that file for information about deactivating specific lint
|
||||||
|
# rules and activating additional ones.
|
||||||
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
|
# For information on the generic Dart part of this file, see the
|
||||||
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
# The following section is specific to Flutter packages.
|
||||||
|
flutter:
|
||||||
|
|
||||||
|
# The following line ensures that the Material Icons font is
|
||||||
|
# included with your application, so that you can use the icons in
|
||||||
|
# the material Icons class.
|
||||||
|
uses-material-design: true
|
||||||
|
|
||||||
|
# To add assets to your application, add an assets section, like this:
|
||||||
|
# assets:
|
||||||
|
# - images/a_dot_burr.jpeg
|
||||||
|
# - images/a_dot_ham.jpeg
|
||||||
|
|
||||||
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
# https://flutter.dev/to/resolution-aware-images
|
||||||
|
|
||||||
|
# For details regarding adding assets from package dependencies, see
|
||||||
|
# https://flutter.dev/to/asset-from-package
|
||||||
|
|
||||||
|
# To add custom fonts to your application, add a fonts section here,
|
||||||
|
# in this "flutter" section. Each entry in this list should have a
|
||||||
|
# "family" key with the font family name, and a "fonts" key with a
|
||||||
|
# list giving the asset and other descriptors for the font. For
|
||||||
|
# example:
|
||||||
|
# fonts:
|
||||||
|
# - family: Schyler
|
||||||
|
# fonts:
|
||||||
|
# - asset: fonts/Schyler-Regular.ttf
|
||||||
|
# - asset: fonts/Schyler-Italic.ttf
|
||||||
|
# style: italic
|
||||||
|
# - family: Trajan Pro
|
||||||
|
# fonts:
|
||||||
|
# - asset: fonts/TrajanPro.ttf
|
||||||
|
# - asset: fonts/TrajanPro_Bold.ttf
|
||||||
|
# weight: 700
|
||||||
|
#
|
||||||
|
# For details regarding fonts from package dependencies,
|
||||||
|
# see https://flutter.dev/to/font-from-package
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
# Project-level configuration.
|
# Project-level configuration.
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(useragent LANGUAGES CXX)
|
project(app LANGUAGES CXX)
|
||||||
|
|
||||||
# The name of the executable created for the application. Change this to change
|
# The name of the executable created for the application. Change this to change
|
||||||
# the on-disk name of your application.
|
# the on-disk name of your application.
|
||||||
set(BINARY_NAME "useragent")
|
set(BINARY_NAME "app")
|
||||||
|
|
||||||
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||||
# versions of CMake.
|
# versions of CMake.
|
||||||
11
app/windows/flutter/generated_plugin_registrant.cc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
|
||||||
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
}
|
||||||
@@ -3,11 +3,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
biometric_signature
|
|
||||||
flutter_secure_storage_windows
|
|
||||||
rive_native
|
|
||||||
share_plus
|
|
||||||
url_launcher_windows
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
@@ -90,12 +90,12 @@ BEGIN
|
|||||||
BLOCK "040904e4"
|
BLOCK "040904e4"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "com.example" "\0"
|
VALUE "CompanyName", "com.example" "\0"
|
||||||
VALUE "FileDescription", "useragent" "\0"
|
VALUE "FileDescription", "app" "\0"
|
||||||
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
||||||
VALUE "InternalName", "useragent" "\0"
|
VALUE "InternalName", "app" "\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0"
|
VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0"
|
||||||
VALUE "OriginalFilename", "useragent.exe" "\0"
|
VALUE "OriginalFilename", "app.exe" "\0"
|
||||||
VALUE "ProductName", "useragent" "\0"
|
VALUE "ProductName", "app" "\0"
|
||||||
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
|||||||
FlutterWindow window(project);
|
FlutterWindow window(project);
|
||||||
Win32Window::Point origin(10, 10);
|
Win32Window::Point origin(10, 10);
|
||||||
Win32Window::Size size(1280, 720);
|
Win32Window::Size size(1280, 720);
|
||||||
if (!window.Create(L"useragent", origin, size)) {
|
if (!window.Create(L"app", origin, size)) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
window.SetQuitOnClose(true);
|
window.SetQuitOnClose(true);
|
||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
87
mise.lock
@@ -1,37 +1,7 @@
|
|||||||
# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html
|
|
||||||
|
|
||||||
[[tools.ast-grep]]
|
|
||||||
version = "0.42.0"
|
|
||||||
backend = "aqua:ast-grep/ast-grep"
|
|
||||||
|
|
||||||
[tools.ast-grep."platforms.linux-arm64"]
|
|
||||||
checksum = "sha256:5c830eae8456569e2f7212434ed9c238f58dca412d76045418ed6d394a755836"
|
|
||||||
url = "https://github.com/ast-grep/ast-grep/releases/download/0.42.0/app-aarch64-unknown-linux-gnu.zip"
|
|
||||||
|
|
||||||
[tools.ast-grep."platforms.linux-x64"]
|
|
||||||
checksum = "sha256:e825a05603f0bcc4cd9076c4cc8c9abd6d008b7cd07d9aa3cc323ba4b8606651"
|
|
||||||
url = "https://github.com/ast-grep/ast-grep/releases/download/0.42.0/app-x86_64-unknown-linux-gnu.zip"
|
|
||||||
|
|
||||||
[tools.ast-grep."platforms.macos-arm64"]
|
|
||||||
checksum = "sha256:fc300d5293b1c770a5aece03a8a193b92e71e87cec726c28096990691a582620"
|
|
||||||
url = "https://github.com/ast-grep/ast-grep/releases/download/0.42.0/app-aarch64-apple-darwin.zip"
|
|
||||||
|
|
||||||
[tools.ast-grep."platforms.macos-x64"]
|
|
||||||
checksum = "sha256:979ffe611327056f4730a1ae71b0209b3b830f58b22c6ed194cda34f55400db2"
|
|
||||||
url = "https://github.com/ast-grep/ast-grep/releases/download/0.42.0/app-x86_64-apple-darwin.zip"
|
|
||||||
|
|
||||||
[tools.ast-grep."platforms.windows-x64"]
|
|
||||||
checksum = "sha256:55836fa1b2c65dc7d61615a4d9368622a0d2371a76d28b9a165e5a3ab6ae32a4"
|
|
||||||
url = "https://github.com/ast-grep/ast-grep/releases/download/0.42.0/app-x86_64-pc-windows-msvc.zip"
|
|
||||||
|
|
||||||
[[tools."cargo:cargo-audit"]]
|
[[tools."cargo:cargo-audit"]]
|
||||||
version = "0.22.1"
|
version = "0.22.1"
|
||||||
backend = "cargo:cargo-audit"
|
backend = "cargo:cargo-audit"
|
||||||
|
|
||||||
[[tools."cargo:cargo-edit"]]
|
|
||||||
version = "0.13.9"
|
|
||||||
backend = "cargo:cargo-edit"
|
|
||||||
|
|
||||||
[[tools."cargo:cargo-features"]]
|
[[tools."cargo:cargo-features"]]
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
backend = "cargo:cargo-features"
|
backend = "cargo:cargo-features"
|
||||||
@@ -40,10 +10,6 @@ backend = "cargo:cargo-features"
|
|||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
backend = "cargo:cargo-features-manager"
|
backend = "cargo:cargo-features-manager"
|
||||||
|
|
||||||
[[tools."cargo:cargo-insta"]]
|
|
||||||
version = "1.46.3"
|
|
||||||
backend = "cargo:cargo-insta"
|
|
||||||
|
|
||||||
[[tools."cargo:cargo-nextest"]]
|
[[tools."cargo:cargo-nextest"]]
|
||||||
version = "0.9.126"
|
version = "0.9.126"
|
||||||
backend = "cargo:cargo-nextest"
|
backend = "cargo:cargo-nextest"
|
||||||
@@ -72,10 +38,6 @@ backend = "cargo:diesel_cli"
|
|||||||
default-features = "false"
|
default-features = "false"
|
||||||
features = "sqlite,sqlite-bundled"
|
features = "sqlite,sqlite-bundled"
|
||||||
|
|
||||||
[[tools."cargo:rinf_cli"]]
|
|
||||||
version = "8.9.1"
|
|
||||||
backend = "cargo:rinf_cli"
|
|
||||||
|
|
||||||
[[tools.flutter]]
|
[[tools.flutter]]
|
||||||
version = "3.38.9-stable"
|
version = "3.38.9-stable"
|
||||||
backend = "asdf:flutter"
|
backend = "asdf:flutter"
|
||||||
@@ -83,50 +45,11 @@ backend = "asdf:flutter"
|
|||||||
[[tools.protoc]]
|
[[tools.protoc]]
|
||||||
version = "29.6"
|
version = "29.6"
|
||||||
backend = "aqua:protocolbuffers/protobuf/protoc"
|
backend = "aqua:protocolbuffers/protobuf/protoc"
|
||||||
|
"platforms.linux-arm64" = { checksum = "sha256:2594ff4fcae8cb57310d394d0961b236190ad9c5efbfdf1f597ea471d424fe79", url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-linux-aarch_64.zip"}
|
||||||
[tools.protoc."platforms.linux-arm64"]
|
"platforms.linux-x64" = { checksum = "sha256:48785a926e73ffa3f68e2f22b14e7b849620c7a1d36809ac9249a5495e280323", url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-linux-x86_64.zip"}
|
||||||
checksum = "sha256:2594ff4fcae8cb57310d394d0961b236190ad9c5efbfdf1f597ea471d424fe79"
|
"platforms.macos-arm64" = { checksum = "sha256:b9576b5fa1a1ef3fe13a8c91d9d8204b46545759bea5ae155cd6ba2ea4cdaeed", url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-osx-aarch_64.zip"}
|
||||||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-linux-aarch_64.zip"
|
"platforms.macos-x64" = { checksum = "sha256:312f04713946921cc0187ef34df80241ddca1bab6f564c636885fd2cc90d3f88", url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-osx-x86_64.zip"}
|
||||||
|
"platforms.windows-x64" = { checksum = "sha256:1ebd7c87baffb9f1c47169b640872bf5fb1e4408079c691af527be9561d8f6f7", url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-win64.zip"}
|
||||||
[tools.protoc."platforms.linux-x64"]
|
|
||||||
checksum = "sha256:48785a926e73ffa3f68e2f22b14e7b849620c7a1d36809ac9249a5495e280323"
|
|
||||||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-linux-x86_64.zip"
|
|
||||||
|
|
||||||
[tools.protoc."platforms.macos-arm64"]
|
|
||||||
checksum = "sha256:b9576b5fa1a1ef3fe13a8c91d9d8204b46545759bea5ae155cd6ba2ea4cdaeed"
|
|
||||||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-osx-aarch_64.zip"
|
|
||||||
|
|
||||||
[tools.protoc."platforms.macos-x64"]
|
|
||||||
checksum = "sha256:312f04713946921cc0187ef34df80241ddca1bab6f564c636885fd2cc90d3f88"
|
|
||||||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-osx-x86_64.zip"
|
|
||||||
|
|
||||||
[tools.protoc."platforms.windows-x64"]
|
|
||||||
checksum = "sha256:1ebd7c87baffb9f1c47169b640872bf5fb1e4408079c691af527be9561d8f6f7"
|
|
||||||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v29.6/protoc-29.6-win64.zip"
|
|
||||||
|
|
||||||
[[tools.python]]
|
|
||||||
version = "3.14.3"
|
|
||||||
backend = "core:python"
|
|
||||||
|
|
||||||
[tools.python."platforms.linux-arm64"]
|
|
||||||
checksum = "sha256:be0f4dc2932f762292b27d46ea7d3e8e66ddf3969a5eb0254a229015ed402625"
|
|
||||||
url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260303/cpython-3.14.3+20260303-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz"
|
|
||||||
|
|
||||||
[tools.python."platforms.linux-x64"]
|
|
||||||
checksum = "sha256:0a73413f89efd417871876c9accaab28a9d1e3cd6358fbfff171a38ec99302f0"
|
|
||||||
url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260303/cpython-3.14.3+20260303-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz"
|
|
||||||
|
|
||||||
[tools.python."platforms.macos-arm64"]
|
|
||||||
checksum = "sha256:4703cdf18b26798fde7b49b6b66149674c25f97127be6a10dbcf29309bdcdcdb"
|
|
||||||
url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260303/cpython-3.14.3+20260303-aarch64-apple-darwin-install_only_stripped.tar.gz"
|
|
||||||
|
|
||||||
[tools.python."platforms.macos-x64"]
|
|
||||||
checksum = "sha256:76f1cc26e3d262eae8ca546a93e8bded10cf0323613f7e246fea2e10a8115eb7"
|
|
||||||
url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260303/cpython-3.14.3+20260303-x86_64-apple-darwin-install_only_stripped.tar.gz"
|
|
||||||
|
|
||||||
[tools.python."platforms.windows-x64"]
|
|
||||||
checksum = "sha256:950c5f21a015c1bdd1337f233456df2470fab71e4d794407d27a84cb8b9909a0"
|
|
||||||
url = "https://github.com/astral-sh/python-build-standalone/releases/download/20260303/cpython-3.14.3+20260303-x86_64-pc-windows-msvc-install_only_stripped.tar.gz"
|
|
||||||
|
|
||||||
[[tools.rust]]
|
[[tools.rust]]
|
||||||
version = "1.93.0"
|
version = "1.93.0"
|
||||||
|
|||||||
15
mise.toml
@@ -2,21 +2,10 @@
|
|||||||
"cargo:diesel_cli" = { version = "2.3.6", features = "sqlite,sqlite-bundled", default-features = false }
|
"cargo:diesel_cli" = { version = "2.3.6", features = "sqlite,sqlite-bundled", default-features = false }
|
||||||
"cargo:cargo-audit" = "0.22.1"
|
"cargo:cargo-audit" = "0.22.1"
|
||||||
"cargo:cargo-vet" = "0.10.2"
|
"cargo:cargo-vet" = "0.10.2"
|
||||||
|
|
||||||
flutter = "3.38.9-stable"
|
flutter = "3.38.9-stable"
|
||||||
protoc = "29.6"
|
protoc = "29.6"
|
||||||
"rust" = {version = "1.93.0", components = "clippy"}
|
rust = "1.93.1"
|
||||||
"cargo:cargo-features-manager" = "0.11.1"
|
"cargo:cargo-features-manager" = "0.11.1"
|
||||||
"cargo:cargo-nextest" = "0.9.126"
|
"cargo:cargo-nextest" = "0.9.126"
|
||||||
"cargo:cargo-shear" = "latest"
|
"cargo:cargo-shear" = "latest"
|
||||||
"cargo:cargo-insta" = "1.46.3"
|
|
||||||
python = "3.14.3"
|
|
||||||
ast-grep = "0.42.0"
|
|
||||||
"cargo:cargo-edit" = "0.13.9"
|
|
||||||
|
|
||||||
[tasks.codegen]
|
|
||||||
sources = ['protobufs/*.proto']
|
|
||||||
outputs = ['useragent/lib/proto/*']
|
|
||||||
run = '''
|
|
||||||
dart pub global activate protoc_plugin && \
|
|
||||||
protoc --dart_out=grpc:useragent/lib/proto --proto_path=protobufs/ protobufs/*.proto
|
|
||||||
'''
|
|
||||||
|
|||||||
@@ -2,15 +2,67 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package arbiter;
|
package arbiter;
|
||||||
|
|
||||||
import "client.proto";
|
import "auth.proto";
|
||||||
import "user_agent.proto";
|
|
||||||
|
message ClientRequest {
|
||||||
|
oneof payload {
|
||||||
|
arbiter.auth.ClientMessage auth_message = 1;
|
||||||
|
CertRotationAck cert_rotation_ack = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message ClientResponse {
|
||||||
|
oneof payload {
|
||||||
|
arbiter.auth.ServerMessage auth_message = 1;
|
||||||
|
CertRotationNotification cert_rotation_notification = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message UserAgentRequest {
|
||||||
|
oneof payload {
|
||||||
|
arbiter.auth.ClientMessage auth_message = 1;
|
||||||
|
CertRotationAck cert_rotation_ack = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message UserAgentResponse {
|
||||||
|
oneof payload {
|
||||||
|
arbiter.auth.ServerMessage auth_message = 1;
|
||||||
|
CertRotationNotification cert_rotation_notification = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
message ServerInfo {
|
message ServerInfo {
|
||||||
string version = 1;
|
string version = 1;
|
||||||
bytes cert_public_key = 2;
|
bytes cert_public_key = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
service ArbiterService {
|
// TLS Certificate Rotation Protocol
|
||||||
rpc Client(stream arbiter.client.ClientRequest) returns (stream arbiter.client.ClientResponse);
|
message CertRotationNotification {
|
||||||
rpc UserAgent(stream arbiter.user_agent.UserAgentRequest) returns (stream arbiter.user_agent.UserAgentResponse);
|
// New public certificate (DER-encoded)
|
||||||
|
bytes new_cert = 1;
|
||||||
|
|
||||||
|
// Unix timestamp when rotation will be executed (if all ACKs received)
|
||||||
|
int64 rotation_scheduled_at = 2;
|
||||||
|
|
||||||
|
// Unix timestamp deadline for ACK (7 days from now)
|
||||||
|
int64 ack_deadline = 3;
|
||||||
|
|
||||||
|
// Rotation ID for tracking
|
||||||
|
int32 rotation_id = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CertRotationAck {
|
||||||
|
// Rotation ID (from CertRotationNotification)
|
||||||
|
int32 rotation_id = 1;
|
||||||
|
|
||||||
|
// Client public key for identification
|
||||||
|
bytes client_public_key = 2;
|
||||||
|
|
||||||
|
// Confirmation that client saved the new certificate
|
||||||
|
bool cert_saved = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
service ArbiterService {
|
||||||
|
rpc Client(stream ClientRequest) returns (stream ClientResponse);
|
||||||
|
rpc UserAgent(stream UserAgentRequest) returns (stream UserAgentResponse);
|
||||||
}
|
}
|
||||||
|
|||||||
35
protobufs/auth.proto
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package arbiter.auth;
|
||||||
|
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
|
message AuthChallengeRequest {
|
||||||
|
bytes pubkey = 1;
|
||||||
|
optional string bootstrap_token = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AuthChallenge {
|
||||||
|
bytes pubkey = 1;
|
||||||
|
int32 nonce = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AuthChallengeSolution {
|
||||||
|
bytes signature = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AuthOk {}
|
||||||
|
|
||||||
|
message ClientMessage {
|
||||||
|
oneof payload {
|
||||||
|
AuthChallengeRequest auth_challenge_request = 1;
|
||||||
|
AuthChallengeSolution auth_challenge_solution = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message ServerMessage {
|
||||||
|
oneof payload {
|
||||||
|
AuthChallenge auth_challenge = 1;
|
||||||
|
AuthOk auth_ok = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package arbiter.client;
|
|
||||||
|
|
||||||
import "evm.proto";
|
|
||||||
import "google/protobuf/empty.proto";
|
|
||||||
|
|
||||||
message AuthChallengeRequest {
|
|
||||||
bytes pubkey = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthChallenge {
|
|
||||||
bytes pubkey = 1;
|
|
||||||
int32 nonce = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthChallengeSolution {
|
|
||||||
bytes signature = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum AuthResult {
|
|
||||||
AUTH_RESULT_UNSPECIFIED = 0;
|
|
||||||
AUTH_RESULT_SUCCESS = 1;
|
|
||||||
AUTH_RESULT_INVALID_KEY = 2;
|
|
||||||
AUTH_RESULT_INVALID_SIGNATURE = 3;
|
|
||||||
AUTH_RESULT_APPROVAL_DENIED = 4;
|
|
||||||
AUTH_RESULT_NO_USER_AGENTS_ONLINE = 5;
|
|
||||||
AUTH_RESULT_INTERNAL = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum VaultState {
|
|
||||||
VAULT_STATE_UNSPECIFIED = 0;
|
|
||||||
VAULT_STATE_UNBOOTSTRAPPED = 1;
|
|
||||||
VAULT_STATE_SEALED = 2;
|
|
||||||
VAULT_STATE_UNSEALED = 3;
|
|
||||||
VAULT_STATE_ERROR = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ClientRequest {
|
|
||||||
int32 request_id = 4;
|
|
||||||
oneof payload {
|
|
||||||
AuthChallengeRequest auth_challenge_request = 1;
|
|
||||||
AuthChallengeSolution auth_challenge_solution = 2;
|
|
||||||
google.protobuf.Empty query_vault_state = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message ClientResponse {
|
|
||||||
optional int32 request_id = 7;
|
|
||||||
oneof payload {
|
|
||||||
AuthChallenge auth_challenge = 1;
|
|
||||||
AuthResult auth_result = 2;
|
|
||||||
arbiter.evm.EvmSignTransactionResponse evm_sign_transaction = 3;
|
|
||||||
arbiter.evm.EvmAnalyzeTransactionResponse evm_analyze_transaction = 4;
|
|
||||||
VaultState vault_state = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package arbiter.evm;
|
|
||||||
|
|
||||||
import "google/protobuf/empty.proto";
|
|
||||||
import "google/protobuf/timestamp.proto";
|
|
||||||
|
|
||||||
enum EvmError {
|
|
||||||
EVM_ERROR_UNSPECIFIED = 0;
|
|
||||||
EVM_ERROR_VAULT_SEALED = 1;
|
|
||||||
EVM_ERROR_INTERNAL = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message WalletEntry {
|
|
||||||
bytes address = 1; // 20-byte Ethereum address
|
|
||||||
}
|
|
||||||
|
|
||||||
message WalletList {
|
|
||||||
repeated WalletEntry wallets = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message WalletCreateResponse {
|
|
||||||
oneof result {
|
|
||||||
WalletEntry wallet = 1;
|
|
||||||
EvmError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message WalletListResponse {
|
|
||||||
oneof result {
|
|
||||||
WalletList wallets = 1;
|
|
||||||
EvmError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Grant types ---
|
|
||||||
|
|
||||||
message TransactionRateLimit {
|
|
||||||
uint32 count = 1;
|
|
||||||
int64 window_secs = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message VolumeRateLimit {
|
|
||||||
bytes max_volume = 1; // U256 as big-endian bytes
|
|
||||||
int64 window_secs = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SharedSettings {
|
|
||||||
int32 wallet_id = 1;
|
|
||||||
uint64 chain_id = 2;
|
|
||||||
optional google.protobuf.Timestamp valid_from = 3;
|
|
||||||
optional google.protobuf.Timestamp valid_until = 4;
|
|
||||||
optional bytes max_gas_fee_per_gas = 5; // U256 as big-endian bytes
|
|
||||||
optional bytes max_priority_fee_per_gas = 6; // U256 as big-endian bytes
|
|
||||||
optional TransactionRateLimit rate_limit = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EtherTransferSettings {
|
|
||||||
repeated bytes targets = 1; // list of 20-byte Ethereum addresses
|
|
||||||
VolumeRateLimit limit = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message TokenTransferSettings {
|
|
||||||
bytes token_contract = 1; // 20-byte Ethereum address
|
|
||||||
optional bytes target = 2; // 20-byte Ethereum address; absent means any recipient allowed
|
|
||||||
repeated VolumeRateLimit volume_limits = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SpecificGrant {
|
|
||||||
oneof grant {
|
|
||||||
EtherTransferSettings ether_transfer = 1;
|
|
||||||
TokenTransferSettings token_transfer = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message EtherTransferMeaning {
|
|
||||||
bytes to = 1; // 20-byte Ethereum address
|
|
||||||
bytes value = 2; // U256 as big-endian bytes
|
|
||||||
}
|
|
||||||
|
|
||||||
message TokenInfo {
|
|
||||||
string symbol = 1;
|
|
||||||
bytes address = 2; // 20-byte Ethereum address
|
|
||||||
uint64 chain_id = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mirror of token_transfers::Meaning
|
|
||||||
message TokenTransferMeaning {
|
|
||||||
TokenInfo token = 1;
|
|
||||||
bytes to = 2; // 20-byte Ethereum address
|
|
||||||
bytes value = 3; // U256 as big-endian bytes
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mirror of policies::SpecificMeaning
|
|
||||||
message SpecificMeaning {
|
|
||||||
oneof meaning {
|
|
||||||
EtherTransferMeaning ether_transfer = 1;
|
|
||||||
TokenTransferMeaning token_transfer = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Eval error types ---
|
|
||||||
message GasLimitExceededViolation {
|
|
||||||
optional bytes max_gas_fee_per_gas = 1; // U256 as big-endian bytes
|
|
||||||
optional bytes max_priority_fee_per_gas = 2; // U256 as big-endian bytes
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvalViolation {
|
|
||||||
oneof kind {
|
|
||||||
bytes invalid_target = 1; // 20-byte Ethereum address
|
|
||||||
GasLimitExceededViolation gas_limit_exceeded = 2;
|
|
||||||
google.protobuf.Empty rate_limit_exceeded = 3;
|
|
||||||
google.protobuf.Empty volumetric_limit_exceeded = 4;
|
|
||||||
google.protobuf.Empty invalid_time = 5;
|
|
||||||
google.protobuf.Empty invalid_transaction_type = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transaction was classified but no grant covers it
|
|
||||||
message NoMatchingGrantError {
|
|
||||||
SpecificMeaning meaning = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transaction was classified and a grant was found, but constraints were violated
|
|
||||||
message PolicyViolationsError {
|
|
||||||
SpecificMeaning meaning = 1;
|
|
||||||
repeated EvalViolation violations = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// top-level error returned when transaction evaluation fails
|
|
||||||
message TransactionEvalError {
|
|
||||||
oneof kind {
|
|
||||||
google.protobuf.Empty contract_creation_not_supported = 1;
|
|
||||||
google.protobuf.Empty unsupported_transaction_type = 2;
|
|
||||||
NoMatchingGrantError no_matching_grant = 3;
|
|
||||||
PolicyViolationsError policy_violations = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- UserAgent grant management ---
|
|
||||||
message EvmGrantCreateRequest {
|
|
||||||
int32 client_id = 1;
|
|
||||||
SharedSettings shared = 2;
|
|
||||||
SpecificGrant specific = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantCreateResponse {
|
|
||||||
oneof result {
|
|
||||||
int32 grant_id = 1;
|
|
||||||
EvmError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantDeleteRequest {
|
|
||||||
int32 grant_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantDeleteResponse {
|
|
||||||
oneof result {
|
|
||||||
google.protobuf.Empty ok = 1;
|
|
||||||
EvmError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Basic grant info returned in grant listings
|
|
||||||
message GrantEntry {
|
|
||||||
int32 id = 1;
|
|
||||||
int32 client_id = 2;
|
|
||||||
SharedSettings shared = 3;
|
|
||||||
SpecificGrant specific = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantListRequest {
|
|
||||||
optional int32 wallet_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantListResponse {
|
|
||||||
oneof result {
|
|
||||||
EvmGrantList grants = 1;
|
|
||||||
EvmError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmGrantList {
|
|
||||||
repeated GrantEntry grants = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Client transaction operations ---
|
|
||||||
|
|
||||||
message EvmSignTransactionRequest {
|
|
||||||
bytes wallet_address = 1; // 20-byte Ethereum address
|
|
||||||
bytes rlp_transaction = 2; // RLP-encoded EIP-1559 transaction (unsigned)
|
|
||||||
}
|
|
||||||
|
|
||||||
// oneof because signing and evaluation happen atomically — a signing failure
|
|
||||||
// is always either an eval error or an internal error, never a partial success
|
|
||||||
message EvmSignTransactionResponse {
|
|
||||||
oneof result {
|
|
||||||
bytes signature = 1; // 65-byte signature: r[32] || s[32] || v[1]
|
|
||||||
TransactionEvalError eval_error = 2;
|
|
||||||
EvmError error = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmAnalyzeTransactionRequest {
|
|
||||||
bytes wallet_address = 1; // 20-byte Ethereum address
|
|
||||||
bytes rlp_transaction = 2; // RLP-encoded EIP-1559 transaction
|
|
||||||
}
|
|
||||||
|
|
||||||
message EvmAnalyzeTransactionResponse {
|
|
||||||
oneof result {
|
|
||||||
SpecificMeaning meaning = 1;
|
|
||||||
TransactionEvalError eval_error = 2;
|
|
||||||
EvmError error = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
46
protobufs/google/protobuf/timestamp.proto
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package google.protobuf;
|
||||||
|
|
||||||
|
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||||
|
option cc_enable_arenas = true;
|
||||||
|
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
||||||
|
option java_package = "com.google.protobuf";
|
||||||
|
option java_outer_classname = "TimestampProto";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option objc_class_prefix = "GPB";
|
||||||
|
|
||||||
|
// A Timestamp represents a point in time independent of any time zone or local
|
||||||
|
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||||
|
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||||
|
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||||
|
// Gregorian calendar backwards to year one.
|
||||||
|
message Timestamp {
|
||||||
|
// Represents seconds of UTC time since Unix epoch
|
||||||
|
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||||
|
// 9999-12-31T23:59:59Z inclusive.
|
||||||
|
int64 seconds = 1;
|
||||||
|
|
||||||
|
// Non-negative fractions of a second at nanosecond resolution. Negative
|
||||||
|
// second values with fractions must still have non-negative nanos values
|
||||||
|
// that count forward in time. Must be from 0 to 999,999,999
|
||||||
|
// inclusive.
|
||||||
|
int32 nanos = 2;
|
||||||
|
}
|
||||||
14
protobufs/unseal.proto
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package arbiter.unseal;
|
||||||
|
|
||||||
|
message UserAgentKeyRequest {}
|
||||||
|
|
||||||
|
message ServerKeyResponse {
|
||||||
|
bytes pubkey = 1;
|
||||||
|
}
|
||||||
|
message UserAgentSealedKey {
|
||||||
|
bytes sealed_key = 1;
|
||||||
|
bytes pubkey = 2;
|
||||||
|
bytes nonce = 3;
|
||||||
|
}
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package arbiter.user_agent;
|
|
||||||
|
|
||||||
import "evm.proto";
|
|
||||||
import "google/protobuf/empty.proto";
|
|
||||||
|
|
||||||
enum KeyType {
|
|
||||||
KEY_TYPE_UNSPECIFIED = 0;
|
|
||||||
KEY_TYPE_ED25519 = 1;
|
|
||||||
KEY_TYPE_ECDSA_SECP256K1 = 2;
|
|
||||||
KEY_TYPE_RSA = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- SDK client management ---
|
|
||||||
|
|
||||||
enum SdkClientError {
|
|
||||||
SDK_CLIENT_ERROR_UNSPECIFIED = 0;
|
|
||||||
SDK_CLIENT_ERROR_ALREADY_EXISTS = 1;
|
|
||||||
SDK_CLIENT_ERROR_NOT_FOUND = 2;
|
|
||||||
SDK_CLIENT_ERROR_HAS_RELATED_DATA = 3; // hard-delete blocked by FK (client has grants or transaction logs)
|
|
||||||
SDK_CLIENT_ERROR_INTERNAL = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientApproveRequest {
|
|
||||||
bytes pubkey = 1; // 32-byte ed25519 public key
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientRevokeRequest {
|
|
||||||
int32 client_id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientEntry {
|
|
||||||
int32 id = 1;
|
|
||||||
bytes pubkey = 2;
|
|
||||||
int32 created_at = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientList {
|
|
||||||
repeated SdkClientEntry clients = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientApproveResponse {
|
|
||||||
oneof result {
|
|
||||||
SdkClientEntry client = 1;
|
|
||||||
SdkClientError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientRevokeResponse {
|
|
||||||
oneof result {
|
|
||||||
google.protobuf.Empty ok = 1;
|
|
||||||
SdkClientError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientListResponse {
|
|
||||||
oneof result {
|
|
||||||
SdkClientList clients = 1;
|
|
||||||
SdkClientError error = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthChallengeRequest {
|
|
||||||
bytes pubkey = 1;
|
|
||||||
optional string bootstrap_token = 2;
|
|
||||||
KeyType key_type = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthChallenge {
|
|
||||||
int32 nonce = 2;
|
|
||||||
reserved 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthChallengeSolution {
|
|
||||||
bytes signature = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum AuthResult {
|
|
||||||
AUTH_RESULT_UNSPECIFIED = 0;
|
|
||||||
AUTH_RESULT_SUCCESS = 1;
|
|
||||||
AUTH_RESULT_INVALID_KEY = 2;
|
|
||||||
AUTH_RESULT_INVALID_SIGNATURE = 3;
|
|
||||||
AUTH_RESULT_BOOTSTRAP_REQUIRED = 4;
|
|
||||||
AUTH_RESULT_TOKEN_INVALID = 5;
|
|
||||||
AUTH_RESULT_INTERNAL = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message UnsealStart {
|
|
||||||
bytes client_pubkey = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message UnsealStartResponse {
|
|
||||||
bytes server_pubkey = 1;
|
|
||||||
}
|
|
||||||
message UnsealEncryptedKey {
|
|
||||||
bytes nonce = 1;
|
|
||||||
bytes ciphertext = 2;
|
|
||||||
bytes associated_data = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message BootstrapEncryptedKey {
|
|
||||||
bytes nonce = 1;
|
|
||||||
bytes ciphertext = 2;
|
|
||||||
bytes associated_data = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum UnsealResult {
|
|
||||||
UNSEAL_RESULT_UNSPECIFIED = 0;
|
|
||||||
UNSEAL_RESULT_SUCCESS = 1;
|
|
||||||
UNSEAL_RESULT_INVALID_KEY = 2;
|
|
||||||
UNSEAL_RESULT_UNBOOTSTRAPPED = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum BootstrapResult {
|
|
||||||
BOOTSTRAP_RESULT_UNSPECIFIED = 0;
|
|
||||||
BOOTSTRAP_RESULT_SUCCESS = 1;
|
|
||||||
BOOTSTRAP_RESULT_ALREADY_BOOTSTRAPPED = 2;
|
|
||||||
BOOTSTRAP_RESULT_INVALID_KEY = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum VaultState {
|
|
||||||
VAULT_STATE_UNSPECIFIED = 0;
|
|
||||||
VAULT_STATE_UNBOOTSTRAPPED = 1;
|
|
||||||
VAULT_STATE_SEALED = 2;
|
|
||||||
VAULT_STATE_UNSEALED = 3;
|
|
||||||
VAULT_STATE_ERROR = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientConnectionRequest {
|
|
||||||
bytes pubkey = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientConnectionResponse {
|
|
||||||
bool approved = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SdkClientConnectionCancel {}
|
|
||||||
|
|
||||||
message UserAgentRequest {
|
|
||||||
int32 id = 16;
|
|
||||||
oneof payload {
|
|
||||||
AuthChallengeRequest auth_challenge_request = 1;
|
|
||||||
AuthChallengeSolution auth_challenge_solution = 2;
|
|
||||||
UnsealStart unseal_start = 3;
|
|
||||||
UnsealEncryptedKey unseal_encrypted_key = 4;
|
|
||||||
google.protobuf.Empty query_vault_state = 5;
|
|
||||||
google.protobuf.Empty evm_wallet_create = 6;
|
|
||||||
google.protobuf.Empty evm_wallet_list = 7;
|
|
||||||
arbiter.evm.EvmGrantCreateRequest evm_grant_create = 8;
|
|
||||||
arbiter.evm.EvmGrantDeleteRequest evm_grant_delete = 9;
|
|
||||||
arbiter.evm.EvmGrantListRequest evm_grant_list = 10;
|
|
||||||
SdkClientConnectionResponse sdk_client_connection_response = 11;
|
|
||||||
SdkClientApproveRequest sdk_client_approve = 12;
|
|
||||||
SdkClientRevokeRequest sdk_client_revoke = 13;
|
|
||||||
google.protobuf.Empty sdk_client_list = 14;
|
|
||||||
BootstrapEncryptedKey bootstrap_encrypted_key = 15;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
message UserAgentResponse {
|
|
||||||
optional int32 id = 16;
|
|
||||||
oneof payload {
|
|
||||||
AuthChallenge auth_challenge = 1;
|
|
||||||
AuthResult auth_result = 2;
|
|
||||||
UnsealStartResponse unseal_start_response = 3;
|
|
||||||
UnsealResult unseal_result = 4;
|
|
||||||
VaultState vault_state = 5;
|
|
||||||
arbiter.evm.WalletCreateResponse evm_wallet_create = 6;
|
|
||||||
arbiter.evm.WalletListResponse evm_wallet_list = 7;
|
|
||||||
arbiter.evm.EvmGrantCreateResponse evm_grant_create = 8;
|
|
||||||
arbiter.evm.EvmGrantDeleteResponse evm_grant_delete = 9;
|
|
||||||
arbiter.evm.EvmGrantListResponse evm_grant_list = 10;
|
|
||||||
SdkClientConnectionResponse sdk_client_connection_response = 11;
|
|
||||||
SdkClientApproveResponse sdk_client_approve_response = 12;
|
|
||||||
SdkClientRevokeResponse sdk_client_revoke_response = 13;
|
|
||||||
SdkClientListResponse sdk_client_list_response = 14;
|
|
||||||
BootstrapResult bootstrap_result = 15;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Fetch the Uniswap default token list and emit Rust `TokenInfo` statics.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
python3 gen_erc20_registry.py # fetch from IPFS
|
|
||||||
python3 gen_erc20_registry.py tokens.json # local file
|
|
||||||
python3 gen_erc20_registry.py tokens.json out.rs # custom output file
|
|
||||||
"""
|
|
||||||
|
|
||||||
import json
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
import unicodedata
|
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
UNISWAP_URL = "https://ipfs.io/ipns/tokens.uniswap.org"
|
|
||||||
|
|
||||||
SOLANA_CHAIN_ID = 501000101
|
|
||||||
IDENTIFIER_RE = re.compile(r"[^A-Za-z0-9]+")
|
|
||||||
|
|
||||||
|
|
||||||
def load_tokens(source=None):
|
|
||||||
if source:
|
|
||||||
with open(source) as f:
|
|
||||||
return json.load(f)
|
|
||||||
req = urllib.request.Request(
|
|
||||||
UNISWAP_URL,
|
|
||||||
headers={"Accept": "application/json", "User-Agent": "gen_tokens/1.0"},
|
|
||||||
)
|
|
||||||
with urllib.request.urlopen(req, timeout=60) as resp:
|
|
||||||
return json.loads(resp.read())
|
|
||||||
|
|
||||||
|
|
||||||
def escape(s: str) -> str:
|
|
||||||
return s.replace("\\", "\\\\").replace('"', '\\"')
|
|
||||||
|
|
||||||
|
|
||||||
def to_screaming_case(name: str) -> str:
|
|
||||||
normalized = unicodedata.normalize("NFKD", name or "")
|
|
||||||
ascii_name = normalized.encode("ascii", "ignore").decode("ascii")
|
|
||||||
snake = IDENTIFIER_RE.sub("_", ascii_name).strip("_").upper()
|
|
||||||
if not snake:
|
|
||||||
snake = "TOKEN"
|
|
||||||
if snake[0].isdigit():
|
|
||||||
snake = f"TOKEN_{snake}"
|
|
||||||
return snake
|
|
||||||
|
|
||||||
|
|
||||||
def static_name_for_token(token: dict, used_names: set[str]) -> str:
|
|
||||||
base = to_screaming_case(token.get("name", ""))
|
|
||||||
if base not in used_names:
|
|
||||||
used_names.add(base)
|
|
||||||
return base
|
|
||||||
|
|
||||||
address = token["address"]
|
|
||||||
suffix = f"{token['chainId']}_{address[2:].upper()[-8:]}"
|
|
||||||
candidate = f"{base}_{suffix}"
|
|
||||||
|
|
||||||
i = 2
|
|
||||||
while candidate in used_names:
|
|
||||||
candidate = f"{base}_{suffix}_{i}"
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
used_names.add(candidate)
|
|
||||||
return candidate
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
source = sys.argv[1] if len(sys.argv) > 1 else None
|
|
||||||
output = sys.argv[2] if len(sys.argv) > 2 else "generated_tokens.rs"
|
|
||||||
data = load_tokens(source)
|
|
||||||
tokens = data["tokens"]
|
|
||||||
|
|
||||||
# Deduplicate by (chainId, address)
|
|
||||||
seen = set()
|
|
||||||
unique = []
|
|
||||||
for t in tokens:
|
|
||||||
key = (t["chainId"], t["address"].lower())
|
|
||||||
if key not in seen:
|
|
||||||
seen.add(key)
|
|
||||||
unique.append(t)
|
|
||||||
|
|
||||||
unique.sort(key=lambda t: (t["chainId"], t.get("symbol", "").upper()))
|
|
||||||
evm_tokens = [t for t in unique if t["chainId"] != SOLANA_CHAIN_ID]
|
|
||||||
|
|
||||||
ver = data["version"]
|
|
||||||
lines = []
|
|
||||||
w = lines.append
|
|
||||||
|
|
||||||
w(
|
|
||||||
f"// Auto-generated from Uniswap token list v{ver['major']}.{ver['minor']}.{ver['patch']}"
|
|
||||||
)
|
|
||||||
w(f"// {len(evm_tokens)} tokens")
|
|
||||||
w("// DO NOT EDIT - regenerate with gen_erc20_registry.py")
|
|
||||||
w("")
|
|
||||||
|
|
||||||
used_static_names = set()
|
|
||||||
token_statics = []
|
|
||||||
for t in evm_tokens:
|
|
||||||
static_name = static_name_for_token(t, used_static_names)
|
|
||||||
token_statics.append((static_name, t))
|
|
||||||
|
|
||||||
for static_name, t in token_statics:
|
|
||||||
addr = t["address"]
|
|
||||||
name = escape(t.get("name", ""))
|
|
||||||
symbol = escape(t.get("symbol", ""))
|
|
||||||
decimals = t.get("decimals", 18)
|
|
||||||
logo = t.get("logoURI")
|
|
||||||
chain = t["chainId"]
|
|
||||||
|
|
||||||
logo_val = f'Some("{escape(logo)}")' if logo else "None"
|
|
||||||
|
|
||||||
w(f"pub static {static_name}: TokenInfo = TokenInfo {{")
|
|
||||||
w(f' name: "{name}",')
|
|
||||||
w(f' symbol: "{symbol}",')
|
|
||||||
w(f" decimals: {decimals},")
|
|
||||||
w(f' contract: address!("{addr}"),')
|
|
||||||
w(f" chain: {chain},")
|
|
||||||
w(f" logo_uri: {logo_val},")
|
|
||||||
w("};")
|
|
||||||
w("")
|
|
||||||
|
|
||||||
w("pub static TOKENS: &[&TokenInfo] = &[")
|
|
||||||
for static_name, _ in token_statics:
|
|
||||||
w(f" &{static_name},")
|
|
||||||
w("];")
|
|
||||||
w("")
|
|
||||||
w("pub fn get_token(")
|
|
||||||
w(" chain_id: alloy::primitives::ChainId,")
|
|
||||||
w(" address: alloy::primitives::Address,")
|
|
||||||
w(") -> Option<&'static TokenInfo> {")
|
|
||||||
w(" match (chain_id, address) {")
|
|
||||||
for static_name, t in token_statics:
|
|
||||||
w(
|
|
||||||
f' ({t["chainId"]}, addr) if addr == address!("{t["address"]}") => Some(&{static_name}),'
|
|
||||||
)
|
|
||||||
w(" _ => None,")
|
|
||||||
w(" }")
|
|
||||||
w("}")
|
|
||||||
w("")
|
|
||||||
|
|
||||||
with open(output, "w") as f:
|
|
||||||
f.write("\n".join(lines))
|
|
||||||
|
|
||||||
print(f"Wrote {len(token_statics)} tokens to {output}")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[advisories]
|
|
||||||
# RUSTSEC-2023-0071: Marvin Attack timing side-channel in rsa crate.
|
|
||||||
# No fixed version is available upstream.
|
|
||||||
# RSA support is required for Windows Hello / KeyCredentialManager
|
|
||||||
# (https://learn.microsoft.com/en-us/uwp/api/windows.security.credentials.keycredentialmanager.requestcreateasync),
|
|
||||||
# which only issues RSA-2048 keys.
|
|
||||||
# Mitigations in place:
|
|
||||||
# - Signing uses BlindedSigningKey (PSS+SHA-256), which applies blinding to
|
|
||||||
# protect the private key from timing recovery during signing.
|
|
||||||
# - RSA decryption is never performed; we only verify public-key signatures.
|
|
||||||
# - The attack requires local, high-resolution timing access against the
|
|
||||||
# signing process, which is not exposed in our threat model.
|
|
||||||
ignore = ["RUSTSEC-2023-0071"]
|
|
||||||
3444
server/Cargo.lock
generated
@@ -1,44 +1,25 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = ["crates/*"]
|
members = [
|
||||||
|
"crates/arbiter-client",
|
||||||
|
"crates/arbiter-proto",
|
||||||
|
"crates/arbiter-server",
|
||||||
|
"crates/arbiter-useragent",
|
||||||
|
]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
|
|
||||||
[workspace.lints.clippy]
|
|
||||||
disallowed-methods = "deny"
|
|
||||||
|
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
tonic = { version = "0.14.5", features = [
|
tonic = { version = "0.14.3", features = ["deflate", "gzip", "tls-connect-info", "zstd"] }
|
||||||
"deflate",
|
|
||||||
"gzip",
|
|
||||||
"tls-connect-info",
|
|
||||||
"zstd",
|
|
||||||
] }
|
|
||||||
tracing = "0.1.44"
|
tracing = "0.1.44"
|
||||||
tokio = { version = "1.50.0", features = ["full"] }
|
tokio = { version = "1.49.0", features = ["full"] }
|
||||||
ed25519-dalek = { version = "3.0.0-pre.6", features = ["rand_core"] }
|
ed25519-dalek = { version = "3.0.0-pre.6", features = ["rand_core"] }
|
||||||
chrono = { version = "0.4.44", features = ["serde"] }
|
chrono = { version = "0.4.43", features = ["serde"] }
|
||||||
rand = "0.10.0"
|
rand = "0.10.0"
|
||||||
rustls = { version = "0.23.37", features = ["aws-lc-rs"] }
|
rustls = "0.23.36"
|
||||||
smlang = "0.8.0"
|
smlang = "0.8.0"
|
||||||
miette = { version = "7.6.0", features = ["fancy", "serde"] }
|
miette = { version = "7.6.0", features = ["fancy", "serde"] }
|
||||||
thiserror = "2.0.18"
|
thiserror = "2.0.18"
|
||||||
async-trait = "0.1.89"
|
async-trait = "0.1.89"
|
||||||
futures = "0.3.32"
|
futures = "0.3.31"
|
||||||
tokio-stream = { version = "0.1.18", features = ["full"] }
|
tokio-stream = { version = "0.1.18", features = ["full"] }
|
||||||
kameo = "0.19.2"
|
kameo = "0.19.2"
|
||||||
prost-types = { version = "0.14.3", features = ["chrono"] }
|
|
||||||
x25519-dalek = { version = "2.0.1", features = ["getrandom"] }
|
|
||||||
rstest = "0.26.1"
|
|
||||||
rustls-pki-types = "1.14.0"
|
|
||||||
alloy = "1.7.3"
|
|
||||||
rcgen = { version = "0.14.7", features = [
|
|
||||||
"aws_lc_rs",
|
|
||||||
"pem",
|
|
||||||
"x509-parser",
|
|
||||||
"zeroize",
|
|
||||||
], default-features = false }
|
|
||||||
k256 = { version = "0.13.4", features = ["ecdsa", "pkcs8"] }
|
|
||||||
rsa = { version = "0.9", features = ["sha2"] }
|
|
||||||
sha2 = "0.10"
|
|
||||||
spki = "0.7"
|
|
||||||
terrors = { version = "0.5", git = "https://github.com/CleverWild/terrors" }
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
disallowed-methods = [
|
|
||||||
# RSA decryption is forbidden: the rsa crate has RUSTSEC-2023-0071 (Marvin Attack).
|
|
||||||
# We only use RSA for Windows Hello (KeyCredentialManager) public-key verification — decryption
|
|
||||||
# is never required and must not be introduced.
|
|
||||||
{ path = "rsa::RsaPrivateKey::decrypt", reason = "RSA decryption is forbidden (RUSTSEC-2023-0071 Marvin Attack). Only PSS signing/verification is permitted." },
|
|
||||||
{ path = "rsa::RsaPrivateKey::decrypt_blinded", reason = "RSA decryption is forbidden (RUSTSEC-2023-0071 Marvin Attack). Only PSS signing/verification is permitted." },
|
|
||||||
{ path = "rsa::traits::Decryptor::decrypt", reason = "RSA decryption is forbidden (RUSTSEC-2023-0071 Marvin Attack). This blocks decrypt() on rsa::{pkcs1v15,oaep}::DecryptingKey." },
|
|
||||||
{ path = "rsa::traits::RandomizedDecryptor::decrypt_with_rng", reason = "RSA decryption is forbidden (RUSTSEC-2023-0071 Marvin Attack). This blocks decrypt_with_rng() on rsa::{pkcs1v15,oaep}::DecryptingKey." },
|
|
||||||
]
|
|
||||||
BIN
server/crates/.DS_Store
vendored
@@ -3,25 +3,5 @@ name = "arbiter-client"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
repository = "https://git.markettakers.org/MarketTakers/arbiter"
|
repository = "https://git.markettakers.org/MarketTakers/arbiter"
|
||||||
license = "Apache-2.0"
|
|
||||||
|
|
||||||
[lints]
|
|
||||||
workspace = true
|
|
||||||
|
|
||||||
[features]
|
|
||||||
evm = ["dep:alloy"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arbiter-proto.path = "../arbiter-proto"
|
|
||||||
alloy = { workspace = true, optional = true }
|
|
||||||
tonic.workspace = true
|
|
||||||
tonic.features = ["tls-aws-lc"]
|
|
||||||
tokio.workspace = true
|
|
||||||
tokio-stream.workspace = true
|
|
||||||
ed25519-dalek.workspace = true
|
|
||||||
thiserror.workspace = true
|
|
||||||
http = "1.4.0"
|
|
||||||
rustls-webpki = { version = "0.103.10", features = ["aws-lc-rs"] }
|
|
||||||
async-trait.workspace = true
|
|
||||||
rand.workspace = true
|
|
||||||
terrors.workspace = true
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
use arbiter_proto::{
|
|
||||||
format_challenge,
|
|
||||||
proto::client::{
|
|
||||||
AuthChallengeRequest, AuthChallengeSolution, AuthResult, ClientRequest,
|
|
||||||
client_request::Payload as ClientRequestPayload,
|
|
||||||
client_response::Payload as ClientResponsePayload,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
use ed25519_dalek::Signer as _;
|
|
||||||
use terrors::OneOf;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
errors::{
|
|
||||||
ConnectError, MissingAuthChallengeError, UnexpectedAuthResponseError, map_auth_code_error,
|
|
||||||
},
|
|
||||||
transport::{ClientTransport, next_request_id},
|
|
||||||
};
|
|
||||||
|
|
||||||
async fn send_auth_challenge_request(
|
|
||||||
transport: &mut ClientTransport,
|
|
||||||
key: &ed25519_dalek::SigningKey,
|
|
||||||
) -> std::result::Result<(), ConnectError> {
|
|
||||||
transport
|
|
||||||
.send(ClientRequest {
|
|
||||||
request_id: next_request_id(),
|
|
||||||
payload: Some(ClientRequestPayload::AuthChallengeRequest(
|
|
||||||
AuthChallengeRequest {
|
|
||||||
pubkey: key.verifying_key().to_bytes().to_vec(),
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
.map_err(|_| OneOf::new(UnexpectedAuthResponseError))
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn receive_auth_challenge(
|
|
||||||
transport: &mut ClientTransport,
|
|
||||||
) -> std::result::Result<arbiter_proto::proto::client::AuthChallenge, ConnectError> {
|
|
||||||
let response = transport
|
|
||||||
.recv()
|
|
||||||
.await
|
|
||||||
.map_err(|_| OneOf::new(MissingAuthChallengeError))?;
|
|
||||||
|
|
||||||
let payload = response
|
|
||||||
.payload
|
|
||||||
.ok_or_else(|| OneOf::new(MissingAuthChallengeError))?;
|
|
||||||
match payload {
|
|
||||||
ClientResponsePayload::AuthChallenge(challenge) => Ok(challenge),
|
|
||||||
ClientResponsePayload::AuthResult(result) => Err(map_auth_code_error(result)),
|
|
||||||
_ => Err(OneOf::new(UnexpectedAuthResponseError)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn send_auth_challenge_solution(
|
|
||||||
transport: &mut ClientTransport,
|
|
||||||
key: &ed25519_dalek::SigningKey,
|
|
||||||
challenge: arbiter_proto::proto::client::AuthChallenge,
|
|
||||||
) -> std::result::Result<(), ConnectError> {
|
|
||||||
let challenge_payload = format_challenge(challenge.nonce, &challenge.pubkey);
|
|
||||||
let signature = key.sign(&challenge_payload).to_bytes().to_vec();
|
|
||||||
|
|
||||||
transport
|
|
||||||
.send(ClientRequest {
|
|
||||||
request_id: next_request_id(),
|
|
||||||
payload: Some(ClientRequestPayload::AuthChallengeSolution(
|
|
||||||
AuthChallengeSolution { signature },
|
|
||||||
)),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
.map_err(|_| OneOf::new(UnexpectedAuthResponseError))
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn receive_auth_confirmation(
|
|
||||||
transport: &mut ClientTransport,
|
|
||||||
) -> std::result::Result<(), ConnectError> {
|
|
||||||
let response = transport
|
|
||||||
.recv()
|
|
||||||
.await
|
|
||||||
.map_err(|_| OneOf::new(UnexpectedAuthResponseError))?;
|
|
||||||
|
|
||||||
let payload = response
|
|
||||||
.payload
|
|
||||||
.ok_or_else(|| OneOf::new(UnexpectedAuthResponseError))?;
|
|
||||||
match payload {
|
|
||||||
ClientResponsePayload::AuthResult(result)
|
|
||||||
if AuthResult::try_from(result).ok() == Some(AuthResult::Success) =>
|
|
||||||
{
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
ClientResponsePayload::AuthResult(result) => Err(map_auth_code_error(result)),
|
|
||||||
_ => Err(OneOf::new(UnexpectedAuthResponseError)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) async fn authenticate(
|
|
||||||
transport: &mut ClientTransport,
|
|
||||||
key: &ed25519_dalek::SigningKey,
|
|
||||||
) -> std::result::Result<(), ConnectError> {
|
|
||||||
send_auth_challenge_request(transport, key).await?;
|
|
||||||
let challenge = receive_auth_challenge(transport).await?;
|
|
||||||
send_auth_challenge_solution(transport, key, challenge).await?;
|
|
||||||
receive_auth_confirmation(transport).await
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
use arbiter_proto::{proto::arbiter_service_client::ArbiterServiceClient, url::ArbiterUrl};
|
|
||||||
use std::sync::Arc;
|
|
||||||
use terrors::{Broaden as _, OneOf};
|
|
||||||
use tokio::sync::{Mutex, mpsc};
|
|
||||||
use tokio_stream::wrappers::ReceiverStream;
|
|
||||||
use tonic::transport::ClientTlsConfig;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
auth::authenticate,
|
|
||||||
errors::ConnectError,
|
|
||||||
storage::{FileSigningKeyStorage, SigningKeyStorage},
|
|
||||||
transport::{BUFFER_LENGTH, ClientTransport},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
use crate::errors::{ClientConnectionClosedError, ClientError};
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
use crate::wallets::evm::ArbiterEvmWallet;
|
|
||||||
|
|
||||||
pub struct ArbiterClient {
|
|
||||||
#[allow(dead_code)]
|
|
||||||
transport: Arc<Mutex<ClientTransport>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ArbiterClient {
|
|
||||||
pub async fn connect(url: ArbiterUrl) -> Result<Self, ConnectError> {
|
|
||||||
let storage = FileSigningKeyStorage::from_default_location().broaden()?;
|
|
||||||
Self::connect_with_storage(url, &storage).await
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn connect_with_storage<S: SigningKeyStorage>(
|
|
||||||
url: ArbiterUrl,
|
|
||||||
storage: &S,
|
|
||||||
) -> Result<Self, ConnectError> {
|
|
||||||
let key = storage.load_or_create().broaden()?;
|
|
||||||
Self::connect_with_key(url, key).await
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn connect_with_key(
|
|
||||||
url: ArbiterUrl,
|
|
||||||
key: ed25519_dalek::SigningKey,
|
|
||||||
) -> Result<Self, ConnectError> {
|
|
||||||
let anchor = webpki::anchor_from_trusted_cert(&url.ca_cert)
|
|
||||||
.map_err(OneOf::new)?
|
|
||||||
.to_owned();
|
|
||||||
let tls = ClientTlsConfig::new().trust_anchor(anchor);
|
|
||||||
|
|
||||||
let channel = tonic::transport::Channel::from_shared(format!("{}:{}", url.host, url.port))
|
|
||||||
.map_err(OneOf::new)?
|
|
||||||
.tls_config(tls)
|
|
||||||
.map_err(OneOf::new)?
|
|
||||||
.connect()
|
|
||||||
.await
|
|
||||||
.map_err(OneOf::new)?;
|
|
||||||
|
|
||||||
let mut client = ArbiterServiceClient::new(channel);
|
|
||||||
let (tx, rx) = mpsc::channel(BUFFER_LENGTH);
|
|
||||||
let response_stream = client
|
|
||||||
.client(ReceiverStream::new(rx))
|
|
||||||
.await
|
|
||||||
.map_err(OneOf::new)?
|
|
||||||
.into_inner();
|
|
||||||
|
|
||||||
let mut transport = ClientTransport {
|
|
||||||
sender: tx,
|
|
||||||
receiver: response_stream,
|
|
||||||
};
|
|
||||||
|
|
||||||
authenticate(&mut transport, &key).await?;
|
|
||||||
|
|
||||||
Ok(Self {
|
|
||||||
transport: Arc::new(Mutex::new(transport)),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
pub async fn evm_wallets(&self) -> Result<Vec<ArbiterEvmWallet>, ClientError> {
|
|
||||||
let _ = &self.transport;
|
|
||||||
Err(OneOf::new(ClientConnectionClosedError))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
use terrors::OneOf;
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
use alloy::{primitives::ChainId, signers::Error as AlloySignerError};
|
|
||||||
|
|
||||||
pub type StorageError = OneOf<(std::io::Error, InvalidKeyLengthError)>;
|
|
||||||
|
|
||||||
pub type ConnectError = OneOf<(
|
|
||||||
tonic::transport::Error,
|
|
||||||
http::uri::InvalidUri,
|
|
||||||
webpki::Error,
|
|
||||||
tonic::Status,
|
|
||||||
MissingAuthChallengeError,
|
|
||||||
ApprovalDeniedError,
|
|
||||||
NoUserAgentsOnlineError,
|
|
||||||
UnexpectedAuthResponseError,
|
|
||||||
std::io::Error,
|
|
||||||
InvalidKeyLengthError,
|
|
||||||
)>;
|
|
||||||
|
|
||||||
pub type ClientError = OneOf<(tonic::Status, ClientConnectionClosedError)>;
|
|
||||||
|
|
||||||
pub(crate) type ClientTransportError =
|
|
||||||
OneOf<(TransportChannelClosedError, TransportConnectionClosedError)>;
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
pub(crate) type EvmWalletError = OneOf<(
|
|
||||||
EvmChainIdMismatchError,
|
|
||||||
EvmHashSigningUnsupportedError,
|
|
||||||
EvmTransactionSigningUnsupportedError,
|
|
||||||
)>;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Invalid signing key length in storage: expected {expected} bytes, got {actual} bytes")]
|
|
||||||
pub struct InvalidKeyLengthError {
|
|
||||||
pub expected: usize,
|
|
||||||
pub actual: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Auth challenge was not returned by server")]
|
|
||||||
pub struct MissingAuthChallengeError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Client approval denied by User Agent")]
|
|
||||||
pub struct ApprovalDeniedError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("No User Agents online to approve client")]
|
|
||||||
pub struct NoUserAgentsOnlineError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Unexpected auth response payload")]
|
|
||||||
pub struct UnexpectedAuthResponseError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Connection closed by server")]
|
|
||||||
pub struct ClientConnectionClosedError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Transport channel closed")]
|
|
||||||
pub struct TransportChannelClosedError;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Connection closed by server")]
|
|
||||||
pub struct TransportConnectionClosedError;
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("Transaction chain id mismatch: signer {signer}, tx {tx}")]
|
|
||||||
pub struct EvmChainIdMismatchError {
|
|
||||||
pub signer: ChainId,
|
|
||||||
pub tx: ChainId,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("hash-only signing is not supported for ArbiterEvmWallet; use transaction signing")]
|
|
||||||
pub struct EvmHashSigningUnsupportedError;
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Error)]
|
|
||||||
#[error("transaction signing is not supported by current arbiter.client protocol")]
|
|
||||||
pub struct EvmTransactionSigningUnsupportedError;
|
|
||||||
|
|
||||||
pub(crate) fn map_auth_code_error(code: i32) -> ConnectError {
|
|
||||||
use arbiter_proto::proto::client::AuthResult;
|
|
||||||
|
|
||||||
match AuthResult::try_from(code).unwrap_or(AuthResult::Unspecified) {
|
|
||||||
AuthResult::ApprovalDenied => OneOf::new(ApprovalDeniedError),
|
|
||||||
AuthResult::NoUserAgentsOnline => OneOf::new(NoUserAgentsOnlineError),
|
|
||||||
AuthResult::Unspecified
|
|
||||||
| AuthResult::Success
|
|
||||||
| AuthResult::InvalidKey
|
|
||||||
| AuthResult::InvalidSignature
|
|
||||||
| AuthResult::Internal => OneOf::new(UnexpectedAuthResponseError),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
impl From<EvmChainIdMismatchError> for AlloySignerError {
|
|
||||||
fn from(value: EvmChainIdMismatchError) -> Self {
|
|
||||||
AlloySignerError::TransactionChainIdMismatch {
|
|
||||||
signer: value.signer,
|
|
||||||
tx: value.tx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
impl From<EvmHashSigningUnsupportedError> for AlloySignerError {
|
|
||||||
fn from(_value: EvmHashSigningUnsupportedError) -> Self {
|
|
||||||
AlloySignerError::other(
|
|
||||||
"hash-only signing is not supported for ArbiterEvmWallet; use transaction signing",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
|
||||||
impl From<EvmTransactionSigningUnsupportedError> for AlloySignerError {
|
|
||||||
fn from(_value: EvmTransactionSigningUnsupportedError) -> Self {
|
|
||||||
AlloySignerError::other(
|
|
||||||
"transaction signing is not supported by current arbiter.client protocol",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
mod auth;
|
pub fn add(left: u64, right: u64) -> u64 {
|
||||||
mod client;
|
left + right
|
||||||
mod errors;
|
}
|
||||||
mod storage;
|
|
||||||
mod transport;
|
|
||||||
pub mod wallets;
|
|
||||||
|
|
||||||
pub use client::ArbiterClient;
|
#[cfg(test)]
|
||||||
pub use errors::{ClientError, ConnectError, StorageError};
|
mod tests {
|
||||||
pub use storage::{FileSigningKeyStorage, SigningKeyStorage};
|
use super::*;
|
||||||
|
|
||||||
#[cfg(feature = "evm")]
|
#[test]
|
||||||
pub use wallets::evm::ArbiterEvmWallet;
|
fn it_works() {
|
||||||
|
let result = add(2, 2);
|
||||||
|
assert_eq!(result, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,130 +0,0 @@
|
|||||||
use arbiter_proto::home_path;
|
|
||||||
use std::path::{Path, PathBuf};
|
|
||||||
use terrors::OneOf;
|
|
||||||
|
|
||||||
use crate::errors::{InvalidKeyLengthError, StorageError};
|
|
||||||
|
|
||||||
pub trait SigningKeyStorage {
|
|
||||||
fn load_or_create(&self) -> std::result::Result<ed25519_dalek::SigningKey, StorageError>;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
|
||||||
pub struct FileSigningKeyStorage {
|
|
||||||
path: PathBuf,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FileSigningKeyStorage {
|
|
||||||
pub const DEFAULT_FILE_NAME: &str = "sdk_client_ed25519.key";
|
|
||||||
|
|
||||||
pub fn new(path: impl Into<PathBuf>) -> Self {
|
|
||||||
Self { path: path.into() }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn from_default_location() -> std::result::Result<Self, StorageError> {
|
|
||||||
Ok(Self::new(
|
|
||||||
home_path()
|
|
||||||
.map_err(OneOf::new)?
|
|
||||||
.join(Self::DEFAULT_FILE_NAME),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn read_key(path: &Path) -> std::result::Result<ed25519_dalek::SigningKey, StorageError> {
|
|
||||||
let bytes = std::fs::read(path).map_err(OneOf::new)?;
|
|
||||||
let raw: [u8; 32] = bytes.try_into().map_err(|v: Vec<u8>| {
|
|
||||||
OneOf::new(InvalidKeyLengthError {
|
|
||||||
expected: 32,
|
|
||||||
actual: v.len(),
|
|
||||||
})
|
|
||||||
})?;
|
|
||||||
Ok(ed25519_dalek::SigningKey::from_bytes(&raw))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SigningKeyStorage for FileSigningKeyStorage {
|
|
||||||
fn load_or_create(&self) -> std::result::Result<ed25519_dalek::SigningKey, StorageError> {
|
|
||||||
if let Some(parent) = self.path.parent() {
|
|
||||||
std::fs::create_dir_all(parent).map_err(OneOf::new)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.path.exists() {
|
|
||||||
return Self::read_key(&self.path);
|
|
||||||
}
|
|
||||||
|
|
||||||
let key = ed25519_dalek::SigningKey::generate(&mut rand::rng());
|
|
||||||
let raw_key = key.to_bytes();
|
|
||||||
|
|
||||||
// Use create_new to prevent accidental overwrite if another process creates the key first.
|
|
||||||
match std::fs::OpenOptions::new()
|
|
||||||
.create_new(true)
|
|
||||||
.write(true)
|
|
||||||
.open(&self.path)
|
|
||||||
{
|
|
||||||
Ok(mut file) => {
|
|
||||||
use std::io::Write as _;
|
|
||||||
file.write_all(&raw_key).map_err(OneOf::new)?;
|
|
||||||
Ok(key)
|
|
||||||
}
|
|
||||||
Err(err) if err.kind() == std::io::ErrorKind::AlreadyExists => {
|
|
||||||
Self::read_key(&self.path)
|
|
||||||
}
|
|
||||||
Err(err) => Err(OneOf::new(err)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::{FileSigningKeyStorage, SigningKeyStorage};
|
|
||||||
use crate::errors::InvalidKeyLengthError;
|
|
||||||
|
|
||||||
fn unique_temp_key_path() -> std::path::PathBuf {
|
|
||||||
let nanos = std::time::SystemTime::now()
|
|
||||||
.duration_since(std::time::UNIX_EPOCH)
|
|
||||||
.expect("clock should be after unix epoch")
|
|
||||||
.as_nanos();
|
|
||||||
std::env::temp_dir().join(format!(
|
|
||||||
"arbiter-client-key-{}-{}.bin",
|
|
||||||
std::process::id(),
|
|
||||||
nanos
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn file_storage_creates_and_reuses_key() {
|
|
||||||
let path = unique_temp_key_path();
|
|
||||||
let storage = FileSigningKeyStorage::new(path.clone());
|
|
||||||
|
|
||||||
let key_a = storage
|
|
||||||
.load_or_create()
|
|
||||||
.expect("first load_or_create should create key");
|
|
||||||
let key_b = storage
|
|
||||||
.load_or_create()
|
|
||||||
.expect("second load_or_create should read same key");
|
|
||||||
|
|
||||||
assert_eq!(key_a.to_bytes(), key_b.to_bytes());
|
|
||||||
assert!(path.exists());
|
|
||||||
|
|
||||||
std::fs::remove_file(path).expect("temp key file should be removable");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn file_storage_rejects_invalid_key_length() {
|
|
||||||
let path = unique_temp_key_path();
|
|
||||||
std::fs::write(&path, [42u8; 31]).expect("should write invalid key file");
|
|
||||||
let storage = FileSigningKeyStorage::new(path.clone());
|
|
||||||
|
|
||||||
let err = storage
|
|
||||||
.load_or_create()
|
|
||||||
.expect_err("storage should reject non-32-byte key file");
|
|
||||||
|
|
||||||
match err.narrow::<InvalidKeyLengthError, _>() {
|
|
||||||
Ok(invalid_len) => {
|
|
||||||
assert_eq!(invalid_len.expected, 32);
|
|
||||||
assert_eq!(invalid_len.actual, 31);
|
|
||||||
}
|
|
||||||
Err(other) => panic!("unexpected io error: {other:?}"),
|
|
||||||
}
|
|
||||||
|
|
||||||
std::fs::remove_file(path).expect("temp key file should be removable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
use arbiter_proto::proto::client::{ClientRequest, ClientResponse};
|
|
||||||
use std::sync::atomic::{AtomicI32, Ordering};
|
|
||||||
use terrors::OneOf;
|
|
||||||
use tokio::sync::mpsc;
|
|
||||||
|
|
||||||
use crate::errors::{
|
|
||||||
ClientTransportError, TransportChannelClosedError, TransportConnectionClosedError,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub(crate) const BUFFER_LENGTH: usize = 16;
|
|
||||||
static NEXT_REQUEST_ID: AtomicI32 = AtomicI32::new(1);
|
|
||||||
|
|
||||||
pub(crate) fn next_request_id() -> i32 {
|
|
||||||
NEXT_REQUEST_ID.fetch_add(1, Ordering::Relaxed)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) struct ClientTransport {
|
|
||||||
pub(crate) sender: mpsc::Sender<ClientRequest>,
|
|
||||||
pub(crate) receiver: tonic::Streaming<ClientResponse>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ClientTransport {
|
|
||||||
pub(crate) async fn send(
|
|
||||||
&mut self,
|
|
||||||
request: ClientRequest,
|
|
||||||
) -> std::result::Result<(), ClientTransportError> {
|
|
||||||
self.sender
|
|
||||||
.send(request)
|
|
||||||
.await
|
|
||||||
.map_err(|_| OneOf::new(TransportChannelClosedError))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) async fn recv(
|
|
||||||
&mut self,
|
|
||||||
) -> std::result::Result<ClientResponse, ClientTransportError> {
|
|
||||||
match self.receiver.message().await {
|
|
||||||
Ok(Some(resp)) => Ok(resp),
|
|
||||||
Ok(None) => Err(OneOf::new(TransportConnectionClosedError)),
|
|
||||||
Err(_) => Err(OneOf::new(TransportConnectionClosedError)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
use alloy::{
|
|
||||||
consensus::SignableTransaction,
|
|
||||||
network::TxSigner,
|
|
||||||
primitives::{Address, B256, ChainId, Signature},
|
|
||||||
signers::{Result, Signer},
|
|
||||||
};
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use std::sync::Arc;
|
|
||||||
use terrors::OneOf;
|
|
||||||
use tokio::sync::Mutex;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
errors::{
|
|
||||||
EvmChainIdMismatchError, EvmHashSigningUnsupportedError,
|
|
||||||
EvmTransactionSigningUnsupportedError, EvmWalletError,
|
|
||||||
},
|
|
||||||
transport::ClientTransport,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct ArbiterEvmWallet {
|
|
||||||
transport: Arc<Mutex<ClientTransport>>,
|
|
||||||
address: Address,
|
|
||||||
chain_id: Option<ChainId>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ArbiterEvmWallet {
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub(crate) fn new(transport: Arc<Mutex<ClientTransport>>, address: Address) -> Self {
|
|
||||||
Self {
|
|
||||||
transport,
|
|
||||||
address,
|
|
||||||
chain_id: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn address(&self) -> Address {
|
|
||||||
self.address
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn with_chain_id(mut self, chain_id: ChainId) -> Self {
|
|
||||||
self.chain_id = Some(chain_id);
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn validate_chain_id(
|
|
||||||
&self,
|
|
||||||
tx: &mut dyn SignableTransaction<Signature>,
|
|
||||||
) -> std::result::Result<(), EvmWalletError> {
|
|
||||||
if let Some(chain_id) = self.chain_id
|
|
||||||
&& !tx.set_chain_id_checked(chain_id)
|
|
||||||
{
|
|
||||||
return Err(OneOf::new(EvmChainIdMismatchError {
|
|
||||||
signer: chain_id,
|
|
||||||
tx: tx.chain_id().unwrap(),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Signer for ArbiterEvmWallet {
|
|
||||||
async fn sign_hash(&self, _hash: &B256) -> Result<Signature> {
|
|
||||||
Err(EvmWalletError::new(EvmHashSigningUnsupportedError).into())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn address(&self) -> Address {
|
|
||||||
self.address
|
|
||||||
}
|
|
||||||
|
|
||||||
fn chain_id(&self) -> Option<ChainId> {
|
|
||||||
self.chain_id
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_chain_id(&mut self, chain_id: Option<ChainId>) {
|
|
||||||
self.chain_id = chain_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl TxSigner<Signature> for ArbiterEvmWallet {
|
|
||||||
fn address(&self) -> Address {
|
|
||||||
self.address
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn sign_transaction(
|
|
||||||
&self,
|
|
||||||
tx: &mut dyn SignableTransaction<Signature>,
|
|
||||||
) -> Result<Signature> {
|
|
||||||
let _transport = self.transport.lock().await;
|
|
||||||
self.validate_chain_id(tx)
|
|
||||||
.map_err(OneOf::into::<alloy::signers::Error>)?;
|
|
||||||
|
|
||||||
Err(EvmWalletError::new(EvmTransactionSigningUnsupportedError).into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#[cfg(feature = "evm")]
|
|
||||||
pub mod evm;
|
|
||||||
@@ -3,34 +3,19 @@ name = "arbiter-proto"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
repository = "https://git.markettakers.org/MarketTakers/arbiter"
|
repository = "https://git.markettakers.org/MarketTakers/arbiter"
|
||||||
license = "Apache-2.0"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tonic.workspace = true
|
tonic.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
tonic-prost = "0.14.5"
|
tonic-prost = "0.14.3"
|
||||||
prost = "0.14.3"
|
prost = "0.14.3"
|
||||||
kameo.workspace = true
|
kameo.workspace = true
|
||||||
url = "2.5.8"
|
|
||||||
miette.workspace = true
|
|
||||||
thiserror.workspace = true
|
|
||||||
rustls-pki-types.workspace = true
|
|
||||||
base64 = "0.22.1"
|
|
||||||
prost-types.workspace = true
|
|
||||||
tracing.workspace = true
|
|
||||||
async-trait.workspace = true
|
|
||||||
tokio-stream.workspace = true
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tonic-prost-build = "0.14.5"
|
prost-build = "0.14.3"
|
||||||
protoc-bin-vendored = "3"
|
serde_json = "1"
|
||||||
|
tonic-prost-build = "0.14.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
rstest.workspace = true
|
|
||||||
rand.workspace = true
|
|
||||||
rcgen.workspace = true
|
|
||||||
|
|
||||||
[package.metadata.cargo-shear]
|
|
||||||
ignored = ["tonic-prost", "prost", "kameo"]
|
|
||||||
|
|||||||
@@ -1,32 +1,15 @@
|
|||||||
use std::path::PathBuf;
|
|
||||||
use tonic_prost_build::configure;
|
|
||||||
|
|
||||||
static PROTOBUF_DIR: &str = "../../../protobufs";
|
static PROTOBUF_DIR: &str = "../../../protobufs";
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let manifest_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR")?);
|
let proto_files = vec![
|
||||||
let protobuf_dir = manifest_dir.join(PROTOBUF_DIR);
|
format!("{}/arbiter.proto", PROTOBUF_DIR),
|
||||||
let protoc_include = protoc_bin_vendored::include_path()?;
|
format!("{}/auth.proto", PROTOBUF_DIR),
|
||||||
let protoc_path = protoc_bin_vendored::protoc_bin_path()?;
|
];
|
||||||
|
|
||||||
unsafe {
|
// Компилируем protobuf (tonic-prost-build автоматически использует prost_types для google.protobuf)
|
||||||
std::env::set_var("PROTOC", &protoc_path);
|
tonic_prost_build::configure()
|
||||||
std::env::set_var("PROTOC_INCLUDE", &protoc_include);
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("cargo::rerun-if-changed={}", protobuf_dir.display());
|
|
||||||
|
|
||||||
configure()
|
|
||||||
.message_attribute(".", "#[derive(::kameo::Reply)]")
|
.message_attribute(".", "#[derive(::kameo::Reply)]")
|
||||||
.compile_well_known_types(true)
|
.compile_protos(&proto_files, &[PROTOBUF_DIR.to_string()])?;
|
||||||
.compile_protos(
|
|
||||||
&[
|
|
||||||
protobuf_dir.join("arbiter.proto"),
|
|
||||||
protobuf_dir.join("user_agent.proto"),
|
|
||||||
protobuf_dir.join("client.proto"),
|
|
||||||
protobuf_dir.join("evm.proto"),
|
|
||||||
],
|
|
||||||
&[protobuf_dir],
|
|
||||||
)?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,16 @@
|
|||||||
pub mod transport;
|
use crate::proto::auth::AuthChallenge;
|
||||||
pub mod url;
|
|
||||||
|
|
||||||
use base64::{Engine, prelude::BASE64_STANDARD};
|
|
||||||
|
|
||||||
pub mod google {
|
|
||||||
pub mod protobuf {
|
|
||||||
tonic::include_proto!("google.protobuf");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub mod proto {
|
pub mod proto {
|
||||||
tonic::include_proto!("arbiter");
|
tonic::include_proto!("arbiter");
|
||||||
|
|
||||||
pub mod user_agent {
|
pub mod auth {
|
||||||
tonic::include_proto!("arbiter.user_agent");
|
tonic::include_proto!("arbiter.auth");
|
||||||
}
|
|
||||||
|
|
||||||
pub mod client {
|
|
||||||
tonic::include_proto!("arbiter.client");
|
|
||||||
}
|
|
||||||
|
|
||||||
pub mod evm {
|
|
||||||
tonic::include_proto!("arbiter.evm");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static BOOTSTRAP_PATH: &str = "bootstrap_token";
|
pub mod transport;
|
||||||
|
|
||||||
|
pub static BOOTSTRAP_TOKEN_PATH: &str = "bootstrap_token";
|
||||||
|
|
||||||
pub fn home_path() -> Result<std::path::PathBuf, std::io::Error> {
|
pub fn home_path() -> Result<std::path::PathBuf, std::io::Error> {
|
||||||
static ARBITER_HOME: &str = ".arbiter";
|
static ARBITER_HOME: &str = ".arbiter";
|
||||||
@@ -40,7 +25,7 @@ pub fn home_path() -> Result<std::path::PathBuf, std::io::Error> {
|
|||||||
Ok(arbiter_home)
|
Ok(arbiter_home)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn format_challenge(nonce: i32, pubkey: &[u8]) -> Vec<u8> {
|
pub fn format_challenge(challenge: &AuthChallenge) -> Vec<u8> {
|
||||||
let concat_form = format!("{}:{}", nonce, BASE64_STANDARD.encode(pubkey));
|
let concat_form = format!("{}:{}", challenge.nonce, hex::encode(&challenge.pubkey));
|
||||||
concat_form.into_bytes()
|
concat_form.into_bytes().to_vec()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,163 +1,46 @@
|
|||||||
//! Transport-facing abstractions shared by protocol/session code.
|
use futures::{Stream, StreamExt};
|
||||||
//!
|
use tokio::sync::mpsc::{self, error::SendError};
|
||||||
//! This module defines a small set of transport traits that actors and other
|
use tonic::{Status, Streaming};
|
||||||
//! protocol code can depend on without knowing anything about the concrete
|
|
||||||
//! transport underneath.
|
|
||||||
//!
|
|
||||||
//! The abstraction is split into:
|
|
||||||
//! - [`Sender`] for outbound delivery
|
|
||||||
//! - [`Receiver`] for inbound delivery
|
|
||||||
//! - [`Bi`] as the combined duplex form (`Sender + Receiver`)
|
|
||||||
//!
|
|
||||||
//! This split lets code depend only on the half it actually needs. For
|
|
||||||
//! example, some actor/session code only sends out-of-band messages, while
|
|
||||||
//! auth/state-machine code may need full duplex access.
|
|
||||||
//!
|
|
||||||
//! [`Bi`] remains intentionally minimal and transport-agnostic:
|
|
||||||
//! - [`Receiver::recv`] yields inbound messages
|
|
||||||
//! - [`Sender::send`] accepts outbound messages
|
|
||||||
//!
|
|
||||||
//! Transport-specific adapters, including protobuf or gRPC bridges, live in the
|
|
||||||
//! crates that own those boundaries rather than in `arbiter-proto`.
|
|
||||||
//!
|
|
||||||
//! [`Bi`] deliberately does not model request/response correlation. Some
|
|
||||||
//! transports may carry multiplexed request/response traffic, some may emit
|
|
||||||
//! out-of-band messages, and some may be one-message-at-a-time state machines.
|
|
||||||
//! Correlation concerns such as request IDs, pending response maps, and
|
|
||||||
//! out-of-band routing belong in the adapter or connection layer built on top
|
|
||||||
//! of [`Bi`], not in this abstraction itself.
|
|
||||||
//!
|
|
||||||
//! # Generic Ordering Rule
|
|
||||||
//!
|
|
||||||
//! This module consistently uses `Inbound` first and `Outbound` second in
|
|
||||||
//! generic parameter lists.
|
|
||||||
//!
|
|
||||||
//! For [`Receiver`], [`Sender`], and [`Bi`], this means:
|
|
||||||
//! - `Receiver<Inbound>`
|
|
||||||
//! - `Sender<Outbound>`
|
|
||||||
//! - `Bi<Inbound, Outbound>`
|
|
||||||
//!
|
|
||||||
//! Concretely, for [`Bi`]:
|
|
||||||
//! - `recv() -> Option<Inbound>`
|
|
||||||
//! - `send(Outbound)`
|
|
||||||
//!
|
|
||||||
//! [`expect_message`] is a small helper for linear protocol steps: it reads one
|
|
||||||
//! inbound message from a transport and extracts a typed value from it, failing
|
|
||||||
//! if the channel closes or the message shape is not what the caller expected.
|
|
||||||
//!
|
|
||||||
//! [`DummyTransport`] is a no-op implementation useful for tests and local
|
|
||||||
//! actor execution where no real stream exists.
|
|
||||||
//!
|
|
||||||
//! # Design Notes
|
|
||||||
//!
|
|
||||||
//! - [`Bi::send`] returns [`Error`] only for transport delivery failures, such
|
|
||||||
//! as a closed outbound channel.
|
|
||||||
//! - [`Bi::recv`] returns `None` when the underlying transport closes.
|
|
||||||
//! - Message translation is intentionally out of scope for this module.
|
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
use async_trait::async_trait;
|
// Abstraction for stream for sans-io capabilities
|
||||||
|
pub trait Bi<T, U>: Stream<Item = Result<T, Status>> + Send + Sync + 'static {
|
||||||
/// Errors returned by transport adapters implementing [`Bi`].
|
type Error;
|
||||||
#[derive(thiserror::Error, Debug)]
|
fn send(
|
||||||
pub enum Error {
|
&mut self,
|
||||||
#[error("Transport channel is closed")]
|
item: Result<U, Status>,
|
||||||
ChannelClosed,
|
) -> impl std::future::Future<Output = Result<(), Self::Error>> + Send;
|
||||||
#[error("Unexpected message received")]
|
|
||||||
UnexpectedMessage,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Receives one message from `transport` and extracts a value from it using
|
// Bi-directional stream abstraction for handling gRPC streaming requests and responses
|
||||||
/// `extractor`. Returns [`Error::ChannelClosed`] if the transport closes and
|
pub struct BiStream<T, U> {
|
||||||
/// [`Error::UnexpectedMessage`] if `extractor` returns `None`.
|
pub request_stream: Streaming<T>,
|
||||||
pub async fn expect_message<T, Inbound, Outbound, Target, F>(
|
pub response_sender: mpsc::Sender<Result<U, Status>>,
|
||||||
transport: &mut T,
|
}
|
||||||
extractor: F,
|
|
||||||
) -> Result<Target, Error>
|
impl<T, U> Stream for BiStream<T, U>
|
||||||
where
|
where
|
||||||
T: Bi<Inbound, Outbound> + ?Sized,
|
T: Send + 'static,
|
||||||
F: FnOnce(Inbound) -> Option<Target>,
|
U: Send + 'static,
|
||||||
{
|
{
|
||||||
let msg = transport.recv().await.ok_or(Error::ChannelClosed)?;
|
type Item = Result<T, Status>;
|
||||||
extractor(msg).ok_or(Error::UnexpectedMessage)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
fn poll_next(
|
||||||
pub trait Sender<Outbound>: Send + Sync {
|
mut self: std::pin::Pin<&mut Self>,
|
||||||
async fn send(&mut self, item: Outbound) -> Result<(), Error>;
|
cx: &mut std::task::Context<'_>,
|
||||||
}
|
) -> std::task::Poll<Option<Self::Item>> {
|
||||||
|
self.request_stream.poll_next_unpin(cx)
|
||||||
#[async_trait]
|
|
||||||
pub trait Receiver<Inbound>: Send + Sync {
|
|
||||||
async fn recv(&mut self) -> Option<Inbound>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Minimal bidirectional transport abstraction used by protocol code.
|
|
||||||
///
|
|
||||||
/// `Bi<Inbound, Outbound>` is the combined duplex form of [`Sender`] and
|
|
||||||
/// [`Receiver`].
|
|
||||||
///
|
|
||||||
/// It models a channel with:
|
|
||||||
/// - inbound items of type `Inbound` read via [`Bi::recv`]
|
|
||||||
/// - outbound items of type `Outbound` written via [`Bi::send`]
|
|
||||||
///
|
|
||||||
/// It does not imply request/response sequencing, one-at-a-time exchange, or
|
|
||||||
/// any built-in correlation mechanism between inbound and outbound items.
|
|
||||||
pub trait Bi<Inbound, Outbound>: Sender<Outbound> + Receiver<Inbound> + Send + Sync {}
|
|
||||||
|
|
||||||
pub trait SplittableBi<Inbound, Outbound>: Bi<Inbound, Outbound> {
|
|
||||||
type Sender: Sender<Outbound>;
|
|
||||||
type Receiver: Receiver<Inbound>;
|
|
||||||
|
|
||||||
fn split(self) -> (Self::Sender, Self::Receiver);
|
|
||||||
fn from_parts(sender: Self::Sender, receiver: Self::Receiver) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// No-op [`Bi`] transport for tests and manual actor usage.
|
|
||||||
///
|
|
||||||
/// `send` drops all items and succeeds. [`Bi::recv`] never resolves and therefore
|
|
||||||
/// does not busy-wait or spuriously close the stream.
|
|
||||||
pub struct DummyTransport<Inbound, Outbound> {
|
|
||||||
_marker: PhantomData<(Inbound, Outbound)>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<Inbound, Outbound> Default for DummyTransport<Inbound, Outbound> {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
_marker: PhantomData,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
impl<T, U> Bi<T, U> for BiStream<T, U>
|
||||||
impl<Inbound, Outbound> Sender<Outbound> for DummyTransport<Inbound, Outbound>
|
|
||||||
where
|
where
|
||||||
Inbound: Send + Sync + 'static,
|
T: Send + 'static,
|
||||||
Outbound: Send + Sync + 'static,
|
U: Send + 'static,
|
||||||
{
|
{
|
||||||
async fn send(&mut self, _item: Outbound) -> Result<(), Error> {
|
type Error = SendError<Result<U, Status>>;
|
||||||
Ok(())
|
|
||||||
|
async fn send(&mut self, item: Result<U, Status>) -> Result<(), Self::Error> {
|
||||||
|
self.response_sender.send(item).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl<Inbound, Outbound> Receiver<Inbound> for DummyTransport<Inbound, Outbound>
|
|
||||||
where
|
|
||||||
Inbound: Send + Sync + 'static,
|
|
||||||
Outbound: Send + Sync + 'static,
|
|
||||||
{
|
|
||||||
async fn recv(&mut self) -> Option<Inbound> {
|
|
||||||
std::future::pending::<()>().await;
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<Inbound, Outbound> Bi<Inbound, Outbound> for DummyTransport<Inbound, Outbound>
|
|
||||||
where
|
|
||||||
Inbound: Send + Sync + 'static,
|
|
||||||
Outbound: Send + Sync + 'static,
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
pub mod grpc;
|
|
||||||
|
|||||||