diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d963df0b..b377e384 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: persist-credentials: true ref: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7053b5e1..0f05f592 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: id-token: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Install Flutter uses: subosito/flutter-action@v2 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eebc892f..fe3193ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Install Flutter uses: subosito/flutter-action@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 72b89769..4f99e4f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ # Change Log +## 24.1.0 + +* Added: Added `setCookie()` method to `Client`, `ClientIO`, and `ClientBrowser` for forwarding incoming `Cookie` headers in server-side runtimes +* Added: Added `fusionauth`, `keycloak`, and `kick` OAuth providers to `OAuthProvider` enum +* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.4` +* Updated: Reformatted generated code to use 4-space indentation + ## 24.0.0 -* Breaking: Added `unsubscribe()`, `update()`, and `close()` for Realtime subscription lifecycle. -* Added: Added `userPhone` to the `Membership` model. -* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.2`. +* Breaking: Added `unsubscribe()`, `update()`, and `close()` to Realtime subscriptions +* Added: Added `userPhone` field to `Membership` model +* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.2` ## 23.1.0 diff --git a/README.md b/README.md index ef450aa3..ca43bef0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^24.0.0 + appwrite: ^24.1.0 ``` You can install packages from the command line: diff --git a/lib/src/client.dart b/lib/src/client.dart index 9535a309..940ddb5e 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -79,6 +79,11 @@ abstract class Client { /// Your secret dev API key. Client setDevKey(String value); + /// Set Cookie. + /// + /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.. + Client setCookie(String value); + /// Set ImpersonateUserId. /// /// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.. diff --git a/lib/src/client_base.dart b/lib/src/client_base.dart index c806e36a..cbb1452d 100644 --- a/lib/src/client_base.dart +++ b/lib/src/client_base.dart @@ -21,6 +21,10 @@ abstract class ClientBase implements Client { @override ClientBase setDevKey(value); + /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. + @override + ClientBase setCookie(value); + /// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. @override ClientBase setImpersonateUserId(value); diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index 7852c778..c3a4deb1 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -40,8 +40,8 @@ class ClientBrowser extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '24.0.0', - 'X-Appwrite-Response-Format': '1.9.2', + 'x-sdk-version': '24.1.0', + 'X-Appwrite-Response-Format': '1.9.4', }; config = {}; @@ -95,6 +95,14 @@ class ClientBrowser extends ClientBase with ClientMixin { return this; } + /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. + @override + ClientBrowser setCookie(value) { + config['cookie'] = value; + addHeader('Cookie', value); + return this; + } + /// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. @override ClientBrowser setImpersonateUserId(value) { diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index c705abe1..28ca532a 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -58,8 +58,8 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-name': 'Flutter', 'x-sdk-platform': 'client', 'x-sdk-language': 'flutter', - 'x-sdk-version': '24.0.0', - 'X-Appwrite-Response-Format': '1.9.2', + 'x-sdk-version': '24.1.0', + 'X-Appwrite-Response-Format': '1.9.4', }; config = {}; @@ -121,6 +121,14 @@ class ClientIO extends ClientBase with ClientMixin { return this; } + /// The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. + @override + ClientIO setCookie(value) { + config['cookie'] = value; + addHeader('Cookie', value); + return this; + } + /// Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. @override ClientIO setImpersonateUserId(value) { diff --git a/lib/src/enums/o_auth_provider.dart b/lib/src/enums/o_auth_provider.dart index dc08c932..b88e0a55 100644 --- a/lib/src/enums/o_auth_provider.dart +++ b/lib/src/enums/o_auth_provider.dart @@ -16,9 +16,12 @@ enum OAuthProvider { etsy(value: 'etsy'), facebook(value: 'facebook'), figma(value: 'figma'), + fusionauth(value: 'fusionauth'), github(value: 'github'), gitlab(value: 'gitlab'), google(value: 'google'), + keycloak(value: 'keycloak'), + kick(value: 'kick'), linkedin(value: 'linkedin'), microsoft(value: 'microsoft'), notion(value: 'notion'), diff --git a/pubspec.yaml b/pubspec.yaml index 79776241..ae53b96f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 24.0.0 +version: 24.1.0 description: Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-flutter