From 634053be21e9a70dec0804f5a2f4ba7200f08ede Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 6 Oct 2026 15:54:07 +0100 Subject: [PATCH] feat: SDK update for version 28.1.0 Adds the optional state parameter to createOAuth2Token (appwrite/appwrite#14157). --- CHANGELOG.md | 4 ++++ appwrite.gemspec | 2 +- docs/examples/account/create-o-auth-2-token.md | 3 ++- lib/appwrite/client.rb | 2 +- lib/appwrite/services/account.rb | 5 ++++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a2ae6ad..11edfbb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 28.1.0 + +* Added: optional `state` parameter on `createOAuth2Token`, returned unchanged on the success and failure URLs + ## 28.0.0 * Stable release of the dedicated database APIs: `mysql`, `postgresql`, `mongo`, `documentsDB`, and `vectorsDB` services, previously released as release candidates diff --git a/appwrite.gemspec b/appwrite.gemspec index a453cd63..f207b599 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '28.0.0' + spec.version = '28.1.0' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 4dbba2f0..58f03b82 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -15,6 +15,7 @@ result = account.create_o_auth2_token( provider: OAuthProvider::AMAZON, success: 'https://example.com', # optional failure: 'https://example.com', # optional - scopes: [] # optional + scopes: [], # optional + state: '' # optional ) ``` diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index b93d1028..c6fbe433 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -14,7 +14,7 @@ def initialize 'x-sdk-name' => 'Ruby', 'x-sdk-platform' => 'server', 'x-sdk-language' => 'ruby', - 'x-sdk-version' => '28.0.0', + 'x-sdk-version' => '28.1.0', 'X-Appwrite-Response-Format' => '2.0.0' } @endpoint = 'https://cloud.appwrite.io/v1' diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index ab71eebf..4d8bceb9 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -1554,13 +1554,15 @@ def create_magic_url_token( # @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. + # @param [String] state An opaque value your app generates and keeps, for example in a cookie. It is returned unchanged as the `state` query parameter on the success and failure URLs, so your app can check that the sign-in it receives is one it started. Printable ASCII only (RFC 6749 Appendix A.5). Max length: 256 chars. # # @return [] def create_o_auth2_token( provider:, success: nil, failure: nil, - scopes: nil + scopes: nil, + state: nil ) api_path = '/account/tokens/oauth2/{provider}' .gsub('{provider}', provider) @@ -1573,6 +1575,7 @@ def create_o_auth2_token( success: success, failure: failure, scopes: scopes, + state: state, } api_headers = {