appwrite 28.3.1 → 28.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +20 -4
- data/lib/appwrite/enums/billing_plan_group.rb +2 -0
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/databases_index_type.rb +1 -0
- data/lib/appwrite/enums/domain_registration_type.rb +10 -0
- data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
- data/lib/appwrite/enums/framework.rb +1 -0
- data/lib/appwrite/enums/id_token_provider.rb +8 -0
- data/lib/appwrite/enums/image_gravity.rb +1 -0
- data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth_provider.rb +3 -0
- data/lib/appwrite/enums/project_email_template_id.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +4 -0
- data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
- data/lib/appwrite/enums/project_policy_id.rb +2 -0
- data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
- data/lib/appwrite/enums/waf_rule_action.rb +11 -0
- data/lib/appwrite/models/account.rb +143 -0
- data/lib/appwrite/models/billing_plan.rb +12 -0
- data/lib/appwrite/models/dedicated_database.rb +15 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +20 -0
- data/lib/appwrite/models/dns_record.rb +83 -0
- data/lib/appwrite/models/dns_records_list.rb +33 -0
- data/lib/appwrite/models/domain.rb +109 -0
- data/lib/appwrite/models/domain_price.rb +63 -0
- data/lib/appwrite/models/domain_prices_list.rb +33 -0
- data/lib/appwrite/models/domain_transfer_status.rb +59 -0
- data/lib/appwrite/models/domains_list.rb +33 -0
- data/lib/appwrite/models/identity.rb +8 -3
- data/lib/appwrite/models/o_auth2_apple.rb +13 -3
- data/lib/appwrite/models/o_auth2_auth0.rb +23 -0
- data/lib/appwrite/models/o_auth2_discord.rb +25 -3
- data/lib/appwrite/models/o_auth2_github.rb +24 -3
- data/lib/appwrite/models/o_auth2_google.rb +17 -5
- data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
- data/lib/appwrite/models/o_auth2_microsoft.rb +24 -0
- data/lib/appwrite/models/o_auth2_oidc.rb +4 -2
- data/lib/appwrite/models/o_auth2_okta.rb +23 -0
- data/lib/appwrite/models/o_auth2_salesforce.rb +25 -3
- data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
- data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
- data/lib/appwrite/models/o_auth2_zoho.rb +24 -3
- data/lib/appwrite/models/oauth2_introspection.rb +83 -0
- data/lib/appwrite/models/platform_android.rb +8 -3
- data/lib/appwrite/models/policy_password_pwned.rb +43 -0
- data/lib/appwrite/models/policy_password_rotation.rb +38 -0
- data/lib/appwrite/models/project.rb +15 -0
- data/lib/appwrite/models/project_service.rb +1 -0
- data/lib/appwrite/models/proxy_rule.rb +1 -0
- data/lib/appwrite/models/topic.rb +13 -3
- data/lib/appwrite/models/user.rb +5 -0
- data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
- data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
- data/lib/appwrite/models/waf_rule_deny.rb +111 -0
- data/lib/appwrite/models/waf_rule_list.rb +33 -0
- data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
- data/lib/appwrite/services/account.rb +301 -5
- data/lib/appwrite/services/avatars.rb +71 -0
- data/lib/appwrite/services/databases.rb +4 -1
- data/lib/appwrite/services/documents_db.rb +4 -1
- data/lib/appwrite/services/domains.rb +2318 -0
- data/lib/appwrite/services/functions.rb +11 -3
- data/lib/appwrite/services/locale.rb +49 -14
- data/lib/appwrite/services/messaging.rb +130 -6
- data/lib/appwrite/services/oauth2.rb +45 -0
- data/lib/appwrite/services/organization.rb +225 -0
- data/lib/appwrite/services/project.rb +439 -15
- data/lib/appwrite/services/sites.rb +11 -3
- data/lib/appwrite/services/tables_db.rb +4 -1
- data/lib/appwrite/services/teams.rb +4 -1
- data/lib/appwrite/services/vectors_db.rb +4 -1
- data/lib/appwrite/services/waf.rb +859 -0
- data/lib/appwrite.rb +42 -0
- metadata +44 -2
|
@@ -91,6 +91,182 @@ module Appwrite
|
|
|
91
91
|
)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
# Get a list of all environments of the project. You can use the query params
|
|
95
|
+
# to filter your results.
|
|
96
|
+
#
|
|
97
|
+
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt, status, parentId
|
|
98
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
99
|
+
#
|
|
100
|
+
# @return [ProjectList]
|
|
101
|
+
def list_environments(
|
|
102
|
+
queries: nil,
|
|
103
|
+
total: nil
|
|
104
|
+
)
|
|
105
|
+
api_path = '/project/environments'
|
|
106
|
+
|
|
107
|
+
api_params = {
|
|
108
|
+
queries: queries,
|
|
109
|
+
total: total,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
api_headers = {
|
|
113
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
114
|
+
"accept": 'application/json',
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@client.call(
|
|
118
|
+
method: 'GET',
|
|
119
|
+
path: api_path,
|
|
120
|
+
headers: api_headers,
|
|
121
|
+
params: api_params,
|
|
122
|
+
response_type: Models::ProjectList
|
|
123
|
+
)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Create a new environment of the project. An environment is a separate
|
|
127
|
+
# project in the same organization and region, with its own resources and
|
|
128
|
+
# users. Its usage is billed under the project it belongs to.
|
|
129
|
+
#
|
|
130
|
+
# @param [String] environment_id Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.
|
|
131
|
+
# @param [String] name Environment name. Max length: 128 chars.
|
|
132
|
+
#
|
|
133
|
+
# @return [Project]
|
|
134
|
+
def create_environment(
|
|
135
|
+
environment_id:,
|
|
136
|
+
name:
|
|
137
|
+
)
|
|
138
|
+
if environment_id.nil?
|
|
139
|
+
raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if name.nil?
|
|
143
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
api_path = '/project/environments'
|
|
147
|
+
|
|
148
|
+
api_params = {
|
|
149
|
+
environmentId: environment_id,
|
|
150
|
+
name: name,
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
api_headers = {
|
|
154
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
155
|
+
"content-type": 'application/json',
|
|
156
|
+
"accept": 'application/json',
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@client.call(
|
|
160
|
+
method: 'POST',
|
|
161
|
+
path: api_path,
|
|
162
|
+
headers: api_headers,
|
|
163
|
+
params: api_params,
|
|
164
|
+
response_type: Models::Project
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Get an environment of the project by its unique ID.
|
|
169
|
+
#
|
|
170
|
+
# @param [String] environment_id Environment unique ID.
|
|
171
|
+
#
|
|
172
|
+
# @return [Project]
|
|
173
|
+
def get_environment(
|
|
174
|
+
environment_id:
|
|
175
|
+
)
|
|
176
|
+
if environment_id.nil?
|
|
177
|
+
raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
api_path = '/project/environments/{environmentId}'
|
|
181
|
+
.gsub('{environmentId}', environment_id)
|
|
182
|
+
|
|
183
|
+
api_params = {}
|
|
184
|
+
|
|
185
|
+
api_headers = {
|
|
186
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
187
|
+
"accept": 'application/json',
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@client.call(
|
|
191
|
+
method: 'GET',
|
|
192
|
+
path: api_path,
|
|
193
|
+
headers: api_headers,
|
|
194
|
+
params: api_params,
|
|
195
|
+
response_type: Models::Project
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Update the name of an environment of the project.
|
|
200
|
+
#
|
|
201
|
+
# @param [String] environment_id Environment unique ID.
|
|
202
|
+
# @param [String] name Environment name. Max length: 128 chars.
|
|
203
|
+
#
|
|
204
|
+
# @return [Project]
|
|
205
|
+
def update_environment(
|
|
206
|
+
environment_id:,
|
|
207
|
+
name:
|
|
208
|
+
)
|
|
209
|
+
if environment_id.nil?
|
|
210
|
+
raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if name.nil?
|
|
214
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
api_path = '/project/environments/{environmentId}'
|
|
218
|
+
.gsub('{environmentId}', environment_id)
|
|
219
|
+
|
|
220
|
+
api_params = {
|
|
221
|
+
name: name,
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
api_headers = {
|
|
225
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
226
|
+
"content-type": 'application/json',
|
|
227
|
+
"accept": 'application/json',
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@client.call(
|
|
231
|
+
method: 'PATCH',
|
|
232
|
+
path: api_path,
|
|
233
|
+
headers: api_headers,
|
|
234
|
+
params: api_params,
|
|
235
|
+
response_type: Models::Project
|
|
236
|
+
)
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Delete an environment of the project, with all of its resources and users.
|
|
240
|
+
#
|
|
241
|
+
# @param [String] environment_id Environment unique ID.
|
|
242
|
+
#
|
|
243
|
+
# @return []
|
|
244
|
+
def delete_environment(
|
|
245
|
+
environment_id:
|
|
246
|
+
)
|
|
247
|
+
if environment_id.nil?
|
|
248
|
+
raise Appwrite::Exception.new('Missing required parameter: "environmentId"')
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
api_path = '/project/environments/{environmentId}'
|
|
252
|
+
.gsub('{environmentId}', environment_id)
|
|
253
|
+
|
|
254
|
+
api_params = {}
|
|
255
|
+
|
|
256
|
+
api_headers = {
|
|
257
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
258
|
+
"content-type": 'application/json',
|
|
259
|
+
"accept": 'application/json',
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@client.call(
|
|
263
|
+
method: 'DELETE',
|
|
264
|
+
path: api_path,
|
|
265
|
+
headers: api_headers,
|
|
266
|
+
params: api_params,
|
|
267
|
+
)
|
|
268
|
+
end
|
|
269
|
+
|
|
94
270
|
# Get a list of all API keys from the current project.
|
|
95
271
|
#
|
|
96
272
|
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes
|
|
@@ -646,7 +822,9 @@ module Appwrite
|
|
|
646
822
|
# @param [String] key_id 'Key ID' of Apple OAuth2 app. For example: P4000000N8
|
|
647
823
|
# @param [String] team_id 'Team ID' of Apple OAuth2 app. For example: D4000000R6
|
|
648
824
|
# @param [String] p8_file Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----
|
|
649
|
-
# @param [] enabled OAuth2 sign-in
|
|
825
|
+
# @param [] enabled Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.
|
|
826
|
+
# @param [Array] native_client_ids App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.
|
|
827
|
+
# @param [] native_enabled Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code.
|
|
650
828
|
#
|
|
651
829
|
# @return [OAuth2Apple]
|
|
652
830
|
def update_o_auth2_apple(
|
|
@@ -654,7 +832,9 @@ module Appwrite
|
|
|
654
832
|
key_id: nil,
|
|
655
833
|
team_id: nil,
|
|
656
834
|
p8_file: nil,
|
|
657
|
-
enabled: nil
|
|
835
|
+
enabled: nil,
|
|
836
|
+
native_client_ids: nil,
|
|
837
|
+
native_enabled: nil
|
|
658
838
|
)
|
|
659
839
|
api_path = '/project/oauth2/apple'
|
|
660
840
|
|
|
@@ -664,6 +844,8 @@ module Appwrite
|
|
|
664
844
|
teamId: team_id,
|
|
665
845
|
p8File: p8_file,
|
|
666
846
|
enabled: enabled,
|
|
847
|
+
nativeClientIds: native_client_ids,
|
|
848
|
+
nativeEnabled: native_enabled,
|
|
667
849
|
}
|
|
668
850
|
|
|
669
851
|
api_headers = {
|
|
@@ -722,13 +904,15 @@ module Appwrite
|
|
|
722
904
|
# @param [String] client_secret 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF
|
|
723
905
|
# @param [String] endpoint Domain of Auth0 instance. For example: example.us.auth0.com
|
|
724
906
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
907
|
+
# @param [Array] prompt Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default.
|
|
725
908
|
#
|
|
726
909
|
# @return [OAuth2Auth0]
|
|
727
910
|
def update_o_auth2_auth0(
|
|
728
911
|
client_id: nil,
|
|
729
912
|
client_secret: nil,
|
|
730
913
|
endpoint: nil,
|
|
731
|
-
enabled: nil
|
|
914
|
+
enabled: nil,
|
|
915
|
+
prompt: nil
|
|
732
916
|
)
|
|
733
917
|
api_path = '/project/oauth2/auth0'
|
|
734
918
|
|
|
@@ -737,6 +921,7 @@ module Appwrite
|
|
|
737
921
|
clientSecret: client_secret,
|
|
738
922
|
endpoint: endpoint,
|
|
739
923
|
enabled: enabled,
|
|
924
|
+
prompt: prompt,
|
|
740
925
|
}
|
|
741
926
|
|
|
742
927
|
api_headers = {
|
|
@@ -1007,12 +1192,14 @@ module Appwrite
|
|
|
1007
1192
|
# @param [String] client_id 'Client ID' of Discord OAuth2 app. For example: 950722000000343754
|
|
1008
1193
|
# @param [String] client_secret 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D
|
|
1009
1194
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1195
|
+
# @param [Array] prompt Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default.
|
|
1010
1196
|
#
|
|
1011
1197
|
# @return [OAuth2Discord]
|
|
1012
1198
|
def update_o_auth2_discord(
|
|
1013
1199
|
client_id: nil,
|
|
1014
1200
|
client_secret: nil,
|
|
1015
|
-
enabled: nil
|
|
1201
|
+
enabled: nil,
|
|
1202
|
+
prompt: nil
|
|
1016
1203
|
)
|
|
1017
1204
|
api_path = '/project/oauth2/discord'
|
|
1018
1205
|
|
|
@@ -1020,6 +1207,7 @@ module Appwrite
|
|
|
1020
1207
|
clientId: client_id,
|
|
1021
1208
|
clientSecret: client_secret,
|
|
1022
1209
|
enabled: enabled,
|
|
1210
|
+
prompt: prompt,
|
|
1023
1211
|
}
|
|
1024
1212
|
|
|
1025
1213
|
api_headers = {
|
|
@@ -1255,12 +1443,14 @@ module Appwrite
|
|
|
1255
1443
|
# @param [String] client_id 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006
|
|
1256
1444
|
# @param [String] client_secret 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc
|
|
1257
1445
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1446
|
+
# @param [Array] prompt Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default.
|
|
1258
1447
|
#
|
|
1259
1448
|
# @return [OAuth2Github]
|
|
1260
1449
|
def update_o_auth2_git_hub(
|
|
1261
1450
|
client_id: nil,
|
|
1262
1451
|
client_secret: nil,
|
|
1263
|
-
enabled: nil
|
|
1452
|
+
enabled: nil,
|
|
1453
|
+
prompt: nil
|
|
1264
1454
|
)
|
|
1265
1455
|
api_path = '/project/oauth2/github'
|
|
1266
1456
|
|
|
@@ -1268,6 +1458,7 @@ module Appwrite
|
|
|
1268
1458
|
clientId: client_id,
|
|
1269
1459
|
clientSecret: client_secret,
|
|
1270
1460
|
enabled: enabled,
|
|
1461
|
+
prompt: prompt,
|
|
1271
1462
|
}
|
|
1272
1463
|
|
|
1273
1464
|
api_headers = {
|
|
@@ -1328,14 +1519,18 @@ module Appwrite
|
|
|
1328
1519
|
# @param [String] client_id 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com
|
|
1329
1520
|
# @param [String] client_secret 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj
|
|
1330
1521
|
# @param [Array] prompt Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account.
|
|
1331
|
-
# @param [] enabled OAuth2 sign-in
|
|
1522
|
+
# @param [] enabled Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.
|
|
1523
|
+
# @param [Array] native_client_ids Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.
|
|
1524
|
+
# @param [] native_enabled Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code.
|
|
1332
1525
|
#
|
|
1333
1526
|
# @return [OAuth2Google]
|
|
1334
1527
|
def update_o_auth2_google(
|
|
1335
1528
|
client_id: nil,
|
|
1336
1529
|
client_secret: nil,
|
|
1337
1530
|
prompt: nil,
|
|
1338
|
-
enabled: nil
|
|
1531
|
+
enabled: nil,
|
|
1532
|
+
native_client_ids: nil,
|
|
1533
|
+
native_enabled: nil
|
|
1339
1534
|
)
|
|
1340
1535
|
api_path = '/project/oauth2/google'
|
|
1341
1536
|
|
|
@@ -1344,6 +1539,8 @@ module Appwrite
|
|
|
1344
1539
|
clientSecret: client_secret,
|
|
1345
1540
|
prompt: prompt,
|
|
1346
1541
|
enabled: enabled,
|
|
1542
|
+
nativeClientIds: native_client_ids,
|
|
1543
|
+
nativeEnabled: native_enabled,
|
|
1347
1544
|
}
|
|
1348
1545
|
|
|
1349
1546
|
api_headers = {
|
|
@@ -1396,6 +1593,44 @@ module Appwrite
|
|
|
1396
1593
|
)
|
|
1397
1594
|
end
|
|
1398
1595
|
|
|
1596
|
+
# Update the project OAuth2 Kakao configuration.
|
|
1597
|
+
#
|
|
1598
|
+
# @param [String] client_id 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de
|
|
1599
|
+
# @param [String] client_secret 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled
|
|
1600
|
+
# @param [Array] prompt Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default.
|
|
1601
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1602
|
+
#
|
|
1603
|
+
# @return [OAuth2Kakao]
|
|
1604
|
+
def update_o_auth2_kakao(
|
|
1605
|
+
client_id: nil,
|
|
1606
|
+
client_secret: nil,
|
|
1607
|
+
prompt: nil,
|
|
1608
|
+
enabled: nil
|
|
1609
|
+
)
|
|
1610
|
+
api_path = '/project/oauth2/kakao'
|
|
1611
|
+
|
|
1612
|
+
api_params = {
|
|
1613
|
+
clientId: client_id,
|
|
1614
|
+
clientSecret: client_secret,
|
|
1615
|
+
prompt: prompt,
|
|
1616
|
+
enabled: enabled,
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
api_headers = {
|
|
1620
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1621
|
+
"content-type": 'application/json',
|
|
1622
|
+
"accept": 'application/json',
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
@client.call(
|
|
1626
|
+
method: 'PATCH',
|
|
1627
|
+
path: api_path,
|
|
1628
|
+
headers: api_headers,
|
|
1629
|
+
params: api_params,
|
|
1630
|
+
response_type: Models::OAuth2Kakao
|
|
1631
|
+
)
|
|
1632
|
+
end
|
|
1633
|
+
|
|
1399
1634
|
# Update the project OAuth2 Keycloak configuration.
|
|
1400
1635
|
#
|
|
1401
1636
|
# @param [String] client_id 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app
|
|
@@ -1513,13 +1748,15 @@ module Appwrite
|
|
|
1513
1748
|
# @param [String] application_secret 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u
|
|
1514
1749
|
# @param [String] tenant Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common
|
|
1515
1750
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1751
|
+
# @param [Array] prompt Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default.
|
|
1516
1752
|
#
|
|
1517
1753
|
# @return [OAuth2Microsoft]
|
|
1518
1754
|
def update_o_auth2_microsoft(
|
|
1519
1755
|
application_id: nil,
|
|
1520
1756
|
application_secret: nil,
|
|
1521
1757
|
tenant: nil,
|
|
1522
|
-
enabled: nil
|
|
1758
|
+
enabled: nil,
|
|
1759
|
+
prompt: nil
|
|
1523
1760
|
)
|
|
1524
1761
|
api_path = '/project/oauth2/microsoft'
|
|
1525
1762
|
|
|
@@ -1528,6 +1765,7 @@ module Appwrite
|
|
|
1528
1765
|
applicationSecret: application_secret,
|
|
1529
1766
|
tenant: tenant,
|
|
1530
1767
|
enabled: enabled,
|
|
1768
|
+
prompt: prompt,
|
|
1531
1769
|
}
|
|
1532
1770
|
|
|
1533
1771
|
api_headers = {
|
|
@@ -1640,6 +1878,7 @@ module Appwrite
|
|
|
1640
1878
|
# @param [String] domain Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/
|
|
1641
1879
|
# @param [String] authorization_server_id Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z
|
|
1642
1880
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
1881
|
+
# @param [Array] prompt Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default.
|
|
1643
1882
|
#
|
|
1644
1883
|
# @return [OAuth2Okta]
|
|
1645
1884
|
def update_o_auth2_okta(
|
|
@@ -1647,7 +1886,8 @@ module Appwrite
|
|
|
1647
1886
|
client_secret: nil,
|
|
1648
1887
|
domain: nil,
|
|
1649
1888
|
authorization_server_id: nil,
|
|
1650
|
-
enabled: nil
|
|
1889
|
+
enabled: nil,
|
|
1890
|
+
prompt: nil
|
|
1651
1891
|
)
|
|
1652
1892
|
api_path = '/project/oauth2/okta'
|
|
1653
1893
|
|
|
@@ -1657,6 +1897,7 @@ module Appwrite
|
|
|
1657
1897
|
domain: domain,
|
|
1658
1898
|
authorizationServerId: authorization_server_id,
|
|
1659
1899
|
enabled: enabled,
|
|
1900
|
+
prompt: prompt,
|
|
1660
1901
|
}
|
|
1661
1902
|
|
|
1662
1903
|
api_headers = {
|
|
@@ -1819,12 +2060,14 @@ module Appwrite
|
|
|
1819
2060
|
# @param [String] customer_key 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq
|
|
1820
2061
|
# @param [String] customer_secret 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2
|
|
1821
2062
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2063
|
+
# @param [Array] prompt Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default.
|
|
1822
2064
|
#
|
|
1823
2065
|
# @return [OAuth2Salesforce]
|
|
1824
2066
|
def update_o_auth2_salesforce(
|
|
1825
2067
|
customer_key: nil,
|
|
1826
2068
|
customer_secret: nil,
|
|
1827
|
-
enabled: nil
|
|
2069
|
+
enabled: nil,
|
|
2070
|
+
prompt: nil
|
|
1828
2071
|
)
|
|
1829
2072
|
api_path = '/project/oauth2/salesforce'
|
|
1830
2073
|
|
|
@@ -1832,6 +2075,7 @@ module Appwrite
|
|
|
1832
2075
|
customerKey: customer_key,
|
|
1833
2076
|
customerSecret: customer_secret,
|
|
1834
2077
|
enabled: enabled,
|
|
2078
|
+
prompt: prompt,
|
|
1835
2079
|
}
|
|
1836
2080
|
|
|
1837
2081
|
api_headers = {
|
|
@@ -1954,6 +2198,41 @@ module Appwrite
|
|
|
1954
2198
|
)
|
|
1955
2199
|
end
|
|
1956
2200
|
|
|
2201
|
+
# Update the project OAuth2 TikTok configuration.
|
|
2202
|
+
#
|
|
2203
|
+
# @param [String] client_id 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0
|
|
2204
|
+
# @param [String] client_secret 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite
|
|
2205
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2206
|
+
#
|
|
2207
|
+
# @return [OAuth2TikTok]
|
|
2208
|
+
def update_o_auth2_tik_tok(
|
|
2209
|
+
client_id: nil,
|
|
2210
|
+
client_secret: nil,
|
|
2211
|
+
enabled: nil
|
|
2212
|
+
)
|
|
2213
|
+
api_path = '/project/oauth2/tiktok'
|
|
2214
|
+
|
|
2215
|
+
api_params = {
|
|
2216
|
+
clientId: client_id,
|
|
2217
|
+
clientSecret: client_secret,
|
|
2218
|
+
enabled: enabled,
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
api_headers = {
|
|
2222
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2223
|
+
"content-type": 'application/json',
|
|
2224
|
+
"accept": 'application/json',
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
@client.call(
|
|
2228
|
+
method: 'PATCH',
|
|
2229
|
+
path: api_path,
|
|
2230
|
+
headers: api_headers,
|
|
2231
|
+
params: api_params,
|
|
2232
|
+
response_type: Models::OAuth2TikTok
|
|
2233
|
+
)
|
|
2234
|
+
end
|
|
2235
|
+
|
|
1957
2236
|
# Update the project OAuth2 Tradeshift configuration.
|
|
1958
2237
|
#
|
|
1959
2238
|
# @param [String] oauth2_client_id 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app
|
|
@@ -2059,6 +2338,41 @@ module Appwrite
|
|
|
2059
2338
|
)
|
|
2060
2339
|
end
|
|
2061
2340
|
|
|
2341
|
+
# Update the project OAuth2 Webflow configuration.
|
|
2342
|
+
#
|
|
2343
|
+
# @param [String] client_id 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd
|
|
2344
|
+
# @param [String] client_secret 'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59
|
|
2345
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2346
|
+
#
|
|
2347
|
+
# @return [OAuth2Webflow]
|
|
2348
|
+
def update_o_auth2_webflow(
|
|
2349
|
+
client_id: nil,
|
|
2350
|
+
client_secret: nil,
|
|
2351
|
+
enabled: nil
|
|
2352
|
+
)
|
|
2353
|
+
api_path = '/project/oauth2/webflow'
|
|
2354
|
+
|
|
2355
|
+
api_params = {
|
|
2356
|
+
clientId: client_id,
|
|
2357
|
+
clientSecret: client_secret,
|
|
2358
|
+
enabled: enabled,
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
api_headers = {
|
|
2362
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2363
|
+
"content-type": 'application/json',
|
|
2364
|
+
"accept": 'application/json',
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
@client.call(
|
|
2368
|
+
method: 'PATCH',
|
|
2369
|
+
path: api_path,
|
|
2370
|
+
headers: api_headers,
|
|
2371
|
+
params: api_params,
|
|
2372
|
+
response_type: Models::OAuth2Webflow
|
|
2373
|
+
)
|
|
2374
|
+
end
|
|
2375
|
+
|
|
2062
2376
|
# Update the project OAuth2 WordPress configuration.
|
|
2063
2377
|
#
|
|
2064
2378
|
# @param [String] client_id 'Client ID' of WordPress OAuth2 app. For example: 130005
|
|
@@ -2204,12 +2518,14 @@ module Appwrite
|
|
|
2204
2518
|
# @param [String] client_id 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B
|
|
2205
2519
|
# @param [String] client_secret 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e
|
|
2206
2520
|
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2521
|
+
# @param [Array] prompt Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default.
|
|
2207
2522
|
#
|
|
2208
2523
|
# @return [OAuth2Zoho]
|
|
2209
2524
|
def update_o_auth2_zoho(
|
|
2210
2525
|
client_id: nil,
|
|
2211
2526
|
client_secret: nil,
|
|
2212
|
-
enabled: nil
|
|
2527
|
+
enabled: nil,
|
|
2528
|
+
prompt: nil
|
|
2213
2529
|
)
|
|
2214
2530
|
api_path = '/project/oauth2/zoho'
|
|
2215
2531
|
|
|
@@ -2217,6 +2533,7 @@ module Appwrite
|
|
|
2217
2533
|
clientId: client_id,
|
|
2218
2534
|
clientSecret: client_secret,
|
|
2219
2535
|
enabled: enabled,
|
|
2536
|
+
prompt: prompt,
|
|
2220
2537
|
}
|
|
2221
2538
|
|
|
2222
2539
|
api_headers = {
|
|
@@ -2274,7 +2591,7 @@ module Appwrite
|
|
|
2274
2591
|
#
|
|
2275
2592
|
# @param [ProjectOAuthProviderId] provider_id OAuth2 provider key. For example: github, google, apple.
|
|
2276
2593
|
#
|
|
2277
|
-
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft]
|
|
2594
|
+
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao]
|
|
2278
2595
|
def get_o_auth2_provider(
|
|
2279
2596
|
provider_id:
|
|
2280
2597
|
)
|
|
@@ -2378,6 +2695,11 @@ module Appwrite
|
|
|
2378
2695
|
return Models::OAuth2WordPress.from(map: response)
|
|
2379
2696
|
end
|
|
2380
2697
|
|
|
2698
|
+
if response['$id'] == 'webflow'
|
|
2699
|
+
|
|
2700
|
+
return Models::OAuth2Webflow.from(map: response)
|
|
2701
|
+
end
|
|
2702
|
+
|
|
2381
2703
|
if response['$id'] == 'twitch'
|
|
2382
2704
|
|
|
2383
2705
|
return Models::OAuth2Twitch.from(map: response)
|
|
@@ -2518,6 +2840,16 @@ module Appwrite
|
|
|
2518
2840
|
return Models::OAuth2Microsoft.from(map: response)
|
|
2519
2841
|
end
|
|
2520
2842
|
|
|
2843
|
+
if response['$id'] == 'tiktok'
|
|
2844
|
+
|
|
2845
|
+
return Models::OAuth2TikTok.from(map: response)
|
|
2846
|
+
end
|
|
2847
|
+
|
|
2848
|
+
if response['$id'] == 'kakao'
|
|
2849
|
+
|
|
2850
|
+
return Models::OAuth2Kakao.from(map: response)
|
|
2851
|
+
end
|
|
2852
|
+
|
|
2521
2853
|
raise Exception, "Unable to match response to any expected response model"
|
|
2522
2854
|
end
|
|
2523
2855
|
|
|
@@ -2560,12 +2892,14 @@ module Appwrite
|
|
|
2560
2892
|
# @param [String] platform_id Platform ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2561
2893
|
# @param [String] name Platform name. Max length: 128 chars.
|
|
2562
2894
|
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
2895
|
+
# @param [Array] fingerprints SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`.
|
|
2563
2896
|
#
|
|
2564
2897
|
# @return [PlatformAndroid]
|
|
2565
2898
|
def create_android_platform(
|
|
2566
2899
|
platform_id:,
|
|
2567
2900
|
name:,
|
|
2568
|
-
application_id
|
|
2901
|
+
application_id:,
|
|
2902
|
+
fingerprints: nil
|
|
2569
2903
|
)
|
|
2570
2904
|
api_path = '/project/platforms/android'
|
|
2571
2905
|
|
|
@@ -2585,6 +2919,7 @@ module Appwrite
|
|
|
2585
2919
|
platformId: platform_id,
|
|
2586
2920
|
name: name,
|
|
2587
2921
|
applicationId: application_id,
|
|
2922
|
+
fingerprints: fingerprints,
|
|
2588
2923
|
}
|
|
2589
2924
|
|
|
2590
2925
|
api_headers = {
|
|
@@ -2608,12 +2943,14 @@ module Appwrite
|
|
|
2608
2943
|
# @param [String] platform_id Platform ID.
|
|
2609
2944
|
# @param [String] name Platform name. Max length: 128 chars.
|
|
2610
2945
|
# @param [String] application_id Android application ID. Max length: 256 chars.
|
|
2946
|
+
# @param [Array] fingerprints SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`. Omit to keep the current list, or pass an empty array to clear it.
|
|
2611
2947
|
#
|
|
2612
2948
|
# @return [PlatformAndroid]
|
|
2613
2949
|
def update_android_platform(
|
|
2614
2950
|
platform_id:,
|
|
2615
2951
|
name:,
|
|
2616
|
-
application_id
|
|
2952
|
+
application_id:,
|
|
2953
|
+
fingerprints: nil
|
|
2617
2954
|
)
|
|
2618
2955
|
api_path = '/project/platforms/android/{platformId}'
|
|
2619
2956
|
.gsub('{platformId}', platform_id)
|
|
@@ -2633,6 +2970,7 @@ module Appwrite
|
|
|
2633
2970
|
api_params = {
|
|
2634
2971
|
name: name,
|
|
2635
2972
|
applicationId: application_id,
|
|
2973
|
+
fingerprints: fingerprints,
|
|
2636
2974
|
}
|
|
2637
2975
|
|
|
2638
2976
|
api_headers = {
|
|
@@ -3536,6 +3874,82 @@ module Appwrite
|
|
|
3536
3874
|
)
|
|
3537
3875
|
end
|
|
3538
3876
|
|
|
3877
|
+
# Updating this policy allows you to control if passwords are checked against
|
|
3878
|
+
# the Have I Been Pwned breach database. When enabled, every password a user
|
|
3879
|
+
# signs up, signs in or resets with is checked and the result is recorded on
|
|
3880
|
+
# the user as `passwordPwned`. On its own the policy only records. Enable
|
|
3881
|
+
# `users` to reject a breached password when a user signs up or sets a new
|
|
3882
|
+
# password, and `sessions` to refuse a sign-in with a breached password until
|
|
3883
|
+
# it is reset. Only the first five characters of the password hash are ever
|
|
3884
|
+
# shared with the service. Options left out keep their current value.
|
|
3885
|
+
#
|
|
3886
|
+
# @param [] enabled Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use `users` and `sessions` to block. When changing this policy, existing passwords remain valid.
|
|
3887
|
+
# @param [] sessions Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result.
|
|
3888
|
+
# @param [] users Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result.
|
|
3889
|
+
#
|
|
3890
|
+
# @return [Project]
|
|
3891
|
+
def update_password_pwned_policy(
|
|
3892
|
+
enabled: nil,
|
|
3893
|
+
sessions: nil,
|
|
3894
|
+
users: nil
|
|
3895
|
+
)
|
|
3896
|
+
api_path = '/project/policies/password-pwned'
|
|
3897
|
+
|
|
3898
|
+
api_params = {
|
|
3899
|
+
enabled: enabled,
|
|
3900
|
+
sessions: sessions,
|
|
3901
|
+
users: users,
|
|
3902
|
+
}
|
|
3903
|
+
|
|
3904
|
+
api_headers = {
|
|
3905
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3906
|
+
"content-type": 'application/json',
|
|
3907
|
+
"accept": 'application/json',
|
|
3908
|
+
}
|
|
3909
|
+
|
|
3910
|
+
@client.call(
|
|
3911
|
+
method: 'PATCH',
|
|
3912
|
+
path: api_path,
|
|
3913
|
+
headers: api_headers,
|
|
3914
|
+
params: api_params,
|
|
3915
|
+
response_type: Models::Project
|
|
3916
|
+
)
|
|
3917
|
+
end
|
|
3918
|
+
|
|
3919
|
+
# Require a password reset when an email/password sign-in uses a password
|
|
3920
|
+
# older than the configured maximum age. Options left out keep their current
|
|
3921
|
+
# value.
|
|
3922
|
+
#
|
|
3923
|
+
# @param [] enabled Enable password rotation. Disabled by default.
|
|
3924
|
+
# @param [Integer] max_age Maximum password age in seconds. Minimum allowed value is 86400 seconds (1 day), and maximum is 10 years, which is 315360000 seconds. Defaults to 1 year, which is 31536000 seconds.
|
|
3925
|
+
#
|
|
3926
|
+
# @return [Project]
|
|
3927
|
+
def update_password_rotation_policy(
|
|
3928
|
+
enabled: nil,
|
|
3929
|
+
max_age: nil
|
|
3930
|
+
)
|
|
3931
|
+
api_path = '/project/policies/password-rotation'
|
|
3932
|
+
|
|
3933
|
+
api_params = {
|
|
3934
|
+
enabled: enabled,
|
|
3935
|
+
maxAge: max_age,
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
api_headers = {
|
|
3939
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3940
|
+
"content-type": 'application/json',
|
|
3941
|
+
"accept": 'application/json',
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
@client.call(
|
|
3945
|
+
method: 'PATCH',
|
|
3946
|
+
path: api_path,
|
|
3947
|
+
headers: api_headers,
|
|
3948
|
+
params: api_params,
|
|
3949
|
+
response_type: Models::Project
|
|
3950
|
+
)
|
|
3951
|
+
end
|
|
3952
|
+
|
|
3539
3953
|
# Update the password strength requirements for users in the project.
|
|
3540
3954
|
#
|
|
3541
3955
|
# @param [Integer] min Minimum password length. Value must be between 8 and 256. Default is 8.
|
|
@@ -3757,7 +4171,7 @@ module Appwrite
|
|
|
3757
4171
|
#
|
|
3758
4172
|
# @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.
|
|
3759
4173
|
#
|
|
3760
|
-
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyPasskey]
|
|
4174
|
+
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyPasskey]
|
|
3761
4175
|
def get_policy(
|
|
3762
4176
|
policy_id:
|
|
3763
4177
|
)
|
|
@@ -3806,6 +4220,16 @@ module Appwrite
|
|
|
3806
4220
|
return Models::PolicyPasswordPersonalData.from(map: response)
|
|
3807
4221
|
end
|
|
3808
4222
|
|
|
4223
|
+
if response['$id'] == 'password-pwned'
|
|
4224
|
+
|
|
4225
|
+
return Models::PolicyPasswordPwned.from(map: response)
|
|
4226
|
+
end
|
|
4227
|
+
|
|
4228
|
+
if response['$id'] == 'password-rotation'
|
|
4229
|
+
|
|
4230
|
+
return Models::PolicyPasswordRotation.from(map: response)
|
|
4231
|
+
end
|
|
4232
|
+
|
|
3809
4233
|
if response['$id'] == 'session-alert'
|
|
3810
4234
|
|
|
3811
4235
|
return Models::PolicySessionAlert.from(map: response)
|