feat: deliver production-ready Rust SDK with public testnet sn-api E2E CI#1
feat: deliver production-ready Rust SDK with public testnet sn-api E2E CI#1mateeullahmalik wants to merge 5 commits intomainfrom
Conversation
Reviewed 1e5c02e (clippy dead-code and deprecation fixes in
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
ba24755 to
fc84766
Compare
| @@ -20,7 +21,8 @@ serde = { version = "1", features = ["derive"] } | |||
| serde_json = "1" | |||
| thiserror = "2" | |||
| rand = "0.8" | |||
| reqwest = { version = "0.12", features = ["json", "multipart", "stream", "rustls-tls"] } | |||
| ripemd = "0.1" | |||
| reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "stream", "rustls-tls"] } | |||
| tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "fs"] } | |||
| tempfile = "3" | |||
| prost = "0.13" | |||
| @@ -33,7 +35,10 @@ hex = "0.4" | |||
| bip39 = "2" | |||
| bip32 = "0.5" | |||
| chrono = { version = "0.4", default-features = false, features = ["clock"] } | |||
| dotenvy = "0.15" | |||
| toml = "0.8" | |||
| rq-library = { git = "https://github.com/LumeraProtocol/rq-library.git" } | |||
| tower-http = { version = "0.6", features = ["fs"] } | |||
There was a problem hiding this comment.
axum, ripemd, and tower-http are only used by examples/ui_server.rs, but they're listed under [dependencies] instead of [dev-dependencies]. Cargo examples can use dev-dependencies, so placing them here means every downstream consumer of lumera-sdk-rs transitively pulls in axum, tower-http, and their dependency trees (hyper, multer, mime, etc.) even though they never use them. Move these three to [dev-dependencies] to keep the library's dependency footprint clean.
Fix it with Roo Code or mention @roomote and request a fix.
| let sig = B64.decode(body.signature.trim()).map_err(|e| ApiError { | ||
| error: format!("invalid signature base64: {e}"), | ||
| })?; | ||
| if sig.len() < 64 { | ||
| return Err(ApiError { | ||
| error: "invalid signature length".into(), | ||
| }); | ||
| } | ||
|
|
||
| if challenge.message.is_empty() { | ||
| return Err(ApiError { | ||
| error: "invalid challenge message".into(), | ||
| }); | ||
| } |
There was a problem hiding this comment.
auth_verify decodes the signature bytes and checks sig.len() < 64, but never actually verifies the signature cryptographically against the challenge message and public key. After this check the function unconditionally issues a session token. This means any caller who knows a valid lumera address and its public key can authenticate by submitting an arbitrary 64+ byte blob as the signature, bypassing the entire challenge-response scheme. The signature should be verified using k256::ecdsa::VerifyingKey (or equivalent) against the Cosmos ADR-036 sign-bytes derived from challenge.message before issuing a token.
Fix it with Roo Code or mention @roomote and request a fix.
| let rest = std::env::var("LUMERA_REST").unwrap_or_else(|_| "http://127.0.0.1:1317".into()); | ||
| let rpc = std::env::var("LUMERA_RPC").unwrap_or_else(|_| "http://127.0.0.1:26657".into()); | ||
| let grpc = std::env::var("LUMERA_GRPC").unwrap_or_else(|_| "http://127.0.0.1:9090".into()); | ||
| let snapi = std::env::var("SNAPI_BASE").unwrap_or_else(|_| "http://127.0.0.1:8089".into()); |
There was a problem hiding this comment.
The default SNAPI_BASE here is port 8089, but the canonical default everywhere else in the codebase is 8080 (src/config.rs SdkSettings::default(), examples/golden_devnet.rs, scripts/run_golden_local.sh, .github/scripts/e2e_pr.sh). This is the same class of inconsistency that was previously flagged and fixed in golden_devnet.rs. Running the UI server without setting SNAPI_BASE will silently connect to the wrong port.
| let snapi = std::env::var("SNAPI_BASE").unwrap_or_else(|_| "http://127.0.0.1:8089".into()); | |
| let snapi = std::env::var("SNAPI_BASE").unwrap_or_else(|_| "http://127.0.0.1:8080".into()); |
Fix it with Roo Code or mention @roomote and request a fix.
What users can do with this SDK
lumera-sdk-rsnow enables Rust apps/services to run the full Cascade workflow against Lumera:Configure once, run anywhere
.env, TOML, or JSON (SdkSettings)Query chain state needed for uploads
Register Cascade actions on-chain
MsgRequestActionaction_idfrom tx resultUpload via public/private sn-api
Download + verify integrity
Run end-to-end examples immediately
examples/custom_config.rsexamples/from_env_settings.rsexamples/golden_devnet.rs(register -> upload -> download -> hash)Facilities / features added in this PR
SDK surface
CascadeSdkhigh-level orchestration layerChainClientfor action params/fees + tx registration pathSnApiClientfor upload/download task operationsSdkSettings -> CascadeConfigConfiguration & integration
env,.env,toml,json)Developer experience
build,test,fmt-check,lint,doc,check,golden,e2e-prexamples/README.mdCI / quality gates
Robustness fixes included
SNAPI_BASEport across code/docs/examplesValidation status
cargo test --workspace --all-features --all-targets✅./.github/scripts/e2e_public_pr.shsmoke mode ✅