mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
7.4 KiB
7.4 KiB
Implementation Status
Update this file before each feature commit.
| Area | Status | Commit | Verification | Notes |
|---|---|---|---|---|
| Scaffold | Completed | fc47967 |
cargo fmt --check; cargo test; cargo clippy --all-targets --all-features --locked -- -D warnings |
Rust crate, lint policy, pinned TLS-sensitive dependencies, .gitignore, and minimal entry points are in place. |
| API contract docs | Completed | fc47967 |
cargo fmt --check; cargo test; cargo clippy --all-targets --all-features --locked -- -D warnings |
/v1/* OpenAI-compatible body, /admin/* frontend envelope, body codes, camelCase, and request ID policy are documented. |
| Configuration | Completed | 9ed8579 + e0680bf |
cargo test default_config_keeps_only_codex_backend; cargo test config_loader_merges_default_local_and_cprs_env_overrides; full fmt/test/clippy before commit |
Defines Codex-only config, default/local/env loading, default YAML, and Arc<AppServices> state shell. |
| SQLite storage | Completed | ffec8b5 + b0c10f2 |
cargo test sqlite_schema_creates_accounts_and_event_tables; cargo test connect_sqlite_creates_parent_directory_for_file_database; full fmt/test/clippy before commit |
Creates SQLite WAL connector, parent directory bootstrap, sqlx-managed schema for accounts/API keys/sessions/cookies/fingerprints/events, and event/account indexes. |
| Admin auth and client API keys | Completed | 24d5799 + 4e0d1e5 |
cargo test client_api_key_has_proxy_prefix_and_verifies_against_hash; cargo test admin_password_hash_is_not_a_client_api_key; cargo test --test admin_login_route_test; full fmt/test/clippy before commit |
Admin passwords use Argon2id, client API keys use cpr_ prefix plus HMAC-SHA256 with server-side pepper; /admin/login issues HttpOnly sessions and rejects client API keys as admin credentials. |
| Secret encryption | Completed | 105aa58 |
cargo test secret_box_encrypts_and_decrypts_without_storing_plaintext; full fmt/test/clippy before commit |
AES-256-GCM SecretBox stores upstream secrets as v1:<nonce>:<ciphertext> without plaintext. |
| Logging and pagination | Completed | eb0341e + fc16c48 + b0c10f2 |
cargo test event_logs_are_cursor_paginated; cargo test admin_logs_are_cursor_paginated_and_include_request_id; cargo test rotating_writer_splits_files_when_size_limit_is_reached; full fmt/test/clippy before commit |
Adds cursor pagination, Page<T> camelCase serialization, admin /admin/logs query API, event log repository, runtime tracing initialization, HTTP trace layer, and date/size-based file rotation. |
| TLS headers and fingerprint | Completed | 1bdd08c |
cargo test codex_headers_include_desktop_identity_and_turn_state; cargo tree | rg 'reqwest|rustls'; full fmt/test/clippy before commit |
Adds Codex Desktop fingerprint model, exact identity/request headers, and pinned reqwest/rustls client builder. |
| Cookie persistence | Completed | 4710926 + 5d3cc6e |
cargo test cookie_jar_captures_and_replays_account_scoped_cookies; cargo test cookie_repository_encrypts_and_replays_account_scoped_cookies; full fmt/test/clippy before commit |
Adds account-scoped in-memory Cookie jar and encrypted SQLite Cookie repository; Cookies are replayed only for the same account/domain. |
| Account pool and refresh | Partial | 0f97c5c + 2f25db8 |
cargo test account_pool_skips_expired_disabled_banned_and_quota_exhausted_accounts; cargo test --test account_refresh_test; full fmt/test/clippy before commit |
Implemented base account status filtering and refresh scheduler semantics. Still missing original scheduling parity: max concurrent slots, stale slot cleanup, rotation strategies, tier priority, quota-cache filtering, Cloudflare cooldown, request staggering, session affinity, pool integration with the SQLite repository, and admin account CRUD. |
| Account repository | Completed | 14fe706 |
cargo test --test account_repository_test; cargo fmt --check; cargo clippy --all-targets --all-features --locked -- -D warnings; cargo test |
Adds encrypted SQLite account token storage, decrypting reads, cursor pagination, status/label updates, release-time usage counter persistence, and refresh-token-preserving token updates. |
| Translation | Completed | eff182e |
cargo test chat_completion_translates_to_codex_response_request; full fmt/test/clippy before commit |
Adds OpenAI Chat request types, Codex Responses request type, translation, and OpenAI-compatible error body helper. |
| HTTP routes | Partial | ab0ad8f + 3830b21 |
cargo test v1_requires_client_api_key_not_admin_cookie; cargo test models_route_returns_openai_compatible_codex_model_list; full fmt/test/clippy before commit |
Adds Axum router, health route, /v1/models, /v1 unauthorized OpenAI error body, global request-id response header, and binary listener. Still missing admin auth middleware extraction, account/auth/API-key management routes, settings routes, diagnostics, usage stats, model catalog/detail/refresh routes, and additional Responses routes. |
| Admin/frontend response contract | Completed | 1c34ea7 + b0c10f2 |
cargo test admin_envelope_serializes_lower_camel_case_request_id; cargo test admin_logs_reject_missing_admin_session_cookie; cargo test v1_response_has_request_id_header_without_admin_body_field; full fmt/test/clippy before commit |
Adds reusable admin envelopes with body codes, lower camelCase JSON, paginated list shape, requestId bodies, admin session cookie enforcement, and keeps /v1/* OpenAI-compatible. |
| HTTP auth boundary | Completed | pending | cargo test --test http_auth_test; cargo test --test routes_responses_test; cargo test --test admin_logs_route_test; full fmt/test/clippy before commit |
Adds a real src/http/auth.rs boundary for client API key and admin session cookie parsing. /v1/* accepts only Bearer cpr_..., admin session parsing ignores client API keys, and route handlers no longer own ad hoc credential parsing. |
| Upstream lifecycle | Partial | 88cad87 + 225fbff |
cargo test responses_route_rejects_non_codex_provider_models; cargo test v1_requires_client_api_key_not_admin_cookie; cargo test --test codex_sse_usage_test; full fmt/test/clippy before commit |
/v1 currently enforces client API key shape, rejects non-Codex provider models, returns OpenAI-compatible errors, and includes reusable SSE/usage helpers. It does not yet acquire accounts, forward to Codex, replay/capture Cookies, stream/collect upstream responses, capture rate-limit headers, retry across accounts, record usage, or preserve previous-response/session affinity. |
| Fingerprint updates | Partial | dd26d31 + e32220a |
cargo test update_manifest_updates_app_version_and_build_number; cargo test fingerprint_updater_fetches_manifest_and_persists_history; full fmt/test/clippy before commit |
Parses a JSON update manifest and persists app version/build number history to SQLite. Still missing original appcast XML polling, update-state persistence, runtime header fingerprint selection from the latest stored fingerprint, and optional local Codex.app Chromium extraction. |
| Runtime docs and packaging | Completed | 33b63f3 |
cargo fmt --check; cargo clippy --all-targets --all-features --locked -- -D warnings; cargo test; cargo run; curl -s -i http://127.0.0.1:8080/health |
README scope, .env.example, Dockerfile, compose file, and health smoke test are complete. |