Skip to content

feat: Rust SDK update for version 0.3.0#12

Merged
abnegate merged 1 commit intomainfrom
dev
Apr 16, 2026
Merged

feat: Rust SDK update for version 0.3.0#12
abnegate merged 1 commit intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Apr 15, 2026

This PR contains updates to the Rust SDK for version 0.3.0.

What's Changed

  • [BREAKING] Renamed Webhook model fields: securitytls, httpUserauthUsername, httpPassauthPassword, signatureKeysecret
  • [BREAKING] Renamed Webhook service parameters to match: securitytls, httpUserauthUsername, httpPassauthPassword
  • [BREAKING] Renamed Webhooks::update_signature() to Webhooks::update_secret() with new optional secret parameter
  • Added Client::get_headers() method to retrieve request headers
  • Added secret parameter to Webhook create and update methods
  • Added x OAuth provider to OAuthProvider enum
  • Added userType field to Log model
  • Added purge parameter to update_collection and update_table for cache invalidation
  • Added Project service: platform CRUD, key CRUD, protocol/service status management
  • Added new models: Key, KeyList, Project, DevKey, MockNumber, AuthProvider, PlatformAndroid, PlatformApple, PlatformLinux, PlatformList, PlatformWeb, PlatformWindows, BillingLimits, Block
  • Added new enums: PlatformType, ProtocolId, ServiceId
  • Updated BuildRuntime, Runtime enums with dart-3.11 and flutter-3.41
  • Updated Scopes enum with keysRead, keysWrite, platformsRead, platformsWrite
  • Updated X-Appwrite-Response-Format header to 1.9.1
  • Updated TTL description for list caching in Databases and TablesDB
  • Updated Cargo.toml dependencies with pinned versions and added security-framework for Apple platforms

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 15, 2026

Greptile Summary

This 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 (ProtocolId, ServiceId, PlatformType), new OAuth provider X, new runtimes (dart-3.11, flutter-3.41), and a get_headers() helper on Client used by the integration test harness.

Confidence Score: 5/5

Safe 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

Filename Overview
src/services/project.rs New project service with 21 new methods; get_platform returns untyped serde_json::Value while all create/update platform endpoints return specific typed models
src/models/key.rs New Key model; expire field typed as non-optional String despite being an optional field at creation time, which may fail deserialization when server returns null
src/models/dev_key.rs New DevKey model; same expire nullability concern as Key model
Cargo.toml Dependency updates; some unusual version requirement syntax (>=a, <b range style, exact pins =x.y.z); indexmap still present but unused (previously flagged)
src/models/project.rs New Project model; platforms field typed as Vec<serde_json::Value> (previously flagged); large struct with many fields, otherwise well-structured
src/models/platform_list.rs New PlatformList model; platforms field typed as Vec<serde_json::Value> (same untyped concern as Project.platforms, previously flagged)
src/client.rs Version bump to 0.3.0 and new get_headers() method added for test support; implementation is correct
src/services/webhooks.rs Renamed update_signature to update_secret; implementation looks correct
src/enums/platform_type.rs New PlatformType enum with all 5 platform variants; well-structured
tests/tests.rs Integration test updated to call get_headers() and print SDK headers; index-based HashMap access can panic on missing keys (previously flagged)

Reviews (2): Last reviewed commit: "chore: update Rust SDK to 0.3.0" | Re-trigger Greptile

Comment thread Cargo.toml
[dependencies]
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0"
serde_json = "1.0.149"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unused dependency added

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.

Suggested change
serde_json = "1.0.149"

(Remove the indexmap = ">=2, <2.12" line entirely.)

Comment thread tests/tests.rs
Comment on lines +17 to +22
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"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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)"),
);

Comment thread src/models/project.rs
pub auth_email_password: bool,
/// Magic URL auth method status
#[serde(rename = "authUsersAuthMagicURL")]
pub auth_users_auth_magic_url: bool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@ChiragAgg5k ChiragAgg5k changed the title feat: Rust SDK update for version 0.3.0 feat: SDK update for version 0.3.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 0.3.0 feat: Rust SDK update for version 0.3.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Rust SDK update for version 0.3.0 feat: SDK update for version 0.3.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 0.3.0 feat: Rust SDK update for version 0.3.0 Apr 15, 2026
@abnegate abnegate merged commit 6895664 into main Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants