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

## 28.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

## 28.3.0

* Added: `account` passkey methods `listPasskeys`, `createPasskey`, `getPasskey`, `updatePasskey`, `deletePasskey` and `updatePasskeyVerification`
Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'appwrite'
spec.version = '28.3.0'
spec.version = '28.3.1'
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'
Expand Down
1 change: 1 addition & 0 deletions lib/appwrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
require_relative 'appwrite/models/policy_user_limit'
require_relative 'appwrite/models/policy_membership_privacy'
require_relative 'appwrite/models/policy_mfa_factors'
require_relative 'appwrite/models/policy_passkey'
require_relative 'appwrite/models/platform_web'
require_relative 'appwrite/models/platform_apple'
require_relative 'appwrite/models/platform_android'
Expand Down
2 changes: 1 addition & 1 deletion lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize
'x-sdk-name' => 'Ruby',
'x-sdk-platform' => 'server',
'x-sdk-language' => 'ruby',
'x-sdk-version' => '28.3.0',
'x-sdk-version' => '28.3.1',
'X-Appwrite-Response-Format' => '2.0.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
Expand Down
1 change: 1 addition & 0 deletions lib/appwrite/enums/project_auth_method_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module ProjectAuthMethodId
INVITES = 'invites'
JWT = 'jwt'
PHONE = 'phone'
PASSKEY = 'passkey'
end
end
end
1 change: 1 addition & 0 deletions lib/appwrite/enums/project_policy_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module ProjectPolicyId
DENY_DISPOSABLE_EMAIL = 'deny-disposable-email'
DENY_FREE_EMAIL = 'deny-free-email'
DENY_CORPORATE_EMAIL = 'deny-corporate-email'
PASSKEY = 'passkey'
end
end
end
37 changes: 37 additions & 0 deletions lib/appwrite/models/policy_passkey.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

module Appwrite
module Models
class PolicyPasskey
attr_reader :id
attr_reader :rp_id
attr_reader :origins

def initialize(
id:,
rp_id:,
origins:
)
@id = id
@rp_id = rp_id
@origins = origins
end

def self.from(map:)
PolicyPasskey.new(
id: map["$id"],
rp_id: map["rpId"],
origins: map["origins"]
)
end

def to_map
{
"$id": @id,
"rpId": @rp_id,
"origins": @origins
}
end
end
end
end
1 change: 1 addition & 0 deletions lib/appwrite/models/project_auth_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def validate_id(id)
Appwrite::Enums::ProjectAuthMethodId::INVITES,
Appwrite::Enums::ProjectAuthMethodId::JWT,
Appwrite::Enums::ProjectAuthMethodId::PHONE,
Appwrite::Enums::ProjectAuthMethodId::PASSKEY,
]

unless valid_id.include?(id)
Expand Down
7 changes: 6 additions & 1 deletion lib/appwrite/services/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3757,7 +3757,7 @@ def update_user_limit_policy(
#
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email.
#
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail]
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyPasskey]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include passkey in the documented get_policy IDs

The @param list immediately above still omits passkey, so the SDK docs say this newly supported policy ID is not a valid get_policy argument.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/appwrite/services/project.rb
Line: 3760

Comment:
**Include passkey in the documented get_policy IDs**

The `@param` list immediately above still omits `passkey`, so the SDK docs say this newly supported policy ID is not a valid `get_policy` argument.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · documentation · Reply if this doesn't apply.

def get_policy(
policy_id:
)
Expand Down Expand Up @@ -3861,6 +3861,11 @@ def get_policy(
return Models::PolicyDenyCorporateEmail.from(map: response)
end

if response['$id'] == 'passkey'

return Models::PolicyPasskey.from(map: response)
end

raise Exception, "Unable to match response to any expected response model"
end

Expand Down
Loading