Repository navigation
V2 - #1
Merged
Merged
V2#1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
V2 - Axum tickets API + full project analysis & documentation
Summary
This PR brings the
v2branch up againstmain: a full Axum + SQLx implementation of the tickets API plus a comprehensive project analysis consolidated intoREADME.mdand a structureddocs/directory.It spans the complete v2 codebase (auth, crypt, RPC layer, model/service/store, Docker, CI) and a multi-specialist review (architecture, security, deployment, ops) with ADRs and a prioritized issue roadmap.
What's in this PR
Application code (
tickets_api/src/)controller → service → model/storewith Axum State-based DI.b64u(ident).b64u(exp).sign_b64u),mw_ctx_resolvermiddleware,CTXextractor, login/logoff handlers.#01#prefix) + token signing, per-row UUID salts.POST /api/rpcdispatchingcreate_task/list_tasks/update_task/delete_taskviasqlbruntime SQL builder over PostgreSQL.base::dbDbBmctrait + typedget/list/create/update/deleteoversqlb.OnceLock<Config>env-driven singleton (SERVICE_*).Errorenum →IntoResponse(500 + extension) →main_response_mapper→ client JSON{"error":{"type","req_uuid"}}._dev_utils::init_dev()(DB recreate + seed), SQL scripts undersql/dev_initial/.Dockerfile,docker-compose.yaml(api + postgres)..github/workflows/docker-publish.yml(Buildx → ghcr.io → cosign signing).Documentation (
README.md+docs/) — added in this PRA full project analysis consolidated into 18 files:
README.mddocs/overview.mddocs/architecture.mddocs/api-reference.mddocs/module-map.mddocs/data-models.mddocs/auth-flow.mddocs/security-review.mddocs/deployment-operations.mddocs/issue-roadmap.mddocs/adr/🔴 Known blockers
The review found 6 P0 issues — the API cannot currently run end-to-end:
/api/rpcreturns 403middleware/auth.rs:38-44todo!()→POST /api/loginpanicscrypt/token.rs:17-19postgres://postgres:welcome@db,DROP DATABASE,.unwrap()server.rs:16,_dev_utils/dev_db.rs:14-15user.usernamevsUser.name; tabletaskvsTaskService.TABLE="tasks"01-create-schema.sqlvsservice/user.rs,service/task.rsrpc/task/mod.rs,rpc/mod.rsSecure/SameSite→ CSRF exposurecontroller/login.rs:21-23Full details and fix sketches:
docs/security-review.md·docs/auth-flow.md·docs/issue-roadmap.md.Security posture
.cargo/config.toml(decode to ASCIIdev_only_pwd_key/dev_only_token_key).ctxis ignored bybase::db→ IDOR.sqlbis parameterized.OWASP 2021: A03 ✅ · A09 Partial · A01/A02/A04/A05/A07/A08 ❌
Deployment readiness
Verdict: 0/10 — the container panic-crashes before binding port 8080.
Two independent startup panic conditions:
_dev_utils::init_dev()→ hardcodeddbhostname doesn't resolve (compose service isdb_test).ModelManager::new()→config()→ missingSERVICE_DB_URL(compose doesn't inject it;.cargo/config.toml[env]doesn't apply to the bare binary).Hardened
Dockerfile,docker-compose.yaml,.envtemplate, aci.ymlquality workflow, and 7 source fixes are provided indocs/deployment-operations.md.Test plan
_generate_token+validate_pwdbug + feature-gate_dev_utils+ schema alignment (seedocs/issue-roadmap.md).cargo fmt --checkcargo clippy --all-targets -- -D warnings -W clippy::unwrap_usedcargo test --all-features(requires live PostgreSQL)cargo audit(no supply-chain gate in CI today)cargo build --release --locked(after committingCargo.lock)docker compose build && docker compose up→ healthcheck passes on/healthPOST /api/login→ 200 +auth-tokencookie;POST /api/rpcwithcreate_task→ 200.Scope note
This PR contains:
v2feature work (auth, crypt, RPC, model/store, Docker, CI) — ~93 of the 110 commits, pre-existing.:memo:prefixed) — added via a multi-specialist review and consolidated here.The analysis documents the codebase as-is, including the blockers above. No source fixes are applied in this PR — fixes are sequenced in the issue roadmap (P0 → P1 → P2 → P3).