Skip to content

feat: Ruby SDK update for version 25.1.0#66

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

feat: Ruby SDK update for version 25.1.0#66
abnegate merged 1 commit into
mainfrom
dev

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

This PR contains updates to the Ruby SDK for version 25.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 Ruby SDK to version 25.1.0, adding new API surface (SES messaging provider, OAuth2 server configuration, password strength policy, audits DB health check, and new enum values) and carrying a meaningful internal refactor of how the X-Appwrite-Project header is delivered to the server.

  • Header delivery change: set_project no longer calls add_header; instead, all 22+ service files are updated to read the project ID via @client.get_config('project') per request. A new get_config accessor and @config hash are added to Client.
  • URL separator bug fix: client.rb now correctly uses & instead of ? when the path already contains a query string, preventing malformed URLs for paths with existing parameters.
  • New features: create_ses_provider/update_ses_provider in messaging, update_o_auth2_server and update_password_strength_policy in project, get_audits_db in health, PolicyPasswordStrength model, PASSWORD_STRENGTH policy ID, and APPS_READ/APPS_WRITE key scopes.

Confidence Score: 4/5

Safe to merge; new features follow established patterns and the header refactor is correctly propagated across all service files.

The set_project method now only stores in @config while every other setter still also calls add_header, creating an observable asymmetry: callers who use client.get_headers for inspection or testing will no longer see the project ID there. The require ordering of the new model in lib/appwrite.rb is also slightly out of alphabetical sequence. Neither issue affects runtime behavior given the full service-level update, but they are worth tidying.

lib/appwrite/client.rb (set_project behavioral change) and lib/appwrite.rb (require ordering)

Important Files Changed

Filename Overview
lib/appwrite/client.rb Version bumped to 25.1.0; set_project now stores only in @config (no longer calls add_header); @config hash added to constructor; URL separator bug fixed to use & when path already contains ?; get_config accessor added.
lib/appwrite.rb Added require for the new policy_password_strength model, but placed out of alphabetical order (before policy_password_personal_data instead of after).
lib/appwrite/services/project.rb Added update_o_auth2_server and update_password_strength_policy; all service methods updated to explicitly set X-Appwrite-Project header via get_config('project').
lib/appwrite/services/messaging.rb Added create_ses_provider and update_ses_provider for Amazon SES email provider support, following the same pattern as the existing Mailgun/Sendgrid/Resend providers.
lib/appwrite/services/health.rb Added get_audits_db endpoint at /health/audits-db, returning HealthStatusList. Follows the same pattern as other health check methods.
lib/appwrite/models/project.rb Added nine new OAuth2 server fields (oAuth2Server*) and moved region to an earlier position; from/to_map updated consistently.
lib/appwrite/models/policy_password_strength.rb New model for password strength policy; follows existing model conventions with from/to_map methods and matching field names for the API schema.
lib/appwrite/enums/project_key_scopes.rb Added APPS_READ and APPS_WRITE enum values, inserted between EVENTS_READ and USAGE_READ.
lib/appwrite/enums/project_policy_id.rb Added PASSWORD_STRENGTH = 'password-strength' enum value.
lib/appwrite/services/account.rb All service methods updated to explicitly include X-Appwrite-Project header via get_config('project'); minor doc fix for update_password param description.

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

Comment thread lib/appwrite/client.rb
Comment on lines 32 to 36
def set_project(value)
add_header('x-appwrite-project', value)
@config['project'] = value

self
end

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 Asymmetry between set_project and all other setters

Every other setter (set_key, set_jwt, set_locale, set_session, etc.) still calls add_header in addition to storing in @config, meaning those values are automatically present in every request via the default @headers. set_project now only stores in @config, so the X-Appwrite-Project header is absent from @headers and only appears in requests when a service method explicitly calls @client.get_config('project'). Any caller that uses client.get_headers (e.g., for debugging or testing) will no longer see the project ID there, and any call path that bypasses service-level api_headers would silently omit the project header.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread lib/appwrite.rb
Comment on lines 188 to 190
require_relative 'appwrite/models/policy_password_history'
require_relative 'appwrite/models/policy_password_strength'
require_relative 'appwrite/models/policy_password_personal_data'

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 The new policy_password_strength require is inserted out of alphabetical order — personal_data (p) should precede strength (s). While Ruby's require order doesn't affect correctness here, the existing file follows strict alphabetical ordering for requires and this breaks that convention.

Suggested change
require_relative 'appwrite/models/policy_password_history'
require_relative 'appwrite/models/policy_password_strength'
require_relative 'appwrite/models/policy_password_personal_data'
require_relative 'appwrite/models/policy_password_history'
require_relative 'appwrite/models/policy_password_personal_data'
require_relative 'appwrite/models/policy_password_strength'

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@abnegate abnegate merged commit d77f3a2 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