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
2 changes: 1 addition & 1 deletion Appwrite/Appwrite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<PackageId>Appwrite</PackageId>
<Version>8.3.0</Version>
<Version>8.3.1</Version>
<Authors>Appwrite Team</Authors>
<Company>Appwrite Team</Company>
<Description>
Expand Down
4 changes: 2 additions & 2 deletions Appwrite/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "content-type", "application/json" },
{ "user-agent", $"AppwriteDotNetSDK/8.3.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "user-agent", $"AppwriteDotNetSDK/8.3.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"},
{ "x-sdk-name", ".NET" },
{ "x-sdk-platform", "server" },
{ "x-sdk-language", "dotnet" },
{ "x-sdk-version", "8.3.0"},
{ "x-sdk-version", "8.3.1"},
{ "X-Appwrite-Response-Format", "2.0.0" }
};

Expand Down
1 change: 1 addition & 0 deletions Appwrite/Enums/ProjectAuthMethodId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public ProjectAuthMethodId(string value)
public static ProjectAuthMethodId Invites => new ProjectAuthMethodId("invites");
public static ProjectAuthMethodId Jwt => new ProjectAuthMethodId("jwt");
public static ProjectAuthMethodId Phone => new ProjectAuthMethodId("phone");
public static ProjectAuthMethodId Passkey => new ProjectAuthMethodId("passkey");
}
}
1 change: 1 addition & 0 deletions Appwrite/Enums/ProjectPolicyId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public ProjectPolicyId(string value)
public static ProjectPolicyId DenyDisposableEmail => new ProjectPolicyId("deny-disposable-email");
public static ProjectPolicyId DenyFreeEmail => new ProjectPolicyId("deny-free-email");
public static ProjectPolicyId DenyCorporateEmail => new ProjectPolicyId("deny-corporate-email");
public static ProjectPolicyId Passkey => new ProjectPolicyId("passkey");
}
}
47 changes: 47 additions & 0 deletions Appwrite/Models/PolicyPasskey.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Appwrite.Enums;
using Appwrite.Extensions;

namespace Appwrite.Models
{
public class PolicyPasskey
{
[JsonPropertyName("$id")]
public string Id { get; private set; }

[JsonPropertyName("rpId")]
public string RpId { get; private set; }

[JsonPropertyName("origins")]
public List<string> Origins { get; private set; }

public PolicyPasskey(
string id,
string rpId,
List<string> origins
)
{
Id = id;
RpId = rpId;
Origins = origins;
}

public static PolicyPasskey From(Dictionary<string, object> map) => new PolicyPasskey(
id: map["$id"].ToString(),
rpId: map["rpId"].ToString(),
origins: map["origins"].ConvertToList<string>()
);

public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "$id", Id },
{ "rpId", RpId },
{ "origins", Origins }
};
}
}
4 changes: 4 additions & 0 deletions Appwrite/Services/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3747,6 +3747,10 @@ static object Convert(Dictionary<string, object> it)
{
return Appwrite.Models.PolicyDenyCorporateEmail.From(map: it);
}
if (it.TryGetValue("$id", out var idValue17) && idValue17?.ToString() == "passkey")
{
return Appwrite.Models.PolicyPasskey.From(map: it);
}
throw new System.Exception("Unable to match response to any expected response model");
}

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 8.3.1

* Fixed: added `ProjectAuthMethodId.Passkey`, so `project.updateAuthMethod` can enable passkeys
* Fixed: added `ProjectPolicyId.Passkey` and the `PolicyPasskey` model, so `getPolicy` and `listPolicies` return the passkey policy

## 8.3.0

* Added: `account` passkey methods `listPasskeys`, `createPasskey`, `getPasskey`, `updatePasskey`, `deletePasskey` and `updatePasskeyVerification`
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstracts and simpli
Add this reference to your project's `.csproj` file:

```xml
<PackageReference Include="Appwrite" Version="8.3.0" />
<PackageReference Include="Appwrite" Version="8.3.1" />
```

You can install packages from the command line:

```powershell
# Package Manager
Install-Package Appwrite -Version 8.3.0
Install-Package Appwrite -Version 8.3.1

# or .NET CLI
dotnet add package Appwrite --version 8.3.0
dotnet add package Appwrite --version 8.3.1
```


Expand Down
Loading