Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 25.2.0

* Added: Realtime connections now send an `x-appwrite-jwt` header for authentication.
* Added: Forwarded `impersonateUserId` on `avatars` and `storage` file requests.

## 25.1.0

* Added: Email metadata fields to `User` (`emailCanonical`, `emailIsFree`, `emailIsDisposable`, `emailIsCorporate`, `emailIsCanonical`).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-android:25.1.0")
implementation("io.appwrite:sdk-for-android:25.2.0")
```

### Maven
Expand All @@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>25.1.0</version>
<version>25.2.0</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Account account = new Account(client);
account.create(
"<USER_ID>", // userId
"email@example.com", // email
"", // password
"password", // password
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/account/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Client client = new Client(context)
Account account = new Account(client);

account.updatePassword(
"", // password
"<OLD_PASSWORD>", // oldPassword (optional)
"password", // password
"password", // oldPassword (optional)
Comment on lines +13 to +14

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 Both password fields show the same literal value

After this change both password and oldPassword are set to the plain string "password". The previous oldPassword = "<OLD_PASSWORD>" placeholder made the distinction between the two arguments visually obvious. Using identical string literals here makes it easy for a reader to copy the snippet and inadvertently pass the same value for both, which the server will accept as a valid (though semantically wrong) request. Consider using distinct placeholder strings — e.g. "newPassword" / "oldPassword" — to communicate intent.

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!

new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/account/update-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Account account = new Account(client);
account.updateRecovery(
"<USER_ID>", // userId
"<SECRET>", // secret
"", // password
"password", // password
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/kotlin/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ val account = Account(client)
val result = account.create(
userId = "<USER_ID>",
email = "email@example.com",
password = "",
password = "password",
name = "<NAME>", // (optional)
)
```
4 changes: 2 additions & 2 deletions docs/examples/kotlin/account/update-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ val client = Client(context)
val account = Account(client)

val result = account.updatePassword(
password = "",
oldPassword = "<OLD_PASSWORD>", // (optional)
password = "password",
oldPassword = "password", // (optional)
)
```
2 changes: 1 addition & 1 deletion docs/examples/kotlin/account/update-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ val account = Account(client)
val result = account.updateRecovery(
userId = "<USER_ID>",
secret = "<SECRET>",
password = "",
password = "password",
)
```
12 changes: 6 additions & 6 deletions library/src/main/java/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
"x-sdk-version" to "25.1.0",
"x-sdk-version" to "25.2.0",
"x-appwrite-response-format" to "1.9.5"
)
config = mutableMapOf()
Expand Down Expand Up @@ -192,7 +192,7 @@ class Client @JvmOverloads constructor(
/**
* 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.
* Impersonate a user by ID
*
* @param {string} impersonateuserid
*
Expand All @@ -207,7 +207,7 @@ class Client @JvmOverloads constructor(
/**
* Set ImpersonateUserEmail
*
* Impersonate a user by email 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.
* Impersonate a user by email
*
* @param {string} impersonateuseremail
*
Expand All @@ -222,7 +222,7 @@ class Client @JvmOverloads constructor(
/**
* Set ImpersonateUserPhone
*
* Impersonate a user by phone 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.
* Impersonate a user by phone
*
* @param {string} impersonateuserphone
*
Expand Down Expand Up @@ -358,16 +358,16 @@ class Client @JvmOverloads constructor(
fun getHttpClient(): OkHttpClient = http

/**
* Sends a "ping" request to Appwrite to verify connectivity.
* Send a ping to project as part of onboarding.
*
* @return String
*/
suspend fun ping(): String {
val apiPath = "/ping"
val apiParams = mutableMapOf<String, Any?>()
val apiHeaders = mutableMapOf(
"content-type" to "application/json",
"X-Appwrite-Project" to config["project"].orEmpty(),
"accept" to "application/json",
)

return call(
Expand Down
Loading