Skip to content

feat: Swift SDK update for version 19.1.0#67

Merged
abnegate merged 1 commit into
mainfrom
dev
Jun 5, 2026
Merged

feat: Swift SDK update for version 19.1.0#67
abnegate merged 1 commit into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Jun 5, 2026

Copy link
Copy Markdown
Member

This PR contains updates to the Swift SDK for version 19.1.0.

What's Changed

  • Added: createSesProvider and updateSesProvider to messaging
  • Added: updateOAuth2Server to project for OAuth2 server settings
  • Added: updatePasswordStrengthPolicy and PolicyPasswordStrength to project
  • Added: getAuditsDB health check to health
  • Added: password-strength to ProjectPolicyId
  • Added: apps.read and apps.write to ProjectKeyScopes

@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Swift SDK to version 19.1.0, adding new API features and fixing a header injection issue in the client. The core architectural change moves X-Appwrite-Project from a global header (set once via addHeader in setProject()) to a per-request header injected explicitly in every service method's apiHeaders dictionary.

  • New APIs: Messaging.createSesProvider / updateSesProvider, Project.updateOAuth2Server, Project.updatePasswordStrengthPolicy, Health.getAuditsDB; new PolicyPasswordStrength model; apps.read, apps.write scopes; password-strength policy ID; 9 OAuth2 server fields on the Project model.
  • Client fix: parametersToQueryString now checks whether the path already contains a ? before appending query parameters, preventing malformed URLs like /path?foo=1?bar=2.
  • Docs: update-password.md placeholder updated; 4 new example files added.

Confidence Score: 4/5

Safe to merge; the header refactoring is broad but consistent across all service files, and the URL fix is clearly correct.

The main architectural change — moving X-Appwrite-Project out of setProject()'s global addHeader and into each service call's explicit headers — is correctly applied across every service method in the diff. Other credential setters (setKey, setJWT, setLocale, setSession) still use addHeader, leaving a small inconsistency in the client API surface that is worth being aware of but does not affect runtime correctness.

Sources/Appwrite/Client.swift deserves a second look due to the project-header architecture change.

Important Files Changed

Filename Overview
Sources/Appwrite/Client.swift Version bumped to 19.1.0; X-Appwrite-Project removed from setProject() global addHeader and now injected per-call in each service; URL query-string fix to avoid double-? when path already contains query params
Sources/AppwriteModels/Project.swift Added 9 new OAuth2 server fields; region moved earlier in struct; billingLimits pre-existing forced-cast in from(map:) unchanged
Sources/AppwriteModels/PolicyPasswordStrength.swift New model for password-strength policy with id, min, uppercase, lowercase, number, symbols fields; follows same pattern as other policy models
Sources/Appwrite/Services/Messaging.swift Added createSesProvider and updateSesProvider methods; X-Appwrite-Project header added to all existing method calls
Sources/Appwrite/Services/Project.swift Added updateOAuth2Server and updatePasswordStrengthPolicy methods; password-strength case added to policy dispatch; X-Appwrite-Project header added to all calls
Sources/Appwrite/Services/Health.swift Added getAuditsDB() method returning HealthStatusList; follows same pattern as existing health check methods
Sources/AppwriteEnums/ProjectKeyScopes.swift Added apps.read and apps.write enum cases before usageRead, consistent with existing naming convention
Sources/AppwriteEnums/ProjectPolicyId.swift Added passwordStrength case between passwordHistory and passwordPersonalData

Reviews (1): Last reviewed commit: "chore: update Swift SDK to 19.1.0" | Re-trigger Greptile

Comment on lines 102 to 105
open func setProject(_ value: String) -> Client {
config["project"] = value
_ = addHeader(key: "X-Appwrite-Project", value: value)
return self
}

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 Inconsistency between setProject and other credential setters

setKey, setJWT, setLocale, and setSession still call addHeader to inject their values as global headers on every request, but setProject no longer does — it only stores the value in config. The project ID is now injected per-call at the service layer. Any caller that uses client.call(...) directly (bypassing the service classes), or any future service method that forgets to include "X-Appwrite-Project", will silently omit the header.

@abnegate abnegate merged commit 393b641 into main Jun 5, 2026
2 checks passed
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