appwrite-console 0.1.0__py3-none-any.whl
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.
- appwrite_console/__init__.py +1 -0
- appwrite_console/client.py +371 -0
- appwrite_console/encoders/__init__.py +1 -0
- appwrite_console/encoders/value_class_encoder.py +373 -0
- appwrite_console/enums/__init__.py +1 -0
- appwrite_console/enums/account_key_scopes.py +6 -0
- appwrite_console/enums/adapter.py +5 -0
- appwrite_console/enums/addon.py +7 -0
- appwrite_console/enums/appwrite_migration_resource.py +42 -0
- appwrite_console/enums/attribute_status.py +8 -0
- appwrite_console/enums/authentication_factor.py +7 -0
- appwrite_console/enums/authenticator_type.py +4 -0
- appwrite_console/enums/backup_services.py +10 -0
- appwrite_console/enums/billing_plan_group.py +6 -0
- appwrite_console/enums/block_mode.py +5 -0
- appwrite_console/enums/block_resource_type.py +12 -0
- appwrite_console/enums/browser.py +17 -0
- appwrite_console/enums/browser_permission.py +23 -0
- appwrite_console/enums/browser_theme.py +5 -0
- appwrite_console/enums/build_runtime.py +95 -0
- appwrite_console/enums/cache_database.py +6 -0
- appwrite_console/enums/cache_target.py +9 -0
- appwrite_console/enums/column_status.py +8 -0
- appwrite_console/enums/compression.py +6 -0
- appwrite_console/enums/console_resource_type.py +4 -0
- appwrite_console/enums/credit_card.py +20 -0
- appwrite_console/enums/database_status.py +17 -0
- appwrite_console/enums/database_type.py +10 -0
- appwrite_console/enums/databases_index_type.py +7 -0
- appwrite_console/enums/deployment_download_type.py +5 -0
- appwrite_console/enums/deployment_status.py +9 -0
- appwrite_console/enums/detection_framework_type.py +4 -0
- appwrite_console/enums/detection_runtime_type.py +4 -0
- appwrite_console/enums/documents_db_index_type.py +6 -0
- appwrite_console/enums/domain_purchase_status.py +7 -0
- appwrite_console/enums/domain_registration_type.py +7 -0
- appwrite_console/enums/domain_suggestion_type.py +5 -0
- appwrite_console/enums/domain_transfer_status_enum.py +11 -0
- appwrite_console/enums/embedding_model.py +7 -0
- appwrite_console/enums/execution_method.py +10 -0
- appwrite_console/enums/execution_status.py +8 -0
- appwrite_console/enums/execution_trigger.py +6 -0
- appwrite_console/enums/firebase_migration_resource.py +13 -0
- appwrite_console/enums/flag.py +198 -0
- appwrite_console/enums/framework.py +18 -0
- appwrite_console/enums/function_template_use_case.py +10 -0
- appwrite_console/enums/image_format.py +10 -0
- appwrite_console/enums/image_gravity.py +12 -0
- appwrite_console/enums/index_status.py +8 -0
- appwrite_console/enums/message_priority.py +5 -0
- appwrite_console/enums/message_status.py +8 -0
- appwrite_console/enums/messaging_provider_type.py +6 -0
- appwrite_console/enums/n_host_migration_resource.py +14 -0
- appwrite_console/enums/o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/o_auth_provider.py +47 -0
- appwrite_console/enums/on_duplicate.py +6 -0
- appwrite_console/enums/order_by.py +5 -0
- appwrite_console/enums/organization_key_scopes.py +19 -0
- appwrite_console/enums/password_hash.py +14 -0
- appwrite_console/enums/platform.py +5 -0
- appwrite_console/enums/platform_type.py +8 -0
- appwrite_console/enums/project_auth_method_id.py +10 -0
- appwrite_console/enums/project_email_template_id.py +10 -0
- appwrite_console/enums/project_email_template_locale.py +134 -0
- appwrite_console/enums/project_key_scopes.py +107 -0
- appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/project_o_auth_provider_id.py +47 -0
- appwrite_console/enums/project_policy_id.py +17 -0
- appwrite_console/enums/project_protocol_id.py +6 -0
- appwrite_console/enums/project_service_id.py +22 -0
- appwrite_console/enums/project_smtp_secure.py +5 -0
- appwrite_console/enums/project_usage_range.py +5 -0
- appwrite_console/enums/proxy_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_status.py +6 -0
- appwrite_console/enums/query_suggestion_resource.py +97 -0
- appwrite_console/enums/region.py +9 -0
- appwrite_console/enums/relation_mutate.py +6 -0
- appwrite_console/enums/relationship_type.py +7 -0
- appwrite_console/enums/runtime.py +95 -0
- appwrite_console/enums/schedule_resource_type.py +7 -0
- appwrite_console/enums/site_template_use_case.py +12 -0
- appwrite_console/enums/smtp_encryption.py +6 -0
- appwrite_console/enums/status.py +4 -0
- appwrite_console/enums/status_code.py +7 -0
- appwrite_console/enums/supabase_migration_resource.py +14 -0
- appwrite_console/enums/tables_db_index_type.py +7 -0
- appwrite_console/enums/template_reference_type.py +6 -0
- appwrite_console/enums/timezone.py +422 -0
- appwrite_console/enums/usage_range.py +6 -0
- appwrite_console/enums/vcs_detection_type.py +5 -0
- appwrite_console/enums/vcs_reference_type.py +6 -0
- appwrite_console/enums/vectors_db_index_type.py +9 -0
- appwrite_console/enums/waf_rule_action.py +8 -0
- appwrite_console/exception.py +7 -0
- appwrite_console/id.py +26 -0
- appwrite_console/input_file.py +21 -0
- appwrite_console/models/__init__.py +803 -0
- appwrite_console/models/activity_event.py +99 -0
- appwrite_console/models/activity_event_list.py +19 -0
- appwrite_console/models/additional_resource.py +30 -0
- appwrite_console/models/addon.py +42 -0
- appwrite_console/models/addon_list.py +19 -0
- appwrite_console/models/addon_price.py +36 -0
- appwrite_console/models/aggregation_breakdown.py +28 -0
- appwrite_console/models/aggregation_team.py +101 -0
- appwrite_console/models/aggregation_team_list.py +19 -0
- appwrite_console/models/algo_argon2.py +24 -0
- appwrite_console/models/algo_bcrypt.py +15 -0
- appwrite_console/models/algo_md5.py +15 -0
- appwrite_console/models/algo_phpass.py +15 -0
- appwrite_console/models/algo_scrypt.py +27 -0
- appwrite_console/models/algo_scrypt_modified.py +24 -0
- appwrite_console/models/algo_sha.py +15 -0
- appwrite_console/models/app.py +91 -0
- appwrite_console/models/app_installation.py +42 -0
- appwrite_console/models/app_installation_list.py +19 -0
- appwrite_console/models/app_key.py +39 -0
- appwrite_console/models/app_key_list.py +19 -0
- appwrite_console/models/app_scope.py +27 -0
- appwrite_console/models/app_scope_list.py +19 -0
- appwrite_console/models/app_secret.py +39 -0
- appwrite_console/models/app_secret_list.py +19 -0
- appwrite_console/models/app_secret_plaintext.py +39 -0
- appwrite_console/models/apps_list.py +19 -0
- appwrite_console/models/attribute_bigint.py +46 -0
- appwrite_console/models/attribute_boolean.py +40 -0
- appwrite_console/models/attribute_datetime.py +43 -0
- appwrite_console/models/attribute_email.py +43 -0
- appwrite_console/models/attribute_enum.py +46 -0
- appwrite_console/models/attribute_float.py +46 -0
- appwrite_console/models/attribute_integer.py +46 -0
- appwrite_console/models/attribute_ip.py +43 -0
- appwrite_console/models/attribute_line.py +40 -0
- appwrite_console/models/attribute_list.py +36 -0
- appwrite_console/models/attribute_longtext.py +43 -0
- appwrite_console/models/attribute_mediumtext.py +43 -0
- appwrite_console/models/attribute_object.py +37 -0
- appwrite_console/models/attribute_point.py +40 -0
- appwrite_console/models/attribute_polygon.py +40 -0
- appwrite_console/models/attribute_relationship.py +55 -0
- appwrite_console/models/attribute_string.py +46 -0
- appwrite_console/models/attribute_text.py +43 -0
- appwrite_console/models/attribute_url.py +43 -0
- appwrite_console/models/attribute_varchar.py +46 -0
- appwrite_console/models/attribute_vector.py +40 -0
- appwrite_console/models/backup_archive.py +48 -0
- appwrite_console/models/backup_archive_list.py +19 -0
- appwrite_console/models/backup_policy.py +48 -0
- appwrite_console/models/backup_policy_list.py +19 -0
- appwrite_console/models/backup_restoration.py +45 -0
- appwrite_console/models/backup_restoration_list.py +19 -0
- appwrite_console/models/base_model.py +27 -0
- appwrite_console/models/billing_address.py +36 -0
- appwrite_console/models/billing_address_list.py +19 -0
- appwrite_console/models/billing_limits.py +36 -0
- appwrite_console/models/billing_plan.py +226 -0
- appwrite_console/models/billing_plan_addon.py +19 -0
- appwrite_console/models/billing_plan_addon_details.py +36 -0
- appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
- appwrite_console/models/billing_plan_limits.py +18 -0
- appwrite_console/models/billing_plan_list.py +19 -0
- appwrite_console/models/billing_plan_supported_addons.py +21 -0
- appwrite_console/models/block.py +45 -0
- appwrite_console/models/block_delete.py +19 -0
- appwrite_console/models/block_list.py +19 -0
- appwrite_console/models/branch.py +15 -0
- appwrite_console/models/branch_list.py +19 -0
- appwrite_console/models/bucket.py +54 -0
- appwrite_console/models/bucket_list.py +19 -0
- appwrite_console/models/campaign.py +49 -0
- appwrite_console/models/collection.py +67 -0
- appwrite_console/models/collection_list.py +19 -0
- appwrite_console/models/column_bigint.py +46 -0
- appwrite_console/models/column_boolean.py +40 -0
- appwrite_console/models/column_datetime.py +43 -0
- appwrite_console/models/column_email.py +43 -0
- appwrite_console/models/column_enum.py +46 -0
- appwrite_console/models/column_float.py +46 -0
- appwrite_console/models/column_index.py +42 -0
- appwrite_console/models/column_index_list.py +19 -0
- appwrite_console/models/column_integer.py +46 -0
- appwrite_console/models/column_ip.py +43 -0
- appwrite_console/models/column_line.py +40 -0
- appwrite_console/models/column_list.py +36 -0
- appwrite_console/models/column_longtext.py +43 -0
- appwrite_console/models/column_mediumtext.py +43 -0
- appwrite_console/models/column_point.py +40 -0
- appwrite_console/models/column_polygon.py +40 -0
- appwrite_console/models/column_relationship.py +55 -0
- appwrite_console/models/column_string.py +46 -0
- appwrite_console/models/column_text.py +43 -0
- appwrite_console/models/column_url.py +43 -0
- appwrite_console/models/column_varchar.py +46 -0
- appwrite_console/models/console_key_scope.py +24 -0
- appwrite_console/models/console_key_scope_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider.py +19 -0
- appwrite_console/models/console_o_auth2_provider_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
- appwrite_console/models/console_region.py +30 -0
- appwrite_console/models/console_region_list.py +19 -0
- appwrite_console/models/console_variables.py +96 -0
- appwrite_console/models/continent.py +18 -0
- appwrite_console/models/continent_list.py +19 -0
- appwrite_console/models/country.py +18 -0
- appwrite_console/models/country_list.py +19 -0
- appwrite_console/models/coupon.py +36 -0
- appwrite_console/models/credit.py +45 -0
- appwrite_console/models/credit_available.py +15 -0
- appwrite_console/models/credit_list.py +22 -0
- appwrite_console/models/currency.py +33 -0
- appwrite_console/models/currency_list.py +19 -0
- appwrite_console/models/database.py +52 -0
- appwrite_console/models/database_list.py +19 -0
- appwrite_console/models/database_migration.py +57 -0
- appwrite_console/models/database_migration_list.py +19 -0
- appwrite_console/models/database_status.py +57 -0
- appwrite_console/models/database_status_connections.py +18 -0
- appwrite_console/models/database_status_replica.py +24 -0
- appwrite_console/models/database_status_volume.py +24 -0
- appwrite_console/models/dedicated_database.py +159 -0
- appwrite_console/models/dedicated_database_backup.py +63 -0
- appwrite_console/models/dedicated_database_backup_list.py +19 -0
- appwrite_console/models/dedicated_database_backup_storage.py +27 -0
- appwrite_console/models/dedicated_database_branch.py +48 -0
- appwrite_console/models/dedicated_database_branch_list.py +16 -0
- appwrite_console/models/dedicated_database_execution.py +31 -0
- appwrite_console/models/dedicated_database_execution_column.py +18 -0
- appwrite_console/models/dedicated_database_extensions.py +22 -0
- appwrite_console/models/dedicated_database_list.py +19 -0
- appwrite_console/models/dedicated_database_member.py +24 -0
- appwrite_console/models/dedicated_database_operation.py +45 -0
- appwrite_console/models/dedicated_database_operation_list.py +19 -0
- appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
- appwrite_console/models/dedicated_database_pooler.py +42 -0
- appwrite_console/models/dedicated_database_replicas.py +37 -0
- appwrite_console/models/dedicated_database_restoration.py +45 -0
- appwrite_console/models/dedicated_database_restoration_list.py +19 -0
- appwrite_console/models/dedicated_database_specification.py +39 -0
- appwrite_console/models/dedicated_database_specification_list.py +23 -0
- appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
- appwrite_console/models/deployment.py +94 -0
- appwrite_console/models/deployment_list.py +19 -0
- appwrite_console/models/detection_framework.py +32 -0
- appwrite_console/models/detection_runtime.py +29 -0
- appwrite_console/models/detection_variable.py +18 -0
- appwrite_console/models/dev_key.py +36 -0
- appwrite_console/models/dev_key_list.py +19 -0
- appwrite_console/models/dns_record.py +48 -0
- appwrite_console/models/dns_records_list.py +19 -0
- appwrite_console/models/document.py +80 -0
- appwrite_console/models/document_list.py +32 -0
- appwrite_console/models/domain.py +53 -0
- appwrite_console/models/domain_price.py +30 -0
- appwrite_console/models/domain_purchase.py +43 -0
- appwrite_console/models/domain_suggestion.py +24 -0
- appwrite_console/models/domain_suggestions_list.py +19 -0
- appwrite_console/models/domain_transfer_out.py +15 -0
- appwrite_console/models/domain_transfer_status.py +22 -0
- appwrite_console/models/domains_list.py +19 -0
- appwrite_console/models/downgrade_feedback.py +42 -0
- appwrite_console/models/email_template.py +36 -0
- appwrite_console/models/email_template_list.py +19 -0
- appwrite_console/models/embedding.py +24 -0
- appwrite_console/models/embedding_list.py +19 -0
- appwrite_console/models/ephemeral_key.py +39 -0
- appwrite_console/models/estimation.py +37 -0
- appwrite_console/models/estimation_delete_organization.py +16 -0
- appwrite_console/models/estimation_item.py +18 -0
- appwrite_console/models/estimation_plan_change.py +29 -0
- appwrite_console/models/estimation_update_plan.py +40 -0
- appwrite_console/models/execution.py +69 -0
- appwrite_console/models/execution_list.py +19 -0
- appwrite_console/models/file.py +60 -0
- appwrite_console/models/file_list.py +19 -0
- appwrite_console/models/framework.py +28 -0
- appwrite_console/models/framework_adapter.py +27 -0
- appwrite_console/models/framework_list.py +19 -0
- appwrite_console/models/function.py +109 -0
- appwrite_console/models/function_list.py +19 -0
- appwrite_console/models/headers.py +18 -0
- appwrite_console/models/identity.py +42 -0
- appwrite_console/models/identity_list.py +19 -0
- appwrite_console/models/index.py +43 -0
- appwrite_console/models/index_list.py +19 -0
- appwrite_console/models/insight.py +64 -0
- appwrite_console/models/insight_cta.py +24 -0
- appwrite_console/models/insight_list.py +19 -0
- appwrite_console/models/installation.py +30 -0
- appwrite_console/models/installation_list.py +19 -0
- appwrite_console/models/invoice.py +82 -0
- appwrite_console/models/invoice_list.py +19 -0
- appwrite_console/models/jwt.py +15 -0
- appwrite_console/models/key.py +39 -0
- appwrite_console/models/key_list.py +19 -0
- appwrite_console/models/language.py +21 -0
- appwrite_console/models/language_list.py +19 -0
- appwrite_console/models/locale.py +66 -0
- appwrite_console/models/locale_code.py +18 -0
- appwrite_console/models/locale_code_list.py +19 -0
- appwrite_console/models/log.py +78 -0
- appwrite_console/models/log_list.py +19 -0
- appwrite_console/models/membership.py +57 -0
- appwrite_console/models/membership_list.py +19 -0
- appwrite_console/models/message.py +52 -0
- appwrite_console/models/message_list.py +19 -0
- appwrite_console/models/metric.py +18 -0
- appwrite_console/models/metric_breakdown.py +24 -0
- appwrite_console/models/mfa_challenge.py +24 -0
- appwrite_console/models/mfa_factors.py +24 -0
- appwrite_console/models/mfa_recovery_codes.py +15 -0
- appwrite_console/models/mfa_type.py +18 -0
- appwrite_console/models/migration.py +75 -0
- appwrite_console/models/migration_list.py +19 -0
- appwrite_console/models/migration_report.py +96 -0
- appwrite_console/models/mock_number.py +24 -0
- appwrite_console/models/mock_number_list.py +19 -0
- appwrite_console/models/notification.py +60 -0
- appwrite_console/models/notification_list.py +19 -0
- appwrite_console/models/o_auth2_amazon.py +24 -0
- appwrite_console/models/o_auth2_apple.py +30 -0
- appwrite_console/models/o_auth2_appwrite.py +24 -0
- appwrite_console/models/o_auth2_auth0.py +27 -0
- appwrite_console/models/o_auth2_authentik.py +27 -0
- appwrite_console/models/o_auth2_autodesk.py +24 -0
- appwrite_console/models/o_auth2_bitbucket.py +24 -0
- appwrite_console/models/o_auth2_bitly.py +24 -0
- appwrite_console/models/o_auth2_box.py +24 -0
- appwrite_console/models/o_auth2_dailymotion.py +24 -0
- appwrite_console/models/o_auth2_discord.py +24 -0
- appwrite_console/models/o_auth2_disqus.py +24 -0
- appwrite_console/models/o_auth2_dropbox.py +24 -0
- appwrite_console/models/o_auth2_etsy.py +24 -0
- appwrite_console/models/o_auth2_facebook.py +24 -0
- appwrite_console/models/o_auth2_figma.py +24 -0
- appwrite_console/models/o_auth2_fusion_auth.py +27 -0
- appwrite_console/models/o_auth2_github.py +24 -0
- appwrite_console/models/o_auth2_gitlab.py +27 -0
- appwrite_console/models/o_auth2_google.py +28 -0
- appwrite_console/models/o_auth2_keycloak.py +30 -0
- appwrite_console/models/o_auth2_kick.py +24 -0
- appwrite_console/models/o_auth2_linkedin.py +24 -0
- appwrite_console/models/o_auth2_microsoft.py +27 -0
- appwrite_console/models/o_auth2_notion.py +24 -0
- appwrite_console/models/o_auth2_oidc.py +43 -0
- appwrite_console/models/o_auth2_okta.py +30 -0
- appwrite_console/models/o_auth2_paypal.py +24 -0
- appwrite_console/models/o_auth2_podio.py +24 -0
- appwrite_console/models/o_auth2_provider_list.py +59 -0
- appwrite_console/models/o_auth2_salesforce.py +24 -0
- appwrite_console/models/o_auth2_slack.py +24 -0
- appwrite_console/models/o_auth2_spotify.py +24 -0
- appwrite_console/models/o_auth2_stripe.py +24 -0
- appwrite_console/models/o_auth2_tradeshift.py +24 -0
- appwrite_console/models/o_auth2_twitch.py +24 -0
- appwrite_console/models/o_auth2_word_press.py +24 -0
- appwrite_console/models/o_auth2_x.py +24 -0
- appwrite_console/models/o_auth2_yahoo.py +24 -0
- appwrite_console/models/o_auth2_yandex.py +24 -0
- appwrite_console/models/o_auth2_zoho.py +24 -0
- appwrite_console/models/o_auth2_zoom.py +24 -0
- appwrite_console/models/oauth2_approve.py +15 -0
- appwrite_console/models/oauth2_authorize.py +18 -0
- appwrite_console/models/oauth2_consent.py +42 -0
- appwrite_console/models/oauth2_consent_list.py +19 -0
- appwrite_console/models/oauth2_consent_token.py +45 -0
- appwrite_console/models/oauth2_consent_token_list.py +19 -0
- appwrite_console/models/oauth2_device_authorization.py +30 -0
- appwrite_console/models/oauth2_grant.py +48 -0
- appwrite_console/models/oauth2_organization.py +15 -0
- appwrite_console/models/oauth2_organization_list.py +19 -0
- appwrite_console/models/oauth2_par.py +18 -0
- appwrite_console/models/oauth2_project.py +21 -0
- appwrite_console/models/oauth2_project_list.py +19 -0
- appwrite_console/models/oauth2_reject.py +15 -0
- appwrite_console/models/oauth2_token.py +33 -0
- appwrite_console/models/organization.py +132 -0
- appwrite_console/models/organization_list.py +32 -0
- appwrite_console/models/payment_authentication.py +30 -0
- appwrite_console/models/payment_method.py +72 -0
- appwrite_console/models/payment_method_list.py +19 -0
- appwrite_console/models/phone.py +21 -0
- appwrite_console/models/phone_list.py +19 -0
- appwrite_console/models/plan_change_estimation_details.py +39 -0
- appwrite_console/models/plan_change_limits.py +28 -0
- appwrite_console/models/plan_change_project_compliance.py +28 -0
- appwrite_console/models/plan_change_resource_compliance.py +30 -0
- appwrite_console/models/platform_android.py +31 -0
- appwrite_console/models/platform_apple.py +31 -0
- appwrite_console/models/platform_linux.py +31 -0
- appwrite_console/models/platform_list.py +23 -0
- appwrite_console/models/platform_web.py +31 -0
- appwrite_console/models/platform_windows.py +31 -0
- appwrite_console/models/policy_deny_aliased_email.py +18 -0
- appwrite_console/models/policy_deny_corporate_email.py +18 -0
- appwrite_console/models/policy_deny_disposable_email.py +18 -0
- appwrite_console/models/policy_deny_free_email.py +18 -0
- appwrite_console/models/policy_list.py +32 -0
- appwrite_console/models/policy_membership_privacy.py +33 -0
- appwrite_console/models/policy_password_dictionary.py +18 -0
- appwrite_console/models/policy_password_history.py +18 -0
- appwrite_console/models/policy_password_personal_data.py +18 -0
- appwrite_console/models/policy_password_strength.py +30 -0
- appwrite_console/models/policy_session_alert.py +18 -0
- appwrite_console/models/policy_session_duration.py +18 -0
- appwrite_console/models/policy_session_invalidation.py +18 -0
- appwrite_console/models/policy_session_limit.py +18 -0
- appwrite_console/models/policy_user_limit.py +18 -0
- appwrite_console/models/postgres_extension.py +24 -0
- appwrite_console/models/postgres_extension_list.py +19 -0
- appwrite_console/models/preferences.py +52 -0
- appwrite_console/models/presence.py +39 -0
- appwrite_console/models/presence_list.py +19 -0
- appwrite_console/models/program.py +39 -0
- appwrite_console/models/project.py +153 -0
- appwrite_console/models/project_auth_method.py +19 -0
- appwrite_console/models/project_list.py +19 -0
- appwrite_console/models/project_protocol.py +19 -0
- appwrite_console/models/project_service.py +19 -0
- appwrite_console/models/provider.py +39 -0
- appwrite_console/models/provider_list.py +19 -0
- appwrite_console/models/provider_repository.py +42 -0
- appwrite_console/models/provider_repository_framework.py +45 -0
- appwrite_console/models/provider_repository_framework_list.py +22 -0
- appwrite_console/models/provider_repository_runtime.py +45 -0
- appwrite_console/models/provider_repository_runtime_list.py +22 -0
- appwrite_console/models/proxy_rule.py +59 -0
- appwrite_console/models/proxy_rule_list.py +19 -0
- appwrite_console/models/report.py +49 -0
- appwrite_console/models/report_list.py +19 -0
- appwrite_console/models/resource_token.py +33 -0
- appwrite_console/models/resource_token_list.py +19 -0
- appwrite_console/models/review.py +24 -0
- appwrite_console/models/roles.py +18 -0
- appwrite_console/models/row.py +80 -0
- appwrite_console/models/row_list.py +32 -0
- appwrite_console/models/runtime.py +36 -0
- appwrite_console/models/runtime_list.py +19 -0
- appwrite_console/models/schedule.py +45 -0
- appwrite_console/models/schedule_list.py +19 -0
- appwrite_console/models/session.py +99 -0
- appwrite_console/models/session_list.py +19 -0
- appwrite_console/models/site.py +115 -0
- appwrite_console/models/site_list.py +19 -0
- appwrite_console/models/specification.py +24 -0
- appwrite_console/models/specification_list.py +19 -0
- appwrite_console/models/stage.py +27 -0
- appwrite_console/models/stage_list.py +16 -0
- appwrite_console/models/subscriber.py +40 -0
- appwrite_console/models/subscriber_list.py +19 -0
- appwrite_console/models/table.py +67 -0
- appwrite_console/models/table_list.py +19 -0
- appwrite_console/models/target.py +39 -0
- appwrite_console/models/target_list.py +19 -0
- appwrite_console/models/team.py +43 -0
- appwrite_console/models/team_list.py +32 -0
- appwrite_console/models/template_framework.py +39 -0
- appwrite_console/models/template_function.py +65 -0
- appwrite_console/models/template_function_list.py +19 -0
- appwrite_console/models/template_runtime.py +24 -0
- appwrite_console/models/template_site.py +53 -0
- appwrite_console/models/template_site_list.py +19 -0
- appwrite_console/models/template_variable.py +33 -0
- appwrite_console/models/token.py +30 -0
- appwrite_console/models/topic.py +36 -0
- appwrite_console/models/topic_list.py +19 -0
- appwrite_console/models/transaction.py +30 -0
- appwrite_console/models/transaction_list.py +19 -0
- appwrite_console/models/usage_billing_plan.py +46 -0
- appwrite_console/models/usage_data_point.py +99 -0
- appwrite_console/models/usage_event_list.py +19 -0
- appwrite_console/models/usage_gauge_list.py +19 -0
- appwrite_console/models/usage_metric.py +19 -0
- appwrite_console/models/usage_organization.py +104 -0
- appwrite_console/models/usage_organization_project.py +73 -0
- appwrite_console/models/usage_presence.py +22 -0
- appwrite_console/models/usage_project.py +218 -0
- appwrite_console/models/usage_resources.py +36 -0
- appwrite_console/models/usage_users.py +28 -0
- appwrite_console/models/user.py +111 -0
- appwrite_console/models/user_list.py +32 -0
- appwrite_console/models/variable.py +36 -0
- appwrite_console/models/variable_list.py +19 -0
- appwrite_console/models/vcs_content.py +21 -0
- appwrite_console/models/vcs_content_list.py +19 -0
- appwrite_console/models/vcs_namespace.py +27 -0
- appwrite_console/models/vcs_namespace_list.py +19 -0
- appwrite_console/models/vectorsdb_collection.py +54 -0
- appwrite_console/models/vectorsdb_collection_list.py +19 -0
- appwrite_console/models/waf_rule.py +55 -0
- appwrite_console/models/waf_rule_bypass.py +55 -0
- appwrite_console/models/waf_rule_challenge.py +64 -0
- appwrite_console/models/waf_rule_deny.py +55 -0
- appwrite_console/models/waf_rule_list.py +19 -0
- appwrite_console/models/waf_rule_rate_limit.py +64 -0
- appwrite_console/models/waf_rule_redirect.py +61 -0
- appwrite_console/models/webhook.py +51 -0
- appwrite_console/models/webhook_list.py +19 -0
- appwrite_console/operator.py +150 -0
- appwrite_console/permission.py +21 -0
- appwrite_console/query.py +293 -0
- appwrite_console/role.py +111 -0
- appwrite_console/service.py +50 -0
- appwrite_console/services/__init__.py +1 -0
- appwrite_console/services/account.py +3328 -0
- appwrite_console/services/activities.py +89 -0
- appwrite_console/services/advisor.py +234 -0
- appwrite_console/services/apps.py +1156 -0
- appwrite_console/services/assistant.py +50 -0
- appwrite_console/services/avatars.py +531 -0
- appwrite_console/services/backups.py +572 -0
- appwrite_console/services/console.py +807 -0
- appwrite_console/services/databases.py +4976 -0
- appwrite_console/services/documents_db.py +2052 -0
- appwrite_console/services/domains.py +3047 -0
- appwrite_console/services/functions.py +1659 -0
- appwrite_console/services/graphql.py +92 -0
- appwrite_console/services/locale.py +243 -0
- appwrite_console/services/manager.py +301 -0
- appwrite_console/services/messaging.py +3137 -0
- appwrite_console/services/migrations.py +1036 -0
- appwrite_console/services/mongo.py +1683 -0
- appwrite_console/services/mysql.py +1861 -0
- appwrite_console/services/notifications.py +98 -0
- appwrite_console/services/oauth2.py +914 -0
- appwrite_console/services/organization.py +1039 -0
- appwrite_console/services/organizations.py +2245 -0
- appwrite_console/services/postgresql.py +1995 -0
- appwrite_console/services/presences.py +309 -0
- appwrite_console/services/project.py +5271 -0
- appwrite_console/services/projects.py +885 -0
- appwrite_console/services/proxy.py +394 -0
- appwrite_console/services/sites.py +1593 -0
- appwrite_console/services/storage.py +818 -0
- appwrite_console/services/tables_db.py +5189 -0
- appwrite_console/services/teams.py +993 -0
- appwrite_console/services/tokens.py +243 -0
- appwrite_console/services/usage.py +194 -0
- appwrite_console/services/users.py +2314 -0
- appwrite_console/services/vcs.py +599 -0
- appwrite_console/services/vectors_db.py +2054 -0
- appwrite_console/services/waf.py +1014 -0
- appwrite_console/services/webhooks.py +344 -0
- appwrite_console/utils/__init__.py +1 -0
- appwrite_console/utils/deprecated.py +51 -0
- appwrite_console-0.1.0.dist-info/METADATA +189 -0
- appwrite_console-0.1.0.dist-info/RECORD +552 -0
- appwrite_console-0.1.0.dist-info/WHEEL +5 -0
- appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
- appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
from ..service import Service
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
|
4
|
+
from ..exception import AppwriteException
|
|
5
|
+
from appwrite_console.utils.deprecated import deprecated
|
|
6
|
+
from ..models.oauth2_approve import Oauth2Approve
|
|
7
|
+
from ..models.oauth2_authorize import Oauth2Authorize
|
|
8
|
+
from ..models.oauth2_device_authorization import Oauth2DeviceAuthorization
|
|
9
|
+
from ..models.oauth2_grant import Oauth2Grant
|
|
10
|
+
from ..models.oauth2_organization_list import Oauth2OrganizationList
|
|
11
|
+
from ..models.oauth2_par import Oauth2PAR
|
|
12
|
+
from ..models.oauth2_project_list import Oauth2ProjectList
|
|
13
|
+
from ..models.oauth2_reject import Oauth2Reject
|
|
14
|
+
from ..models.oauth2_token import Oauth2Token
|
|
15
|
+
|
|
16
|
+
class Oauth2(Service):
|
|
17
|
+
|
|
18
|
+
def __init__(self, client) -> None:
|
|
19
|
+
super(Oauth2, self).__init__(client)
|
|
20
|
+
|
|
21
|
+
def approve(
|
|
22
|
+
self,
|
|
23
|
+
grant_id: str,
|
|
24
|
+
authorization_details: Optional[str] = None,
|
|
25
|
+
scope: Optional[str] = None
|
|
26
|
+
) -> Oauth2Approve:
|
|
27
|
+
"""
|
|
28
|
+
Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
grant_id : str
|
|
33
|
+
Grant ID made during authorization, provided to consent screen in URL search params.
|
|
34
|
+
authorization_details : Optional[str]
|
|
35
|
+
Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details.
|
|
36
|
+
scope : Optional[str]
|
|
37
|
+
Space-separated scopes the user consented to. Must be a subset of the scopes originally requested; identity scopes such as `openid` are always retained. Optional; omit to keep the originally requested scopes.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
Oauth2Approve
|
|
42
|
+
API response as a typed Pydantic model
|
|
43
|
+
|
|
44
|
+
Raises
|
|
45
|
+
------
|
|
46
|
+
AppwriteException
|
|
47
|
+
If API request fails
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
api_path = '/oauth2/{project_id}/approve'
|
|
51
|
+
api_params = {}
|
|
52
|
+
if grant_id is None:
|
|
53
|
+
raise AppwriteException('Missing required parameter: "grant_id"')
|
|
54
|
+
|
|
55
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
56
|
+
|
|
57
|
+
api_params['grant_id'] = self._normalize_value(grant_id)
|
|
58
|
+
if authorization_details is not None:
|
|
59
|
+
api_params['authorization_details'] = self._normalize_value(authorization_details)
|
|
60
|
+
if scope is not None:
|
|
61
|
+
api_params['scope'] = self._normalize_value(scope)
|
|
62
|
+
|
|
63
|
+
response = self.client.call('post', api_path, {
|
|
64
|
+
'content-type': 'application/json',
|
|
65
|
+
'accept': 'application/json',
|
|
66
|
+
}, api_params)
|
|
67
|
+
|
|
68
|
+
return self._parse_response(response, model=Oauth2Approve)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def authorize(
|
|
72
|
+
self,
|
|
73
|
+
client_id: Optional[str] = None,
|
|
74
|
+
redirect_uri: Optional[str] = None,
|
|
75
|
+
response_type: Optional[str] = None,
|
|
76
|
+
scope: Optional[str] = None,
|
|
77
|
+
state: Optional[str] = None,
|
|
78
|
+
nonce: Optional[str] = None,
|
|
79
|
+
code_challenge: Optional[str] = None,
|
|
80
|
+
code_challenge_method: Optional[str] = None,
|
|
81
|
+
prompt: Optional[str] = None,
|
|
82
|
+
max_age: Optional[float] = None,
|
|
83
|
+
authorization_details: Optional[str] = None,
|
|
84
|
+
resource: Optional[str] = None,
|
|
85
|
+
audience: Optional[str] = None,
|
|
86
|
+
request_uri: Optional[str] = None
|
|
87
|
+
) -> Oauth2Authorize:
|
|
88
|
+
"""
|
|
89
|
+
Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
|
|
90
|
+
|
|
91
|
+
Parameters
|
|
92
|
+
----------
|
|
93
|
+
client_id : Optional[str]
|
|
94
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
95
|
+
redirect_uri : Optional[str]
|
|
96
|
+
Redirect URI where visitor will be redirected after authorization, whether successful or not.
|
|
97
|
+
response_type : Optional[str]
|
|
98
|
+
OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow).
|
|
99
|
+
scope : Optional[str]
|
|
100
|
+
Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`.
|
|
101
|
+
state : Optional[str]
|
|
102
|
+
OAuth2 state. You receive this back in the redirect URI.
|
|
103
|
+
nonce : Optional[str]
|
|
104
|
+
OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`.
|
|
105
|
+
code_challenge : Optional[str]
|
|
106
|
+
PKCE code challenge. Required when OAuth2 app is public.
|
|
107
|
+
code_challenge_method : Optional[str]
|
|
108
|
+
PKCE code challenge method. Required when OAuth2 app is public.
|
|
109
|
+
prompt : Optional[str]
|
|
110
|
+
OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
|
|
111
|
+
max_age : Optional[float]
|
|
112
|
+
OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.
|
|
113
|
+
authorization_details : Optional[str]
|
|
114
|
+
Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
115
|
+
resource : Optional[str]
|
|
116
|
+
RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
117
|
+
audience : Optional[str]
|
|
118
|
+
Compatibility alias for a single OAuth2 resource indicator URI.
|
|
119
|
+
request_uri : Optional[str]
|
|
120
|
+
OAuth2 authorization request handle returned by the pushed authorization request endpoint.
|
|
121
|
+
|
|
122
|
+
Returns
|
|
123
|
+
-------
|
|
124
|
+
Oauth2Authorize
|
|
125
|
+
API response as a typed Pydantic model
|
|
126
|
+
|
|
127
|
+
Raises
|
|
128
|
+
------
|
|
129
|
+
AppwriteException
|
|
130
|
+
If API request fails
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
api_path = '/oauth2/{project_id}/authorize'
|
|
134
|
+
api_params = {}
|
|
135
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
136
|
+
|
|
137
|
+
if client_id is not None:
|
|
138
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
139
|
+
if redirect_uri is not None:
|
|
140
|
+
api_params['redirect_uri'] = self._normalize_value(redirect_uri)
|
|
141
|
+
if response_type is not None:
|
|
142
|
+
api_params['response_type'] = self._normalize_value(response_type)
|
|
143
|
+
if scope is not None:
|
|
144
|
+
api_params['scope'] = self._normalize_value(scope)
|
|
145
|
+
if state is not None:
|
|
146
|
+
api_params['state'] = self._normalize_value(state)
|
|
147
|
+
if nonce is not None:
|
|
148
|
+
api_params['nonce'] = self._normalize_value(nonce)
|
|
149
|
+
if code_challenge is not None:
|
|
150
|
+
api_params['code_challenge'] = self._normalize_value(code_challenge)
|
|
151
|
+
if code_challenge_method is not None:
|
|
152
|
+
api_params['code_challenge_method'] = self._normalize_value(code_challenge_method)
|
|
153
|
+
if prompt is not None:
|
|
154
|
+
api_params['prompt'] = self._normalize_value(prompt)
|
|
155
|
+
if max_age is not None:
|
|
156
|
+
api_params['max_age'] = self._normalize_value(max_age)
|
|
157
|
+
if authorization_details is not None:
|
|
158
|
+
api_params['authorization_details'] = self._normalize_value(authorization_details)
|
|
159
|
+
if resource is not None:
|
|
160
|
+
api_params['resource'] = self._normalize_value(resource)
|
|
161
|
+
if audience is not None:
|
|
162
|
+
api_params['audience'] = self._normalize_value(audience)
|
|
163
|
+
if request_uri is not None:
|
|
164
|
+
api_params['request_uri'] = self._normalize_value(request_uri)
|
|
165
|
+
|
|
166
|
+
response = self.client.call('get', api_path, {
|
|
167
|
+
'accept': 'application/json',
|
|
168
|
+
}, api_params)
|
|
169
|
+
|
|
170
|
+
return self._parse_response(response, model=Oauth2Authorize)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def authorize_post(
|
|
174
|
+
self,
|
|
175
|
+
client_id: Optional[str] = None,
|
|
176
|
+
redirect_uri: Optional[str] = None,
|
|
177
|
+
response_type: Optional[str] = None,
|
|
178
|
+
scope: Optional[str] = None,
|
|
179
|
+
state: Optional[str] = None,
|
|
180
|
+
nonce: Optional[str] = None,
|
|
181
|
+
code_challenge: Optional[str] = None,
|
|
182
|
+
code_challenge_method: Optional[str] = None,
|
|
183
|
+
prompt: Optional[str] = None,
|
|
184
|
+
max_age: Optional[float] = None,
|
|
185
|
+
authorization_details: Optional[str] = None,
|
|
186
|
+
resource: Optional[str] = None,
|
|
187
|
+
audience: Optional[str] = None,
|
|
188
|
+
request_uri: Optional[str] = None
|
|
189
|
+
) -> Oauth2Authorize:
|
|
190
|
+
"""
|
|
191
|
+
Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
|
|
192
|
+
|
|
193
|
+
Parameters
|
|
194
|
+
----------
|
|
195
|
+
client_id : Optional[str]
|
|
196
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
197
|
+
redirect_uri : Optional[str]
|
|
198
|
+
Redirect URI where visitor will be redirected after authorization, whether successful or not.
|
|
199
|
+
response_type : Optional[str]
|
|
200
|
+
OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow).
|
|
201
|
+
scope : Optional[str]
|
|
202
|
+
Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`.
|
|
203
|
+
state : Optional[str]
|
|
204
|
+
OAuth2 state. You receive this back in the redirect URI.
|
|
205
|
+
nonce : Optional[str]
|
|
206
|
+
OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`.
|
|
207
|
+
code_challenge : Optional[str]
|
|
208
|
+
PKCE code challenge. Required when OAuth2 app is public.
|
|
209
|
+
code_challenge_method : Optional[str]
|
|
210
|
+
PKCE code challenge method. Required when OAuth2 app is public.
|
|
211
|
+
prompt : Optional[str]
|
|
212
|
+
OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
|
|
213
|
+
max_age : Optional[float]
|
|
214
|
+
OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.
|
|
215
|
+
authorization_details : Optional[str]
|
|
216
|
+
Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
217
|
+
resource : Optional[str]
|
|
218
|
+
RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
219
|
+
audience : Optional[str]
|
|
220
|
+
Compatibility alias for a single OAuth2 resource indicator URI.
|
|
221
|
+
request_uri : Optional[str]
|
|
222
|
+
OAuth2 authorization request handle returned by the pushed authorization request endpoint.
|
|
223
|
+
|
|
224
|
+
Returns
|
|
225
|
+
-------
|
|
226
|
+
Oauth2Authorize
|
|
227
|
+
API response as a typed Pydantic model
|
|
228
|
+
|
|
229
|
+
Raises
|
|
230
|
+
------
|
|
231
|
+
AppwriteException
|
|
232
|
+
If API request fails
|
|
233
|
+
"""
|
|
234
|
+
|
|
235
|
+
api_path = '/oauth2/{project_id}/authorize'
|
|
236
|
+
api_params = {}
|
|
237
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
238
|
+
|
|
239
|
+
if client_id is not None:
|
|
240
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
241
|
+
if redirect_uri is not None:
|
|
242
|
+
api_params['redirect_uri'] = self._normalize_value(redirect_uri)
|
|
243
|
+
if response_type is not None:
|
|
244
|
+
api_params['response_type'] = self._normalize_value(response_type)
|
|
245
|
+
if scope is not None:
|
|
246
|
+
api_params['scope'] = self._normalize_value(scope)
|
|
247
|
+
if state is not None:
|
|
248
|
+
api_params['state'] = self._normalize_value(state)
|
|
249
|
+
if nonce is not None:
|
|
250
|
+
api_params['nonce'] = self._normalize_value(nonce)
|
|
251
|
+
if code_challenge is not None:
|
|
252
|
+
api_params['code_challenge'] = self._normalize_value(code_challenge)
|
|
253
|
+
if code_challenge_method is not None:
|
|
254
|
+
api_params['code_challenge_method'] = self._normalize_value(code_challenge_method)
|
|
255
|
+
if prompt is not None:
|
|
256
|
+
api_params['prompt'] = self._normalize_value(prompt)
|
|
257
|
+
if max_age is not None:
|
|
258
|
+
api_params['max_age'] = self._normalize_value(max_age)
|
|
259
|
+
if authorization_details is not None:
|
|
260
|
+
api_params['authorization_details'] = self._normalize_value(authorization_details)
|
|
261
|
+
if resource is not None:
|
|
262
|
+
api_params['resource'] = self._normalize_value(resource)
|
|
263
|
+
if audience is not None:
|
|
264
|
+
api_params['audience'] = self._normalize_value(audience)
|
|
265
|
+
if request_uri is not None:
|
|
266
|
+
api_params['request_uri'] = self._normalize_value(request_uri)
|
|
267
|
+
|
|
268
|
+
response = self.client.call('post', api_path, {
|
|
269
|
+
'content-type': 'application/json',
|
|
270
|
+
'accept': 'application/json',
|
|
271
|
+
}, api_params)
|
|
272
|
+
|
|
273
|
+
return self._parse_response(response, model=Oauth2Authorize)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def create_device_authorization(
|
|
277
|
+
self,
|
|
278
|
+
client_id: Optional[str] = None,
|
|
279
|
+
scope: Optional[str] = None,
|
|
280
|
+
authorization_details: Optional[str] = None,
|
|
281
|
+
resource: Optional[str] = None,
|
|
282
|
+
audience: Optional[str] = None
|
|
283
|
+
) -> Oauth2DeviceAuthorization:
|
|
284
|
+
"""
|
|
285
|
+
Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.
|
|
286
|
+
|
|
287
|
+
Parameters
|
|
288
|
+
----------
|
|
289
|
+
client_id : Optional[str]
|
|
290
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
291
|
+
scope : Optional[str]
|
|
292
|
+
Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
|
|
293
|
+
authorization_details : Optional[str]
|
|
294
|
+
Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
295
|
+
resource : Optional[str]
|
|
296
|
+
RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
297
|
+
audience : Optional[str]
|
|
298
|
+
Compatibility alias for a single OAuth2 resource indicator URI.
|
|
299
|
+
|
|
300
|
+
Returns
|
|
301
|
+
-------
|
|
302
|
+
Oauth2DeviceAuthorization
|
|
303
|
+
API response as a typed Pydantic model
|
|
304
|
+
|
|
305
|
+
Raises
|
|
306
|
+
------
|
|
307
|
+
AppwriteException
|
|
308
|
+
If API request fails
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
api_path = '/oauth2/{project_id}/device_authorization'
|
|
312
|
+
api_params = {}
|
|
313
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
314
|
+
|
|
315
|
+
if client_id is not None:
|
|
316
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
317
|
+
if scope is not None:
|
|
318
|
+
api_params['scope'] = self._normalize_value(scope)
|
|
319
|
+
if authorization_details is not None:
|
|
320
|
+
api_params['authorization_details'] = self._normalize_value(authorization_details)
|
|
321
|
+
if resource is not None:
|
|
322
|
+
api_params['resource'] = self._normalize_value(resource)
|
|
323
|
+
if audience is not None:
|
|
324
|
+
api_params['audience'] = self._normalize_value(audience)
|
|
325
|
+
|
|
326
|
+
response = self.client.call('post', api_path, {
|
|
327
|
+
'content-type': 'application/json',
|
|
328
|
+
'accept': 'application/json',
|
|
329
|
+
}, api_params)
|
|
330
|
+
|
|
331
|
+
return self._parse_response(response, model=Oauth2DeviceAuthorization)
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
def create_grant(
|
|
335
|
+
self,
|
|
336
|
+
user_code: str
|
|
337
|
+
) -> Oauth2Grant:
|
|
338
|
+
"""
|
|
339
|
+
Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow.
|
|
340
|
+
|
|
341
|
+
Parameters
|
|
342
|
+
----------
|
|
343
|
+
user_code : str
|
|
344
|
+
User code displayed on the device.
|
|
345
|
+
|
|
346
|
+
Returns
|
|
347
|
+
-------
|
|
348
|
+
Oauth2Grant
|
|
349
|
+
API response as a typed Pydantic model
|
|
350
|
+
|
|
351
|
+
Raises
|
|
352
|
+
------
|
|
353
|
+
AppwriteException
|
|
354
|
+
If API request fails
|
|
355
|
+
"""
|
|
356
|
+
|
|
357
|
+
api_path = '/oauth2/{project_id}/grants'
|
|
358
|
+
api_params = {}
|
|
359
|
+
if user_code is None:
|
|
360
|
+
raise AppwriteException('Missing required parameter: "user_code"')
|
|
361
|
+
|
|
362
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
363
|
+
|
|
364
|
+
api_params['user_code'] = self._normalize_value(user_code)
|
|
365
|
+
|
|
366
|
+
response = self.client.call('post', api_path, {
|
|
367
|
+
'content-type': 'application/json',
|
|
368
|
+
'accept': 'application/json',
|
|
369
|
+
}, api_params)
|
|
370
|
+
|
|
371
|
+
return self._parse_response(response, model=Oauth2Grant)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
def get_grant(
|
|
375
|
+
self,
|
|
376
|
+
grant_id: str
|
|
377
|
+
) -> Oauth2Grant:
|
|
378
|
+
"""
|
|
379
|
+
Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK.
|
|
380
|
+
|
|
381
|
+
Parameters
|
|
382
|
+
----------
|
|
383
|
+
grant_id : str
|
|
384
|
+
Grant ID made during authorization, provided to consent screen in URL search params.
|
|
385
|
+
|
|
386
|
+
Returns
|
|
387
|
+
-------
|
|
388
|
+
Oauth2Grant
|
|
389
|
+
API response as a typed Pydantic model
|
|
390
|
+
|
|
391
|
+
Raises
|
|
392
|
+
------
|
|
393
|
+
AppwriteException
|
|
394
|
+
If API request fails
|
|
395
|
+
"""
|
|
396
|
+
|
|
397
|
+
api_path = '/oauth2/{project_id}/grants/{grant_id}'
|
|
398
|
+
api_params = {}
|
|
399
|
+
if grant_id is None:
|
|
400
|
+
raise AppwriteException('Missing required parameter: "grant_id"')
|
|
401
|
+
|
|
402
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
403
|
+
api_path = api_path.replace('{grant_id}', str(self._normalize_value(grant_id)))
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
response = self.client.call('get', api_path, {
|
|
407
|
+
'accept': 'application/json',
|
|
408
|
+
}, api_params)
|
|
409
|
+
|
|
410
|
+
return self._parse_response(response, model=Oauth2Grant)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
def logout(
|
|
414
|
+
self,
|
|
415
|
+
id_token_hint: Optional[str] = None,
|
|
416
|
+
logout_hint: Optional[str] = None,
|
|
417
|
+
client_id: Optional[str] = None,
|
|
418
|
+
post_logout_redirect_uri: Optional[str] = None,
|
|
419
|
+
state: Optional[str] = None,
|
|
420
|
+
ui_locales: Optional[str] = None
|
|
421
|
+
) -> Dict[str, Any]:
|
|
422
|
+
"""
|
|
423
|
+
OpenID Connect RP-Initiated Logout. Ends the user session and revokes the tokens issued to the app identified by the `id_token_hint`, then redirects the user to `post_logout_redirect_uri` when it matches a URI registered on the app.
|
|
424
|
+
|
|
425
|
+
Parameters
|
|
426
|
+
----------
|
|
427
|
+
id_token_hint : Optional[str]
|
|
428
|
+
ID Token previously issued to the app, used as proof of the logout request. Required to end the session; signature and issuer are validated while expiry is ignored.
|
|
429
|
+
logout_hint : Optional[str]
|
|
430
|
+
Hint about the user that is logging out. Accepted for OIDC compatibility.
|
|
431
|
+
client_id : Optional[str]
|
|
432
|
+
OAuth2 client ID. When both `client_id` and `id_token_hint` are provided, they must identify the same app.
|
|
433
|
+
post_logout_redirect_uri : Optional[str]
|
|
434
|
+
URI to redirect the user to after logout. Must exactly match a URI registered in the app's `postLogoutRedirectUris`.
|
|
435
|
+
state : Optional[str]
|
|
436
|
+
Opaque value passed back unchanged in the `state` query param of the post-logout redirect.
|
|
437
|
+
ui_locales : Optional[str]
|
|
438
|
+
Preferred languages for any logout UI, as space-separated BCP47 tags. Accepted for OIDC compatibility.
|
|
439
|
+
|
|
440
|
+
Returns
|
|
441
|
+
-------
|
|
442
|
+
Dict[str, Any]
|
|
443
|
+
API response as a dictionary
|
|
444
|
+
|
|
445
|
+
Raises
|
|
446
|
+
------
|
|
447
|
+
AppwriteException
|
|
448
|
+
If API request fails
|
|
449
|
+
"""
|
|
450
|
+
|
|
451
|
+
api_path = '/oauth2/{project_id}/logout'
|
|
452
|
+
api_params = {}
|
|
453
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
454
|
+
|
|
455
|
+
if id_token_hint is not None:
|
|
456
|
+
api_params['id_token_hint'] = self._normalize_value(id_token_hint)
|
|
457
|
+
if logout_hint is not None:
|
|
458
|
+
api_params['logout_hint'] = self._normalize_value(logout_hint)
|
|
459
|
+
if client_id is not None:
|
|
460
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
461
|
+
if post_logout_redirect_uri is not None:
|
|
462
|
+
api_params['post_logout_redirect_uri'] = self._normalize_value(post_logout_redirect_uri)
|
|
463
|
+
if state is not None:
|
|
464
|
+
api_params['state'] = self._normalize_value(state)
|
|
465
|
+
if ui_locales is not None:
|
|
466
|
+
api_params['ui_locales'] = self._normalize_value(ui_locales)
|
|
467
|
+
|
|
468
|
+
response = self.client.call('get', api_path, {
|
|
469
|
+
'accept': 'application/json',
|
|
470
|
+
}, api_params)
|
|
471
|
+
|
|
472
|
+
return response
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
def logout_post(
|
|
476
|
+
self,
|
|
477
|
+
id_token_hint: Optional[str] = None,
|
|
478
|
+
logout_hint: Optional[str] = None,
|
|
479
|
+
client_id: Optional[str] = None,
|
|
480
|
+
post_logout_redirect_uri: Optional[str] = None,
|
|
481
|
+
state: Optional[str] = None,
|
|
482
|
+
ui_locales: Optional[str] = None
|
|
483
|
+
) -> Dict[str, Any]:
|
|
484
|
+
"""
|
|
485
|
+
OpenID Connect RP-Initiated Logout. Ends the user session and revokes the tokens issued to the app identified by the `id_token_hint`, then redirects the user to `post_logout_redirect_uri` when it matches a URI registered on the app.
|
|
486
|
+
|
|
487
|
+
Parameters
|
|
488
|
+
----------
|
|
489
|
+
id_token_hint : Optional[str]
|
|
490
|
+
ID Token previously issued to the app, used as proof of the logout request. Required to end the session; signature and issuer are validated while expiry is ignored.
|
|
491
|
+
logout_hint : Optional[str]
|
|
492
|
+
Hint about the user that is logging out. Accepted for OIDC compatibility.
|
|
493
|
+
client_id : Optional[str]
|
|
494
|
+
OAuth2 client ID. When both `client_id` and `id_token_hint` are provided, they must identify the same app.
|
|
495
|
+
post_logout_redirect_uri : Optional[str]
|
|
496
|
+
URI to redirect the user to after logout. Must exactly match a URI registered in the app's `postLogoutRedirectUris`.
|
|
497
|
+
state : Optional[str]
|
|
498
|
+
Opaque value passed back unchanged in the `state` query param of the post-logout redirect.
|
|
499
|
+
ui_locales : Optional[str]
|
|
500
|
+
Preferred languages for any logout UI, as space-separated BCP47 tags. Accepted for OIDC compatibility.
|
|
501
|
+
|
|
502
|
+
Returns
|
|
503
|
+
-------
|
|
504
|
+
Dict[str, Any]
|
|
505
|
+
API response as a dictionary
|
|
506
|
+
|
|
507
|
+
Raises
|
|
508
|
+
------
|
|
509
|
+
AppwriteException
|
|
510
|
+
If API request fails
|
|
511
|
+
"""
|
|
512
|
+
|
|
513
|
+
api_path = '/oauth2/{project_id}/logout'
|
|
514
|
+
api_params = {}
|
|
515
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
516
|
+
|
|
517
|
+
if id_token_hint is not None:
|
|
518
|
+
api_params['id_token_hint'] = self._normalize_value(id_token_hint)
|
|
519
|
+
if logout_hint is not None:
|
|
520
|
+
api_params['logout_hint'] = self._normalize_value(logout_hint)
|
|
521
|
+
if client_id is not None:
|
|
522
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
523
|
+
if post_logout_redirect_uri is not None:
|
|
524
|
+
api_params['post_logout_redirect_uri'] = self._normalize_value(post_logout_redirect_uri)
|
|
525
|
+
if state is not None:
|
|
526
|
+
api_params['state'] = self._normalize_value(state)
|
|
527
|
+
if ui_locales is not None:
|
|
528
|
+
api_params['ui_locales'] = self._normalize_value(ui_locales)
|
|
529
|
+
|
|
530
|
+
response = self.client.call('post', api_path, {
|
|
531
|
+
'content-type': 'application/json',
|
|
532
|
+
'accept': 'application/json',
|
|
533
|
+
}, api_params)
|
|
534
|
+
|
|
535
|
+
return response
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def list_organizations(
|
|
539
|
+
self,
|
|
540
|
+
limit: Optional[float] = None,
|
|
541
|
+
offset: Optional[float] = None,
|
|
542
|
+
search: Optional[str] = None
|
|
543
|
+
) -> Oauth2OrganizationList:
|
|
544
|
+
"""
|
|
545
|
+
List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see.
|
|
546
|
+
|
|
547
|
+
Parameters
|
|
548
|
+
----------
|
|
549
|
+
limit : Optional[float]
|
|
550
|
+
Maximum number of organizations to return. Between 1 and 5000.
|
|
551
|
+
offset : Optional[float]
|
|
552
|
+
Number of organizations to skip before returning results. Used for pagination.
|
|
553
|
+
search : Optional[str]
|
|
554
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
555
|
+
|
|
556
|
+
Returns
|
|
557
|
+
-------
|
|
558
|
+
Oauth2OrganizationList
|
|
559
|
+
API response as a typed Pydantic model
|
|
560
|
+
|
|
561
|
+
Raises
|
|
562
|
+
------
|
|
563
|
+
AppwriteException
|
|
564
|
+
If API request fails
|
|
565
|
+
"""
|
|
566
|
+
|
|
567
|
+
api_path = '/oauth2/{project_id}/organizations'
|
|
568
|
+
api_params = {}
|
|
569
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
570
|
+
|
|
571
|
+
if limit is not None:
|
|
572
|
+
api_params['limit'] = self._normalize_value(limit)
|
|
573
|
+
if offset is not None:
|
|
574
|
+
api_params['offset'] = self._normalize_value(offset)
|
|
575
|
+
if search is not None:
|
|
576
|
+
api_params['search'] = self._normalize_value(search)
|
|
577
|
+
|
|
578
|
+
response = self.client.call('get', api_path, {
|
|
579
|
+
'accept': 'application/json',
|
|
580
|
+
}, api_params)
|
|
581
|
+
|
|
582
|
+
return self._parse_response(response, model=Oauth2OrganizationList)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def create_par(
|
|
586
|
+
self,
|
|
587
|
+
client_id: str,
|
|
588
|
+
redirect_uri: str,
|
|
589
|
+
response_type: str,
|
|
590
|
+
scope: Optional[str] = None,
|
|
591
|
+
state: Optional[str] = None,
|
|
592
|
+
nonce: Optional[str] = None,
|
|
593
|
+
code_challenge: Optional[str] = None,
|
|
594
|
+
code_challenge_method: Optional[str] = None,
|
|
595
|
+
prompt: Optional[str] = None,
|
|
596
|
+
max_age: Optional[float] = None,
|
|
597
|
+
authorization_details: Optional[str] = None,
|
|
598
|
+
resource: Optional[str] = None,
|
|
599
|
+
audience: Optional[str] = None
|
|
600
|
+
) -> Oauth2PAR:
|
|
601
|
+
"""
|
|
602
|
+
Store an OAuth2 authorization request server-side and receive a short-lived request_uri handle for the authorize endpoint.
|
|
603
|
+
|
|
604
|
+
Parameters
|
|
605
|
+
----------
|
|
606
|
+
client_id : str
|
|
607
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
608
|
+
redirect_uri : str
|
|
609
|
+
Redirect URI where visitor will be redirected after authorization, whether successful or not.
|
|
610
|
+
response_type : str
|
|
611
|
+
OAuth2 / OIDC response type.
|
|
612
|
+
scope : Optional[str]
|
|
613
|
+
Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`.
|
|
614
|
+
state : Optional[str]
|
|
615
|
+
OAuth2 state. You receive this back in the redirect URI.
|
|
616
|
+
nonce : Optional[str]
|
|
617
|
+
OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`.
|
|
618
|
+
code_challenge : Optional[str]
|
|
619
|
+
PKCE code challenge. Required when OAuth2 app is public.
|
|
620
|
+
code_challenge_method : Optional[str]
|
|
621
|
+
PKCE code challenge method. Required when OAuth2 app is public.
|
|
622
|
+
prompt : Optional[str]
|
|
623
|
+
OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
|
|
624
|
+
max_age : Optional[float]
|
|
625
|
+
OIDC max_age parameter for customization of consent screen.
|
|
626
|
+
authorization_details : Optional[str]
|
|
627
|
+
Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
628
|
+
resource : Optional[str]
|
|
629
|
+
RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
630
|
+
audience : Optional[str]
|
|
631
|
+
Compatibility alias for a single OAuth2 resource indicator URI.
|
|
632
|
+
|
|
633
|
+
Returns
|
|
634
|
+
-------
|
|
635
|
+
Oauth2PAR
|
|
636
|
+
API response as a typed Pydantic model
|
|
637
|
+
|
|
638
|
+
Raises
|
|
639
|
+
------
|
|
640
|
+
AppwriteException
|
|
641
|
+
If API request fails
|
|
642
|
+
"""
|
|
643
|
+
|
|
644
|
+
api_path = '/oauth2/{project_id}/par'
|
|
645
|
+
api_params = {}
|
|
646
|
+
if client_id is None:
|
|
647
|
+
raise AppwriteException('Missing required parameter: "client_id"')
|
|
648
|
+
|
|
649
|
+
if redirect_uri is None:
|
|
650
|
+
raise AppwriteException('Missing required parameter: "redirect_uri"')
|
|
651
|
+
|
|
652
|
+
if response_type is None:
|
|
653
|
+
raise AppwriteException('Missing required parameter: "response_type"')
|
|
654
|
+
|
|
655
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
656
|
+
|
|
657
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
658
|
+
api_params['redirect_uri'] = self._normalize_value(redirect_uri)
|
|
659
|
+
api_params['response_type'] = self._normalize_value(response_type)
|
|
660
|
+
if scope is not None:
|
|
661
|
+
api_params['scope'] = self._normalize_value(scope)
|
|
662
|
+
if state is not None:
|
|
663
|
+
api_params['state'] = self._normalize_value(state)
|
|
664
|
+
if nonce is not None:
|
|
665
|
+
api_params['nonce'] = self._normalize_value(nonce)
|
|
666
|
+
if code_challenge is not None:
|
|
667
|
+
api_params['code_challenge'] = self._normalize_value(code_challenge)
|
|
668
|
+
if code_challenge_method is not None:
|
|
669
|
+
api_params['code_challenge_method'] = self._normalize_value(code_challenge_method)
|
|
670
|
+
if prompt is not None:
|
|
671
|
+
api_params['prompt'] = self._normalize_value(prompt)
|
|
672
|
+
if max_age is not None:
|
|
673
|
+
api_params['max_age'] = self._normalize_value(max_age)
|
|
674
|
+
if authorization_details is not None:
|
|
675
|
+
api_params['authorization_details'] = self._normalize_value(authorization_details)
|
|
676
|
+
if resource is not None:
|
|
677
|
+
api_params['resource'] = self._normalize_value(resource)
|
|
678
|
+
if audience is not None:
|
|
679
|
+
api_params['audience'] = self._normalize_value(audience)
|
|
680
|
+
|
|
681
|
+
response = self.client.call('post', api_path, {
|
|
682
|
+
'content-type': 'application/json',
|
|
683
|
+
'accept': 'application/json',
|
|
684
|
+
}, api_params)
|
|
685
|
+
|
|
686
|
+
return self._parse_response(response, model=Oauth2PAR)
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
def list_projects(
|
|
690
|
+
self,
|
|
691
|
+
limit: Optional[float] = None,
|
|
692
|
+
offset: Optional[float] = None,
|
|
693
|
+
search: Optional[str] = None
|
|
694
|
+
) -> Oauth2ProjectList:
|
|
695
|
+
"""
|
|
696
|
+
List the projects the OAuth2 access token can access. Resolves the token's `project` authorization details, expanding the `*` wildcard into the concrete set of projects the user can see.
|
|
697
|
+
|
|
698
|
+
Parameters
|
|
699
|
+
----------
|
|
700
|
+
limit : Optional[float]
|
|
701
|
+
Maximum number of projects to return. Between 1 and 5000.
|
|
702
|
+
offset : Optional[float]
|
|
703
|
+
Number of projects to skip before returning results. Used for pagination.
|
|
704
|
+
search : Optional[str]
|
|
705
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
706
|
+
|
|
707
|
+
Returns
|
|
708
|
+
-------
|
|
709
|
+
Oauth2ProjectList
|
|
710
|
+
API response as a typed Pydantic model
|
|
711
|
+
|
|
712
|
+
Raises
|
|
713
|
+
------
|
|
714
|
+
AppwriteException
|
|
715
|
+
If API request fails
|
|
716
|
+
"""
|
|
717
|
+
|
|
718
|
+
api_path = '/oauth2/{project_id}/projects'
|
|
719
|
+
api_params = {}
|
|
720
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
721
|
+
|
|
722
|
+
if limit is not None:
|
|
723
|
+
api_params['limit'] = self._normalize_value(limit)
|
|
724
|
+
if offset is not None:
|
|
725
|
+
api_params['offset'] = self._normalize_value(offset)
|
|
726
|
+
if search is not None:
|
|
727
|
+
api_params['search'] = self._normalize_value(search)
|
|
728
|
+
|
|
729
|
+
response = self.client.call('get', api_path, {
|
|
730
|
+
'accept': 'application/json',
|
|
731
|
+
}, api_params)
|
|
732
|
+
|
|
733
|
+
return self._parse_response(response, model=Oauth2ProjectList)
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
def reject(
|
|
737
|
+
self,
|
|
738
|
+
grant_id: str
|
|
739
|
+
) -> Oauth2Reject:
|
|
740
|
+
"""
|
|
741
|
+
Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
|
|
742
|
+
|
|
743
|
+
Parameters
|
|
744
|
+
----------
|
|
745
|
+
grant_id : str
|
|
746
|
+
Grant ID made during authorization, provided to consent screen in URL search params.
|
|
747
|
+
|
|
748
|
+
Returns
|
|
749
|
+
-------
|
|
750
|
+
Oauth2Reject
|
|
751
|
+
API response as a typed Pydantic model
|
|
752
|
+
|
|
753
|
+
Raises
|
|
754
|
+
------
|
|
755
|
+
AppwriteException
|
|
756
|
+
If API request fails
|
|
757
|
+
"""
|
|
758
|
+
|
|
759
|
+
api_path = '/oauth2/{project_id}/reject'
|
|
760
|
+
api_params = {}
|
|
761
|
+
if grant_id is None:
|
|
762
|
+
raise AppwriteException('Missing required parameter: "grant_id"')
|
|
763
|
+
|
|
764
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
765
|
+
|
|
766
|
+
api_params['grant_id'] = self._normalize_value(grant_id)
|
|
767
|
+
|
|
768
|
+
response = self.client.call('post', api_path, {
|
|
769
|
+
'content-type': 'application/json',
|
|
770
|
+
'accept': 'application/json',
|
|
771
|
+
}, api_params)
|
|
772
|
+
|
|
773
|
+
return self._parse_response(response, model=Oauth2Reject)
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
def revoke(
|
|
777
|
+
self,
|
|
778
|
+
token: str,
|
|
779
|
+
token_type_hint: Optional[str] = None,
|
|
780
|
+
client_id: Optional[str] = None,
|
|
781
|
+
client_secret: Optional[str] = None
|
|
782
|
+
) -> Dict[str, Any]:
|
|
783
|
+
"""
|
|
784
|
+
Revoke an OAuth2 access token or refresh token.
|
|
785
|
+
|
|
786
|
+
Parameters
|
|
787
|
+
----------
|
|
788
|
+
token : str
|
|
789
|
+
The access or refresh token to revoke.
|
|
790
|
+
token_type_hint : Optional[str]
|
|
791
|
+
Type of token to revoke (access_token or refresh_token).
|
|
792
|
+
client_id : Optional[str]
|
|
793
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
794
|
+
client_secret : Optional[str]
|
|
795
|
+
OAuth2 client secret. Required for confidential apps; omitted for public apps.
|
|
796
|
+
|
|
797
|
+
Returns
|
|
798
|
+
-------
|
|
799
|
+
Dict[str, Any]
|
|
800
|
+
API response as a dictionary
|
|
801
|
+
|
|
802
|
+
Raises
|
|
803
|
+
------
|
|
804
|
+
AppwriteException
|
|
805
|
+
If API request fails
|
|
806
|
+
"""
|
|
807
|
+
|
|
808
|
+
api_path = '/oauth2/{project_id}/revoke'
|
|
809
|
+
api_params = {}
|
|
810
|
+
if token is None:
|
|
811
|
+
raise AppwriteException('Missing required parameter: "token"')
|
|
812
|
+
|
|
813
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
814
|
+
|
|
815
|
+
api_params['token'] = self._normalize_value(token)
|
|
816
|
+
if token_type_hint is not None:
|
|
817
|
+
api_params['token_type_hint'] = self._normalize_value(token_type_hint)
|
|
818
|
+
if client_id is not None:
|
|
819
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
820
|
+
if client_secret is not None:
|
|
821
|
+
api_params['client_secret'] = self._normalize_value(client_secret)
|
|
822
|
+
|
|
823
|
+
response = self.client.call('post', api_path, {
|
|
824
|
+
'content-type': 'application/json',
|
|
825
|
+
'accept': 'application/json',
|
|
826
|
+
}, api_params)
|
|
827
|
+
|
|
828
|
+
return response
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
def create_token(
|
|
832
|
+
self,
|
|
833
|
+
grant_type: str,
|
|
834
|
+
code: Optional[str] = None,
|
|
835
|
+
refresh_token: Optional[str] = None,
|
|
836
|
+
device_code: Optional[str] = None,
|
|
837
|
+
client_id: Optional[str] = None,
|
|
838
|
+
client_secret: Optional[str] = None,
|
|
839
|
+
code_verifier: Optional[str] = None,
|
|
840
|
+
redirect_uri: Optional[str] = None,
|
|
841
|
+
resource: Optional[str] = None,
|
|
842
|
+
audience: Optional[str] = None
|
|
843
|
+
) -> Oauth2Token:
|
|
844
|
+
"""
|
|
845
|
+
Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.
|
|
846
|
+
|
|
847
|
+
Parameters
|
|
848
|
+
----------
|
|
849
|
+
grant_type : str
|
|
850
|
+
OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`.
|
|
851
|
+
code : Optional[str]
|
|
852
|
+
Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type.
|
|
853
|
+
refresh_token : Optional[str]
|
|
854
|
+
Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type.
|
|
855
|
+
device_code : Optional[str]
|
|
856
|
+
Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type.
|
|
857
|
+
client_id : Optional[str]
|
|
858
|
+
OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL.
|
|
859
|
+
client_secret : Optional[str]
|
|
860
|
+
OAuth2 client secret. Required for confidential apps.
|
|
861
|
+
code_verifier : Optional[str]
|
|
862
|
+
PKCE code verifier. Required for public apps.
|
|
863
|
+
redirect_uri : Optional[str]
|
|
864
|
+
Redirect URI. Required for `authorization_code` grant type.
|
|
865
|
+
resource : Optional[str]
|
|
866
|
+
RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
867
|
+
audience : Optional[str]
|
|
868
|
+
Compatibility alias for a single OAuth2 resource indicator URI.
|
|
869
|
+
|
|
870
|
+
Returns
|
|
871
|
+
-------
|
|
872
|
+
Oauth2Token
|
|
873
|
+
API response as a typed Pydantic model
|
|
874
|
+
|
|
875
|
+
Raises
|
|
876
|
+
------
|
|
877
|
+
AppwriteException
|
|
878
|
+
If API request fails
|
|
879
|
+
"""
|
|
880
|
+
|
|
881
|
+
api_path = '/oauth2/{project_id}/token'
|
|
882
|
+
api_params = {}
|
|
883
|
+
if grant_type is None:
|
|
884
|
+
raise AppwriteException('Missing required parameter: "grant_type"')
|
|
885
|
+
|
|
886
|
+
api_path = api_path.replace('{project_id}', str(self._normalize_value(self.client.get_config('project'))))
|
|
887
|
+
|
|
888
|
+
api_params['grant_type'] = self._normalize_value(grant_type)
|
|
889
|
+
if code is not None:
|
|
890
|
+
api_params['code'] = self._normalize_value(code)
|
|
891
|
+
if refresh_token is not None:
|
|
892
|
+
api_params['refresh_token'] = self._normalize_value(refresh_token)
|
|
893
|
+
if device_code is not None:
|
|
894
|
+
api_params['device_code'] = self._normalize_value(device_code)
|
|
895
|
+
if client_id is not None:
|
|
896
|
+
api_params['client_id'] = self._normalize_value(client_id)
|
|
897
|
+
if client_secret is not None:
|
|
898
|
+
api_params['client_secret'] = self._normalize_value(client_secret)
|
|
899
|
+
if code_verifier is not None:
|
|
900
|
+
api_params['code_verifier'] = self._normalize_value(code_verifier)
|
|
901
|
+
if redirect_uri is not None:
|
|
902
|
+
api_params['redirect_uri'] = self._normalize_value(redirect_uri)
|
|
903
|
+
if resource is not None:
|
|
904
|
+
api_params['resource'] = self._normalize_value(resource)
|
|
905
|
+
if audience is not None:
|
|
906
|
+
api_params['audience'] = self._normalize_value(audience)
|
|
907
|
+
|
|
908
|
+
response = self.client.call('post', api_path, {
|
|
909
|
+
'content-type': 'application/json',
|
|
910
|
+
'accept': 'application/json',
|
|
911
|
+
}, api_params)
|
|
912
|
+
|
|
913
|
+
return self._parse_response(response, model=Oauth2Token)
|
|
914
|
+
|