Conversation
Greptile SummaryThis PR updates the Rust SDK to version 0.3.0, targeting Appwrite API 1.9.1. It adds 21 new project management endpoints (keys, platforms, protocols, services), 11 new model types, 2 new enums ( Confidence Score: 5/5Safe to merge; all remaining findings are P2 style and best-practice suggestions with no blocking correctness issues. All open comments are P2: the expire nullability concern is worth fixing but speculative without confirmed API null responses, get_platform's untyped return is a consistency nit, and Cargo version syntax is a style preference. No P0/P1 defects introduced. src/models/key.rs and src/models/dev_key.rs (expire nullability); src/services/project.rs (get_platform return type) Important Files Changed
Reviews (2): Last reviewed commit: "chore: update Rust SDK to 0.3.0" | Re-trigger Greptile |
| [dependencies] | ||
| serde = { version = "1.0.228", features = ["derive"] } | ||
| serde_json = "1.0" | ||
| serde_json = "1.0.149" |
There was a problem hiding this comment.
indexmap is declared as a dependency but is not imported or used anywhere in the source tree (src/). This adds unnecessary compile time and bloat to the dependency graph. If it's intended for a future change, it should be added in the same PR that uses it.
| serde_json = "1.0.149" |
(Remove the indexmap = ">=2, <2.12" line entirely.)
| let sdk_headers = client.get_headers(); | ||
| println!( | ||
| "x-sdk-name: {}; x-sdk-platform: {}; x-sdk-language: {}; x-sdk-version: {}", | ||
| sdk_headers["x-sdk-name"], | ||
| sdk_headers["x-sdk-platform"], | ||
| sdk_headers["x-sdk-language"], |
There was a problem hiding this comment.
HashMap index access can panic
Indexing sdk_headers["x-sdk-name"] will panic if the key is absent, giving an unhelpful test failure message. Prefer .get() with a fallback or an assertion so a missing key fails cleanly.
| let sdk_headers = client.get_headers(); | |
| println!( | |
| "x-sdk-name: {}; x-sdk-platform: {}; x-sdk-language: {}; x-sdk-version: {}", | |
| sdk_headers["x-sdk-name"], | |
| sdk_headers["x-sdk-platform"], | |
| sdk_headers["x-sdk-language"], | |
| println!( | |
| "x-sdk-name: {}; x-sdk-platform: {}; x-sdk-language: {}; x-sdk-version: {}", | |
| sdk_headers.get("x-sdk-name").map(String::as_str).unwrap_or("(missing)"), | |
| sdk_headers.get("x-sdk-platform").map(String::as_str).unwrap_or("(missing)"), | |
| sdk_headers.get("x-sdk-language").map(String::as_str).unwrap_or("(missing)"), | |
| sdk_headers.get("x-sdk-version").map(String::as_str).unwrap_or("(missing)"), | |
| ); |
| pub auth_email_password: bool, | ||
| /// Magic URL auth method status | ||
| #[serde(rename = "authUsersAuthMagicURL")] | ||
| pub auth_users_auth_magic_url: bool, |
There was a problem hiding this comment.
platforms typed as untyped JSON value
platforms: Vec<serde_json::Value> loses all type safety. The SDK already defines typed platform models (PlatformAndroid, PlatformApple, PlatformLinux, PlatformWeb, PlatformWindows). Consider using a tagged enum or a dedicated polymorphic type so callers can pattern-match on the platform variant rather than having to navigate raw JSON. PlatformList has the same issue on its platforms field.
This PR contains updates to the Rust SDK for version 0.3.0.
What's Changed
security→tls,httpUser→authUsername,httpPass→authPassword,signatureKey→secretsecurity→tls,httpUser→authUsername,httpPass→authPasswordWebhooks::update_signature()toWebhooks::update_secret()with new optionalsecretparameterClient::get_headers()method to retrieve request headerssecretparameter to Webhook create and update methodsxOAuth provider toOAuthProviderenumuserTypefield toLogmodelpurgeparameter toupdate_collectionandupdate_tablefor cache invalidationKey,KeyList,Project,DevKey,MockNumber,AuthProvider,PlatformAndroid,PlatformApple,PlatformLinux,PlatformList,PlatformWeb,PlatformWindows,BillingLimits,BlockPlatformType,ProtocolId,ServiceIdBuildRuntime,Runtimeenums withdart-3.11andflutter-3.41Scopesenum withkeysRead,keysWrite,platformsRead,platformsWriteX-Appwrite-Response-Formatheader to1.9.1Cargo.tomldependencies with pinned versions and addedsecurity-frameworkfor Apple platforms