ory-client 1.9.0__py3-none-any.whl → 1.11.6__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.
- ory_client/__init__.py +279 -10
- ory_client/api/__init__.py +16 -3
- ory_client/api/courier_api.py +576 -287
- ory_client/api/events_api.py +1147 -576
- ory_client/api/frontend_api.py +8736 -4145
- ory_client/api/identity_api.py +5219 -2605
- ory_client/api/jwk_api.py +1881 -939
- ory_client/api/metadata_api.py +245 -376
- ory_client/api/o_auth2_api.py +7763 -3858
- ory_client/api/oidc_api.py +2071 -1034
- ory_client/api/permission_api.py +1675 -776
- ory_client/api/project_api.py +5314 -2638
- ory_client/api/relationship_api.py +1844 -860
- ory_client/api/wellknown_api.py +250 -131
- ory_client/api_client.py +520 -658
- ory_client/api_response.py +21 -0
- ory_client/configuration.py +65 -75
- ory_client/exceptions.py +73 -32
- ory_client/models/__init__.py +266 -291
- ory_client/models/accept_o_auth2_consent_request.py +118 -0
- ory_client/models/accept_o_auth2_consent_request_session.py +113 -0
- ory_client/models/accept_o_auth2_login_request.py +117 -0
- ory_client/models/active_project_in_console.py +101 -0
- ory_client/models/attribute.py +103 -0
- ory_client/models/attribute_filter.py +115 -0
- ory_client/models/attributes_count_datapoint.py +103 -0
- ory_client/models/authenticator_assurance_level.py +40 -0
- ory_client/models/batch_patch_identities_response.py +109 -0
- ory_client/models/check_opl_syntax_result.py +109 -0
- ory_client/models/check_permission_result.py +101 -0
- ory_client/models/cloud_account.py +105 -0
- ory_client/models/consistency_request_parameters.py +111 -0
- ory_client/models/continue_with.py +214 -0
- ory_client/models/continue_with_recovery_ui.py +114 -0
- ory_client/models/continue_with_recovery_ui_flow.py +103 -0
- ory_client/models/continue_with_set_ory_session_token.py +110 -0
- ory_client/models/continue_with_settings_ui.py +114 -0
- ory_client/models/continue_with_settings_ui_flow.py +101 -0
- ory_client/models/continue_with_verification_ui.py +114 -0
- ory_client/models/continue_with_verification_ui_flow.py +105 -0
- ory_client/models/courier_message_status.py +40 -0
- ory_client/models/courier_message_type.py +38 -0
- ory_client/models/create_custom_domain_body.py +109 -0
- ory_client/models/create_event_stream_body.py +112 -0
- ory_client/models/create_identity_body.py +155 -0
- ory_client/models/create_invite_response.py +114 -0
- ory_client/models/create_json_web_key_set.py +105 -0
- ory_client/models/create_project_api_key_request.py +101 -0
- ory_client/models/create_project_body.py +112 -0
- ory_client/models/create_project_branding.py +115 -0
- ory_client/models/create_project_member_invite_body.py +101 -0
- ory_client/models/create_project_normalized_payload.py +685 -0
- ory_client/models/create_recovery_code_for_identity_body.py +114 -0
- ory_client/models/create_recovery_link_for_identity_body.py +114 -0
- ory_client/models/create_relationship_body.py +113 -0
- ory_client/models/create_subscription_body.py +126 -0
- ory_client/models/create_subscription_common.py +124 -0
- ory_client/models/create_verifiable_credential_request_body.py +109 -0
- ory_client/models/create_workspace_member_invite_body.py +101 -0
- ory_client/models/create_workspace_payload.py +101 -0
- ory_client/models/create_workspace_subscription_body.py +124 -0
- ory_client/models/credential_supported_draft00.py +107 -0
- ory_client/models/custom_domain.py +132 -0
- ory_client/models/delete_my_sessions_count.py +101 -0
- ory_client/models/email_template_data.py +107 -0
- ory_client/models/email_template_data_body.py +103 -0
- ory_client/models/error_authenticator_assurance_level_not_satisfied.py +107 -0
- ory_client/models/error_browser_location_change_required.py +107 -0
- ory_client/models/error_flow_replaced.py +107 -0
- ory_client/models/error_generic.py +105 -0
- ory_client/models/error_o_auth2.py +109 -0
- ory_client/models/event_stream.py +112 -0
- ory_client/models/expanded_permission_tree.py +125 -0
- ory_client/models/flow_error.py +108 -0
- ory_client/models/generic_error.py +126 -0
- ory_client/models/generic_error_content.py +109 -0
- ory_client/models/generic_usage.py +103 -0
- ory_client/models/get_attributes_count_response.py +111 -0
- ory_client/models/get_managed_identity_schema_location.py +101 -0
- ory_client/models/get_metrics_event_attributes_response.py +103 -0
- ory_client/models/get_metrics_event_types_response.py +103 -0
- ory_client/models/get_organization_response.py +105 -0
- ory_client/models/get_project_events_body.py +120 -0
- ory_client/models/get_project_events_response.py +115 -0
- ory_client/models/get_project_metrics_response.py +111 -0
- ory_client/models/get_session_activity_response.py +111 -0
- ory_client/models/get_version200_response.py +101 -0
- ory_client/models/health_not_ready_status.py +101 -0
- ory_client/models/health_status.py +101 -0
- ory_client/models/identity.py +187 -0
- ory_client/models/identity_credentials.py +122 -0
- ory_client/models/identity_credentials_code.py +109 -0
- ory_client/models/identity_credentials_oidc.py +109 -0
- ory_client/models/identity_credentials_oidc_provider.py +111 -0
- ory_client/models/identity_credentials_password.py +101 -0
- ory_client/models/identity_patch.py +107 -0
- ory_client/models/identity_patch_response.py +115 -0
- ory_client/models/identity_schema_container.py +103 -0
- ory_client/models/identity_schema_preset.py +103 -0
- ory_client/models/identity_with_credentials.py +111 -0
- ory_client/models/identity_with_credentials_oidc.py +105 -0
- ory_client/models/identity_with_credentials_oidc_config.py +115 -0
- ory_client/models/identity_with_credentials_oidc_config_provider.py +103 -0
- ory_client/models/identity_with_credentials_password.py +105 -0
- ory_client/models/identity_with_credentials_password_config.py +103 -0
- ory_client/models/internal_get_project_branding_body.py +101 -0
- ory_client/models/internal_is_ax_welcome_screen_enabled_for_project_body.py +103 -0
- ory_client/models/internal_is_owner_for_project_by_slug_body.py +114 -0
- ory_client/models/internal_is_owner_for_project_by_slug_response.py +101 -0
- ory_client/models/introspected_o_auth2_token.py +127 -0
- ory_client/models/is_owner_for_project_by_slug.py +103 -0
- ory_client/models/json_patch.py +119 -0
- ory_client/models/json_web_key.py +133 -0
- ory_client/models/json_web_key_set.py +109 -0
- ory_client/models/keto_namespace.py +103 -0
- ory_client/models/list_event_streams.py +109 -0
- ory_client/models/list_my_workspaces_response.py +113 -0
- ory_client/models/list_organizations_response.py +109 -0
- ory_client/models/list_workspace_projects_response.py +113 -0
- ory_client/models/login_flow.py +165 -0
- ory_client/models/login_flow_state.py +39 -0
- ory_client/models/logout_flow.py +103 -0
- ory_client/models/managed_identity_schema.py +120 -0
- ory_client/models/managed_identity_schema_validation_result.py +103 -0
- ory_client/models/member_invite.py +148 -0
- ory_client/models/message.py +141 -0
- ory_client/models/message_dispatch.py +119 -0
- ory_client/models/metrics_datapoint.py +104 -0
- ory_client/models/migration_options.py +117 -0
- ory_client/models/namespace.py +101 -0
- ory_client/models/needs_privileged_session_error.py +107 -0
- ory_client/models/normalized_project.py +171 -0
- ory_client/models/normalized_project_revision.py +674 -0
- ory_client/models/normalized_project_revision_courier_channel.py +145 -0
- ory_client/models/normalized_project_revision_hook.py +140 -0
- ory_client/models/normalized_project_revision_identity_schema.py +133 -0
- ory_client/models/normalized_project_revision_third_party_provider.py +187 -0
- ory_client/models/normalized_project_revision_tokenizer_template.py +133 -0
- ory_client/models/o_auth2_client.py +352 -0
- ory_client/models/o_auth2_client_token_lifespans.py +270 -0
- ory_client/models/o_auth2_consent_request.py +133 -0
- ory_client/models/o_auth2_consent_request_open_id_connect_context.py +109 -0
- ory_client/models/o_auth2_consent_session.py +130 -0
- ory_client/models/o_auth2_consent_session_expires_at.py +110 -0
- ory_client/models/o_auth2_login_request.py +125 -0
- ory_client/models/o_auth2_logout_request.py +115 -0
- ory_client/models/o_auth2_redirect_to.py +101 -0
- ory_client/models/o_auth2_token_exchange.py +111 -0
- ory_client/models/oidc_configuration.py +169 -0
- ory_client/models/oidc_user_info.py +137 -0
- ory_client/models/organization.py +116 -0
- ory_client/models/organization_body.py +103 -0
- ory_client/models/pagination.py +104 -0
- ory_client/models/pagination_headers.py +103 -0
- ory_client/models/parse_error.py +112 -0
- ory_client/models/patch_identities_body.py +109 -0
- ory_client/models/perform_native_logout_body.py +101 -0
- ory_client/models/permissions_on_workpace_response.py +101 -0
- ory_client/models/plan.py +103 -0
- ory_client/models/plan_details.py +128 -0
- ory_client/models/post_check_permission_body.py +113 -0
- ory_client/models/post_check_permission_or_error_body.py +113 -0
- ory_client/models/project.py +148 -0
- ory_client/models/project_api_key.py +126 -0
- ory_client/models/project_branding.py +129 -0
- ory_client/models/project_branding_colors.py +157 -0
- ory_client/models/project_branding_theme.py +182 -0
- ory_client/models/project_cors.py +103 -0
- ory_client/models/project_events_datapoint.py +114 -0
- ory_client/models/project_host.py +107 -0
- ory_client/models/project_member.py +107 -0
- ory_client/models/project_metadata.py +161 -0
- ory_client/models/project_service_identity.py +101 -0
- ory_client/models/project_service_o_auth2.py +101 -0
- ory_client/models/project_service_permission.py +101 -0
- ory_client/models/project_services.py +117 -0
- ory_client/models/quota_usage.py +118 -0
- ory_client/models/recovery_code_for_identity.py +106 -0
- ory_client/models/recovery_flow.py +139 -0
- ory_client/models/recovery_flow_state.py +39 -0
- ory_client/models/recovery_identity_address.py +110 -0
- ory_client/models/recovery_link_for_identity.py +104 -0
- ory_client/models/registration_flow.py +156 -0
- ory_client/models/registration_flow_state.py +39 -0
- ory_client/models/reject_o_auth2_request.py +109 -0
- ory_client/models/relation_query.py +113 -0
- ory_client/models/relationship.py +113 -0
- ory_client/models/relationship_namespaces.py +109 -0
- ory_client/models/relationship_patch.py +117 -0
- ory_client/models/relationships.py +111 -0
- ory_client/models/rfc6749_error_json.py +109 -0
- ory_client/models/schema_patch.py +103 -0
- ory_client/models/self_service_flow_expired_error.py +112 -0
- ory_client/models/session.py +141 -0
- ory_client/models/session_activity_datapoint.py +105 -0
- ory_client/models/session_authentication_method.py +121 -0
- ory_client/models/session_device.py +107 -0
- ory_client/models/set_active_project_in_console_body.py +101 -0
- ory_client/models/set_custom_domain_body.py +109 -0
- ory_client/models/set_event_stream_body.py +112 -0
- ory_client/models/set_project.py +118 -0
- ory_client/models/set_project_branding_theme_body.py +115 -0
- ory_client/models/settings_flow.py +145 -0
- ory_client/models/settings_flow_state.py +38 -0
- ory_client/models/source_position.py +103 -0
- ory_client/models/subject_set.py +105 -0
- ory_client/models/subscription.py +179 -0
- ory_client/models/successful_code_exchange_response.py +107 -0
- ory_client/models/successful_native_login.py +117 -0
- ory_client/models/successful_native_registration.py +123 -0
- ory_client/models/successful_project_update.py +115 -0
- ory_client/models/token_pagination.py +104 -0
- ory_client/models/token_pagination_headers.py +103 -0
- ory_client/models/token_pagination_request_parameters.py +104 -0
- ory_client/models/token_pagination_response_headers.py +103 -0
- ory_client/models/trust_o_auth2_jwt_grant_issuer.py +116 -0
- ory_client/models/trusted_o_auth2_jwt_grant_issuer.py +120 -0
- ory_client/models/trusted_o_auth2_jwt_grant_json_web_key.py +103 -0
- ory_client/models/ui_container.py +123 -0
- ory_client/models/ui_node.py +139 -0
- ory_client/models/ui_node_anchor_attributes.py +118 -0
- ory_client/models/ui_node_attributes.py +238 -0
- ory_client/models/ui_node_image_attributes.py +116 -0
- ory_client/models/ui_node_input_attributes.py +154 -0
- ory_client/models/ui_node_meta.py +105 -0
- ory_client/models/ui_node_script_attributes.py +124 -0
- ory_client/models/ui_node_text_attributes.py +116 -0
- ory_client/models/ui_text.py +114 -0
- ory_client/models/update_identity_body.py +132 -0
- ory_client/models/update_login_flow_body.py +286 -0
- ory_client/models/update_login_flow_with_code_method.py +111 -0
- ory_client/models/update_login_flow_with_lookup_secret_method.py +105 -0
- ory_client/models/update_login_flow_with_oidc_method.py +115 -0
- ory_client/models/update_login_flow_with_passkey_method.py +105 -0
- ory_client/models/update_login_flow_with_password_method.py +111 -0
- ory_client/models/update_login_flow_with_totp_method.py +107 -0
- ory_client/models/update_login_flow_with_web_authn_method.py +109 -0
- ory_client/models/update_recovery_flow_body.py +166 -0
- ory_client/models/update_recovery_flow_with_code_method.py +116 -0
- ory_client/models/update_recovery_flow_with_link_method.py +114 -0
- ory_client/models/update_registration_flow_body.py +238 -0
- ory_client/models/update_registration_flow_with_code_method.py +111 -0
- ory_client/models/update_registration_flow_with_oidc_method.py +115 -0
- ory_client/models/update_registration_flow_with_passkey_method.py +109 -0
- ory_client/models/update_registration_flow_with_password_method.py +109 -0
- ory_client/models/update_registration_flow_with_profile_method.py +109 -0
- ory_client/models/update_registration_flow_with_web_authn_method.py +111 -0
- ory_client/models/update_settings_flow_body.py +286 -0
- ory_client/models/update_settings_flow_with_lookup_method.py +113 -0
- ory_client/models/update_settings_flow_with_oidc_method.py +113 -0
- ory_client/models/update_settings_flow_with_passkey_method.py +107 -0
- ory_client/models/update_settings_flow_with_password_method.py +107 -0
- ory_client/models/update_settings_flow_with_profile_method.py +107 -0
- ory_client/models/update_settings_flow_with_totp_method.py +109 -0
- ory_client/models/update_settings_flow_with_web_authn_method.py +111 -0
- ory_client/models/update_subscription_body.py +112 -0
- ory_client/models/update_verification_flow_body.py +166 -0
- ory_client/models/update_verification_flow_with_code_method.py +116 -0
- ory_client/models/update_verification_flow_with_link_method.py +114 -0
- ory_client/models/update_workspace_payload.py +101 -0
- ory_client/models/usage.py +105 -0
- ory_client/models/verifiable_credential_priming_response.py +115 -0
- ory_client/models/verifiable_credential_proof.py +103 -0
- ory_client/models/verifiable_credential_response.py +103 -0
- ory_client/models/verifiable_identity_address.py +123 -0
- ory_client/models/verification_flow.py +129 -0
- ory_client/models/verification_flow_state.py +39 -0
- ory_client/models/version.py +101 -0
- ory_client/models/warning.py +103 -0
- ory_client/models/workspace.py +115 -0
- ory_client/models/workspace_meta.py +122 -0
- ory_client/py.typed +0 -0
- ory_client/rest.py +139 -236
- {ory_client-1.9.0.dist-info → ory_client-1.11.6.dist-info}/METADATA +6 -4
- ory_client-1.11.6.dist-info/RECORD +278 -0
- ory_client/apis/__init__.py +0 -28
- ory_client/model/__init__.py +0 -5
- ory_client/model/accept_o_auth2_consent_request.py +0 -296
- ory_client/model/accept_o_auth2_consent_request_session.py +0 -268
- ory_client/model/accept_o_auth2_login_request.py +0 -308
- ory_client/model/active_project_in_console.py +0 -264
- ory_client/model/attribute.py +0 -268
- ory_client/model/attribute_filter.py +0 -282
- ory_client/model/attributes_count_datapoint.py +0 -276
- ory_client/model/authenticator_assurance_level.py +0 -293
- ory_client/model/batch_patch_identities_response.py +0 -270
- ory_client/model/check_opl_syntax_result.py +0 -270
- ory_client/model/check_permission_result.py +0 -270
- ory_client/model/cloud_account.py +0 -282
- ory_client/model/consistency_request_parameters.py +0 -269
- ory_client/model/continue_with.py +0 -356
- ory_client/model/continue_with_recovery_ui.py +0 -287
- ory_client/model/continue_with_recovery_ui_flow.py +0 -274
- ory_client/model/continue_with_set_ory_session_token.py +0 -281
- ory_client/model/continue_with_settings_ui.py +0 -287
- ory_client/model/continue_with_settings_ui_flow.py +0 -270
- ory_client/model/continue_with_verification_ui.py +0 -287
- ory_client/model/continue_with_verification_ui_flow.py +0 -280
- ory_client/model/courier_message_status.py +0 -293
- ory_client/model/courier_message_type.py +0 -291
- ory_client/model/create_custom_domain_body.py +0 -280
- ory_client/model/create_event_stream_body.py +0 -287
- ory_client/model/create_identity_body.py +0 -314
- ory_client/model/create_invite_response.py +0 -282
- ory_client/model/create_json_web_key_set.py +0 -282
- ory_client/model/create_member_invite_response.py +0 -287
- ory_client/model/create_project_api_key_request.py +0 -270
- ory_client/model/create_project_body.py +0 -284
- ory_client/model/create_project_branding.py +0 -290
- ory_client/model/create_project_member_invite_body.py +0 -264
- ory_client/model/create_project_normalized_payload.py +0 -1119
- ory_client/model/create_recovery_code_for_identity_body.py +0 -279
- ory_client/model/create_recovery_link_for_identity_body.py +0 -279
- ory_client/model/create_relationship_body.py +0 -286
- ory_client/model/create_subscription_body.py +0 -298
- ory_client/model/create_subscription_common.py +0 -292
- ory_client/model/create_verifiable_credential_request_body.py +0 -278
- ory_client/model/create_workspace_member_invite_body.py +0 -264
- ory_client/model/create_workspace_payload.py +0 -270
- ory_client/model/create_workspace_subscription_body.py +0 -292
- ory_client/model/credential_supported_draft00.py +0 -276
- ory_client/model/custom_domain.py +0 -334
- ory_client/model/delete_my_sessions_count.py +0 -264
- ory_client/model/email_template_data.py +0 -282
- ory_client/model/email_template_data_body.py +0 -276
- ory_client/model/error_authenticator_assurance_level_not_satisfied.py +0 -274
- ory_client/model/error_browser_location_change_required.py +0 -274
- ory_client/model/error_flow_replaced.py +0 -274
- ory_client/model/error_generic.py +0 -276
- ory_client/model/error_o_auth2.py +0 -280
- ory_client/model/event_stream.py +0 -284
- ory_client/model/expanded_permission_tree.py +0 -294
- ory_client/model/flow_error.py +0 -282
- ory_client/model/generic_error.py +0 -308
- ory_client/model/generic_error_content.py +0 -280
- ory_client/model/generic_usage.py +0 -276
- ory_client/model/get_attributes_count_response.py +0 -273
- ory_client/model/get_managed_identity_schema_location.py +0 -264
- ory_client/model/get_metrics_event_attributes_response.py +0 -267
- ory_client/model/get_metrics_event_types_response.py +0 -267
- ory_client/model/get_organization_response.py +0 -276
- ory_client/model/get_project_events_body.py +0 -298
- ory_client/model/get_project_events_response.py +0 -278
- ory_client/model/get_project_metrics_response.py +0 -273
- ory_client/model/get_session_activity_response.py +0 -273
- ory_client/model/get_version200_response.py +0 -270
- ory_client/model/health_not_ready_status.py +0 -264
- ory_client/model/health_status.py +0 -264
- ory_client/model/identity.py +0 -342
- ory_client/model/identity_credentials.py +0 -294
- ory_client/model/identity_credentials_code.py +0 -268
- ory_client/model/identity_credentials_oidc.py +0 -270
- ory_client/model/identity_credentials_oidc_provider.py +0 -284
- ory_client/model/identity_credentials_password.py +0 -264
- ory_client/model/identity_patch.py +0 -274
- ory_client/model/identity_patch_response.py +0 -275
- ory_client/model/identity_schema_container.py +0 -268
- ory_client/model/identity_schema_preset.py +0 -276
- ory_client/model/identity_schema_presets.py +0 -292
- ory_client/model/identity_schemas.py +0 -292
- ory_client/model/identity_with_credentials.py +0 -276
- ory_client/model/identity_with_credentials_oidc.py +0 -270
- ory_client/model/identity_with_credentials_oidc_config.py +0 -276
- ory_client/model/identity_with_credentials_oidc_config_provider.py +0 -276
- ory_client/model/identity_with_credentials_password.py +0 -270
- ory_client/model/identity_with_credentials_password_config.py +0 -268
- ory_client/model/internal_get_project_branding_body.py +0 -264
- ory_client/model/internal_is_ax_welcome_screen_enabled_for_project_body.py +0 -276
- ory_client/model/internal_is_owner_for_project_by_slug_body.py +0 -290
- ory_client/model/internal_is_owner_for_project_by_slug_response.py +0 -270
- ory_client/model/introspected_o_auth2_token.py +0 -322
- ory_client/model/is_owner_for_project_by_slug.py +0 -276
- ory_client/model/is_ready200_response.py +0 -270
- ory_client/model/is_ready503_response.py +0 -270
- ory_client/model/json_patch.py +0 -292
- ory_client/model/json_patch_document.py +0 -292
- ory_client/model/json_web_key.py +0 -340
- ory_client/model/json_web_key_set.py +0 -270
- ory_client/model/keto_namespace.py +0 -268
- ory_client/model/keto_namespaces.py +0 -292
- ory_client/model/list_custom_domains.py +0 -292
- ory_client/model/list_event_streams.py +0 -270
- ory_client/model/list_my_workspaces_response.py +0 -288
- ory_client/model/list_organizations_response.py +0 -276
- ory_client/model/list_workspace_projects_response.py +0 -288
- ory_client/model/login_flow.py +0 -370
- ory_client/model/login_flow_state.py +0 -292
- ory_client/model/logout_flow.py +0 -276
- ory_client/model/managed_identity_schema.py +0 -300
- ory_client/model/managed_identity_schema_validation_result.py +0 -268
- ory_client/model/managed_identity_schemas.py +0 -292
- ory_client/model/member_invite.py +0 -321
- ory_client/model/member_invites.py +0 -292
- ory_client/model/message.py +0 -355
- ory_client/model/message_dispatch.py +0 -302
- ory_client/model/metrics_datapoint.py +0 -276
- ory_client/model/migration_options.py +0 -284
- ory_client/model/namespace.py +0 -264
- ory_client/model/needs_privileged_session_error.py +0 -280
- ory_client/model/normalized_project.py +0 -337
- ory_client/model/normalized_project_revision.py +0 -1105
- ory_client/model/normalized_project_revision_courier_channel.py +0 -328
- ory_client/model/normalized_project_revision_hook.py +0 -342
- ory_client/model/normalized_project_revision_identity_schema.py +0 -308
- ory_client/model/normalized_project_revision_identity_schemas.py +0 -292
- ory_client/model/normalized_project_revision_third_party_provider.py +0 -368
- ory_client/model/normalized_project_revision_tokenizer_template.py +0 -300
- ory_client/model/normalized_project_revision_tokenizer_templates.py +0 -292
- ory_client/model/normalized_projects.py +0 -292
- ory_client/model/null_duration.py +0 -292
- ory_client/model/o_auth2_client.py +0 -460
- ory_client/model/o_auth2_client_token_lifespans.py +0 -306
- ory_client/model/o_auth2_consent_request.py +0 -328
- ory_client/model/o_auth2_consent_request_open_id_connect_context.py +0 -280
- ory_client/model/o_auth2_consent_session.py +0 -308
- ory_client/model/o_auth2_consent_session_expires_at.py +0 -280
- ory_client/model/o_auth2_consent_sessions.py +0 -292
- ory_client/model/o_auth2_login_request.py +0 -320
- ory_client/model/o_auth2_logout_request.py +0 -290
- ory_client/model/o_auth2_redirect_to.py +0 -270
- ory_client/model/o_auth2_token_exchange.py +0 -284
- ory_client/model/oidc_configuration.py +0 -412
- ory_client/model/oidc_user_info.py +0 -336
- ory_client/model/organization.py +0 -302
- ory_client/model/organization_body.py +0 -268
- ory_client/model/pagination.py +0 -274
- ory_client/model/pagination_headers.py +0 -268
- ory_client/model/parse_error.py +0 -278
- ory_client/model/patch_identities_body.py +0 -270
- ory_client/model/perform_native_logout_body.py +0 -270
- ory_client/model/permissions_on_project.py +0 -260
- ory_client/model/permissions_on_workpace_response.py +0 -264
- ory_client/model/plan.py +0 -276
- ory_client/model/plan_details.py +0 -316
- ory_client/model/plan_features.py +0 -266
- ory_client/model/plans.py +0 -287
- ory_client/model/post_check_permission_body.py +0 -286
- ory_client/model/post_check_permission_or_error_body.py +0 -286
- ory_client/model/pricing.py +0 -292
- ory_client/model/project.py +0 -319
- ory_client/model/project_api_key.py +0 -298
- ory_client/model/project_api_keys.py +0 -292
- ory_client/model/project_branding.py +0 -303
- ory_client/model/project_branding_colors.py +0 -376
- ory_client/model/project_branding_theme.py +0 -421
- ory_client/model/project_branding_themes.py +0 -292
- ory_client/model/project_cors.py +0 -268
- ory_client/model/project_events_datapoint.py +0 -288
- ory_client/model/project_host.py +0 -281
- ory_client/model/project_member.py +0 -288
- ory_client/model/project_members.py +0 -292
- ory_client/model/project_metadata.py +0 -337
- ory_client/model/project_metadata_list.py +0 -292
- ory_client/model/project_revision_hooks.py +0 -292
- ory_client/model/project_revision_identity_schemas.py +0 -292
- ory_client/model/project_revision_third_party_login_providers.py +0 -292
- ory_client/model/project_revisions.py +0 -292
- ory_client/model/project_service_identity.py +0 -270
- ory_client/model/project_service_o_auth2.py +0 -270
- ory_client/model/project_service_permission.py +0 -270
- ory_client/model/project_services.py +0 -282
- ory_client/model/projects.py +0 -292
- ory_client/model/quota_usage.py +0 -328
- ory_client/model/recovery_code_for_identity.py +0 -280
- ory_client/model/recovery_flow.py +0 -330
- ory_client/model/recovery_flow_state.py +0 -292
- ory_client/model/recovery_identity_address.py +0 -290
- ory_client/model/recovery_link_for_identity.py +0 -274
- ory_client/model/registration_flow.py +0 -352
- ory_client/model/registration_flow_state.py +0 -292
- ory_client/model/reject_o_auth2_request.py +0 -280
- ory_client/model/relation_query.py +0 -286
- ory_client/model/relationship.py +0 -296
- ory_client/model/relationship_namespaces.py +0 -270
- ory_client/model/relationship_patch.py +0 -278
- ory_client/model/relationships.py +0 -274
- ory_client/model/revision_courier_channels.py +0 -292
- ory_client/model/rfc6749_error_json.py +0 -280
- ory_client/model/schema_patch.py +0 -276
- ory_client/model/self_service_flow_expired_error.py +0 -282
- ory_client/model/session.py +0 -318
- ory_client/model/session_activity_datapoint.py +0 -282
- ory_client/model/session_authentication_method.py +0 -297
- ory_client/model/session_authentication_methods.py +0 -292
- ory_client/model/session_device.py +0 -282
- ory_client/model/set_active_project_in_console_body.py +0 -270
- ory_client/model/set_custom_domain_body.py +0 -280
- ory_client/model/set_event_stream_body.py +0 -287
- ory_client/model/set_project.py +0 -296
- ory_client/model/set_project_branding_theme_body.py +0 -290
- ory_client/model/settings_flow.py +0 -338
- ory_client/model/settings_flow_state.py +0 -291
- ory_client/model/source_position.py +0 -268
- ory_client/model/string_slice_json_format.py +0 -287
- ory_client/model/subject_set.py +0 -282
- ory_client/model/subscription.py +0 -350
- ory_client/model/successful_code_exchange_response.py +0 -280
- ory_client/model/successful_native_login.py +0 -280
- ory_client/model/successful_native_registration.py +0 -292
- ory_client/model/successful_project_update.py +0 -284
- ory_client/model/token_pagination.py +0 -274
- ory_client/model/token_pagination_headers.py +0 -268
- ory_client/model/token_pagination_request_parameters.py +0 -274
- ory_client/model/token_pagination_response_headers.py +0 -268
- ory_client/model/trust_o_auth2_jwt_grant_issuer.py +0 -302
- ory_client/model/trusted_o_auth2_jwt_grant_issuer.py +0 -298
- ory_client/model/trusted_o_auth2_jwt_grant_issuers.py +0 -292
- ory_client/model/trusted_o_auth2_jwt_grant_json_web_key.py +0 -268
- ory_client/model/ui_container.py +0 -294
- ory_client/model/ui_node.py +0 -322
- ory_client/model/ui_node_anchor_attributes.py +0 -294
- ory_client/model/ui_node_attributes.py +0 -440
- ory_client/model/ui_node_image_attributes.py +0 -294
- ory_client/model/ui_node_input_attributes.py +0 -340
- ory_client/model/ui_node_meta.py +0 -270
- ory_client/model/ui_node_script_attributes.py +0 -318
- ory_client/model/ui_node_text_attributes.py +0 -288
- ory_client/model/ui_nodes.py +0 -292
- ory_client/model/ui_text.py +0 -291
- ory_client/model/ui_texts.py +0 -292
- ory_client/model/update_identity_body.py +0 -304
- ory_client/model/update_login_flow_body.py +0 -411
- ory_client/model/update_login_flow_with_code_method.py +0 -292
- ory_client/model/update_login_flow_with_lookup_secret_method.py +0 -280
- ory_client/model/update_login_flow_with_oidc_method.py +0 -300
- ory_client/model/update_login_flow_with_password_method.py +0 -294
- ory_client/model/update_login_flow_with_totp_method.py +0 -284
- ory_client/model/update_login_flow_with_web_authn_method.py +0 -288
- ory_client/model/update_recovery_flow_body.py +0 -351
- ory_client/model/update_recovery_flow_with_code_method.py +0 -290
- ory_client/model/update_recovery_flow_with_link_method.py +0 -288
- ory_client/model/update_registration_flow_body.py +0 -389
- ory_client/model/update_registration_flow_with_code_method.py +0 -292
- ory_client/model/update_registration_flow_with_oidc_method.py +0 -300
- ory_client/model/update_registration_flow_with_password_method.py +0 -290
- ory_client/model/update_registration_flow_with_web_authn_method.py +0 -292
- ory_client/model/update_settings_flow_body.py +0 -419
- ory_client/model/update_settings_flow_with_lookup_method.py +0 -294
- ory_client/model/update_settings_flow_with_oidc_method.py +0 -294
- ory_client/model/update_settings_flow_with_password_method.py +0 -284
- ory_client/model/update_settings_flow_with_profile_method.py +0 -284
- ory_client/model/update_settings_flow_with_totp_method.py +0 -286
- ory_client/model/update_settings_flow_with_web_authn_method.py +0 -290
- ory_client/model/update_subscription_body.py +0 -284
- ory_client/model/update_verification_flow_body.py +0 -351
- ory_client/model/update_verification_flow_with_code_method.py +0 -290
- ory_client/model/update_verification_flow_with_link_method.py +0 -288
- ory_client/model/update_workspace_payload.py +0 -270
- ory_client/model/usage.py +0 -270
- ory_client/model/verifiable_credential_priming_response.py +0 -292
- ory_client/model/verifiable_credential_proof.py +0 -268
- ory_client/model/verifiable_credential_response.py +0 -268
- ory_client/model/verifiable_identity_address.py +0 -308
- ory_client/model/verification_flow.py +0 -318
- ory_client/model/verification_flow_state.py +0 -292
- ory_client/model/version.py +0 -264
- ory_client/model/warning.py +0 -268
- ory_client/model/workspace.py +0 -292
- ory_client/model/workspace_meta.py +0 -296
- ory_client/model/workspaces.py +0 -292
- ory_client/model_utils.py +0 -2059
- ory_client-1.9.0.dist-info/RECORD +0 -310
- {ory_client-1.9.0.dist-info → ory_client-1.11.6.dist-info}/LICENSE +0 -0
- {ory_client-1.9.0.dist-info → ory_client-1.11.6.dist-info}/WHEEL +0 -0
- {ory_client-1.9.0.dist-info → ory_client-1.11.6.dist-info}/top_level.txt +0 -0
ory_client/api/permission_api.py
CHANGED
@@ -1,813 +1,1712 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
"""
|
2
4
|
Ory APIs
|
3
5
|
|
4
|
-
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
6
|
+
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
|
5
7
|
|
6
|
-
The version of the OpenAPI document: v1.
|
8
|
+
The version of the OpenAPI document: v1.11.6
|
7
9
|
Contact: support@ory.sh
|
8
|
-
Generated by
|
9
|
-
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
10
14
|
|
15
|
+
import warnings
|
16
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
17
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
18
|
+
from typing_extensions import Annotated
|
11
19
|
|
12
|
-
import
|
13
|
-
|
20
|
+
from pydantic import Field, StrictInt, StrictStr
|
21
|
+
from typing import Optional
|
22
|
+
from typing_extensions import Annotated
|
23
|
+
from ory_client.models.check_permission_result import CheckPermissionResult
|
24
|
+
from ory_client.models.expanded_permission_tree import ExpandedPermissionTree
|
25
|
+
from ory_client.models.post_check_permission_body import PostCheckPermissionBody
|
26
|
+
from ory_client.models.post_check_permission_or_error_body import PostCheckPermissionOrErrorBody
|
14
27
|
|
15
|
-
from ory_client.api_client import ApiClient,
|
16
|
-
from ory_client.
|
17
|
-
|
18
|
-
check_validations,
|
19
|
-
date,
|
20
|
-
datetime,
|
21
|
-
file_type,
|
22
|
-
none_type,
|
23
|
-
validate_and_convert_types
|
24
|
-
)
|
25
|
-
from ory_client.model.check_permission_result import CheckPermissionResult
|
26
|
-
from ory_client.model.error_generic import ErrorGeneric
|
27
|
-
from ory_client.model.expanded_permission_tree import ExpandedPermissionTree
|
28
|
-
from ory_client.model.post_check_permission_body import PostCheckPermissionBody
|
29
|
-
from ory_client.model.post_check_permission_or_error_body import PostCheckPermissionOrErrorBody
|
28
|
+
from ory_client.api_client import ApiClient, RequestSerialized
|
29
|
+
from ory_client.api_response import ApiResponse
|
30
|
+
from ory_client.rest import RESTResponseType
|
30
31
|
|
31
32
|
|
32
|
-
class PermissionApi
|
33
|
+
class PermissionApi:
|
33
34
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
34
35
|
Ref: https://openapi-generator.tech
|
35
36
|
|
36
37
|
Do not edit the class manually.
|
37
38
|
"""
|
38
39
|
|
39
|
-
def __init__(self, api_client=None):
|
40
|
+
def __init__(self, api_client=None) -> None:
|
40
41
|
if api_client is None:
|
41
|
-
api_client = ApiClient()
|
42
|
+
api_client = ApiClient.get_default()
|
42
43
|
self.api_client = api_client
|
43
|
-
self.check_permission_endpoint = _Endpoint(
|
44
|
-
settings={
|
45
|
-
'response_type': (CheckPermissionResult,),
|
46
|
-
'auth': [
|
47
|
-
'oryAccessToken'
|
48
|
-
],
|
49
|
-
'endpoint_path': '/relation-tuples/check/openapi',
|
50
|
-
'operation_id': 'check_permission',
|
51
|
-
'http_method': 'GET',
|
52
|
-
'servers': None,
|
53
|
-
},
|
54
|
-
params_map={
|
55
|
-
'all': [
|
56
|
-
'namespace',
|
57
|
-
'object',
|
58
|
-
'relation',
|
59
|
-
'subject_id',
|
60
|
-
'subject_set_namespace',
|
61
|
-
'subject_set_object',
|
62
|
-
'subject_set_relation',
|
63
|
-
'max_depth',
|
64
|
-
],
|
65
|
-
'required': [],
|
66
|
-
'nullable': [
|
67
|
-
],
|
68
|
-
'enum': [
|
69
|
-
],
|
70
|
-
'validation': [
|
71
|
-
]
|
72
|
-
},
|
73
|
-
root_map={
|
74
|
-
'validations': {
|
75
|
-
},
|
76
|
-
'allowed_values': {
|
77
|
-
},
|
78
|
-
'openapi_types': {
|
79
|
-
'namespace':
|
80
|
-
(str,),
|
81
|
-
'object':
|
82
|
-
(str,),
|
83
|
-
'relation':
|
84
|
-
(str,),
|
85
|
-
'subject_id':
|
86
|
-
(str,),
|
87
|
-
'subject_set_namespace':
|
88
|
-
(str,),
|
89
|
-
'subject_set_object':
|
90
|
-
(str,),
|
91
|
-
'subject_set_relation':
|
92
|
-
(str,),
|
93
|
-
'max_depth':
|
94
|
-
(int,),
|
95
|
-
},
|
96
|
-
'attribute_map': {
|
97
|
-
'namespace': 'namespace',
|
98
|
-
'object': 'object',
|
99
|
-
'relation': 'relation',
|
100
|
-
'subject_id': 'subject_id',
|
101
|
-
'subject_set_namespace': 'subject_set.namespace',
|
102
|
-
'subject_set_object': 'subject_set.object',
|
103
|
-
'subject_set_relation': 'subject_set.relation',
|
104
|
-
'max_depth': 'max-depth',
|
105
|
-
},
|
106
|
-
'location_map': {
|
107
|
-
'namespace': 'query',
|
108
|
-
'object': 'query',
|
109
|
-
'relation': 'query',
|
110
|
-
'subject_id': 'query',
|
111
|
-
'subject_set_namespace': 'query',
|
112
|
-
'subject_set_object': 'query',
|
113
|
-
'subject_set_relation': 'query',
|
114
|
-
'max_depth': 'query',
|
115
|
-
},
|
116
|
-
'collection_format_map': {
|
117
|
-
}
|
118
|
-
},
|
119
|
-
headers_map={
|
120
|
-
'accept': [
|
121
|
-
'application/json'
|
122
|
-
],
|
123
|
-
'content_type': [],
|
124
|
-
},
|
125
|
-
api_client=api_client
|
126
|
-
)
|
127
|
-
self.check_permission_or_error_endpoint = _Endpoint(
|
128
|
-
settings={
|
129
|
-
'response_type': (CheckPermissionResult,),
|
130
|
-
'auth': [
|
131
|
-
'oryAccessToken'
|
132
|
-
],
|
133
|
-
'endpoint_path': '/relation-tuples/check',
|
134
|
-
'operation_id': 'check_permission_or_error',
|
135
|
-
'http_method': 'GET',
|
136
|
-
'servers': None,
|
137
|
-
},
|
138
|
-
params_map={
|
139
|
-
'all': [
|
140
|
-
'namespace',
|
141
|
-
'object',
|
142
|
-
'relation',
|
143
|
-
'subject_id',
|
144
|
-
'subject_set_namespace',
|
145
|
-
'subject_set_object',
|
146
|
-
'subject_set_relation',
|
147
|
-
'max_depth',
|
148
|
-
],
|
149
|
-
'required': [],
|
150
|
-
'nullable': [
|
151
|
-
],
|
152
|
-
'enum': [
|
153
|
-
],
|
154
|
-
'validation': [
|
155
|
-
]
|
156
|
-
},
|
157
|
-
root_map={
|
158
|
-
'validations': {
|
159
|
-
},
|
160
|
-
'allowed_values': {
|
161
|
-
},
|
162
|
-
'openapi_types': {
|
163
|
-
'namespace':
|
164
|
-
(str,),
|
165
|
-
'object':
|
166
|
-
(str,),
|
167
|
-
'relation':
|
168
|
-
(str,),
|
169
|
-
'subject_id':
|
170
|
-
(str,),
|
171
|
-
'subject_set_namespace':
|
172
|
-
(str,),
|
173
|
-
'subject_set_object':
|
174
|
-
(str,),
|
175
|
-
'subject_set_relation':
|
176
|
-
(str,),
|
177
|
-
'max_depth':
|
178
|
-
(int,),
|
179
|
-
},
|
180
|
-
'attribute_map': {
|
181
|
-
'namespace': 'namespace',
|
182
|
-
'object': 'object',
|
183
|
-
'relation': 'relation',
|
184
|
-
'subject_id': 'subject_id',
|
185
|
-
'subject_set_namespace': 'subject_set.namespace',
|
186
|
-
'subject_set_object': 'subject_set.object',
|
187
|
-
'subject_set_relation': 'subject_set.relation',
|
188
|
-
'max_depth': 'max-depth',
|
189
|
-
},
|
190
|
-
'location_map': {
|
191
|
-
'namespace': 'query',
|
192
|
-
'object': 'query',
|
193
|
-
'relation': 'query',
|
194
|
-
'subject_id': 'query',
|
195
|
-
'subject_set_namespace': 'query',
|
196
|
-
'subject_set_object': 'query',
|
197
|
-
'subject_set_relation': 'query',
|
198
|
-
'max_depth': 'query',
|
199
|
-
},
|
200
|
-
'collection_format_map': {
|
201
|
-
}
|
202
|
-
},
|
203
|
-
headers_map={
|
204
|
-
'accept': [
|
205
|
-
'application/json'
|
206
|
-
],
|
207
|
-
'content_type': [],
|
208
|
-
},
|
209
|
-
api_client=api_client
|
210
|
-
)
|
211
|
-
self.expand_permissions_endpoint = _Endpoint(
|
212
|
-
settings={
|
213
|
-
'response_type': (ExpandedPermissionTree,),
|
214
|
-
'auth': [
|
215
|
-
'oryAccessToken'
|
216
|
-
],
|
217
|
-
'endpoint_path': '/relation-tuples/expand',
|
218
|
-
'operation_id': 'expand_permissions',
|
219
|
-
'http_method': 'GET',
|
220
|
-
'servers': None,
|
221
|
-
},
|
222
|
-
params_map={
|
223
|
-
'all': [
|
224
|
-
'namespace',
|
225
|
-
'object',
|
226
|
-
'relation',
|
227
|
-
'max_depth',
|
228
|
-
],
|
229
|
-
'required': [
|
230
|
-
'namespace',
|
231
|
-
'object',
|
232
|
-
'relation',
|
233
|
-
],
|
234
|
-
'nullable': [
|
235
|
-
],
|
236
|
-
'enum': [
|
237
|
-
],
|
238
|
-
'validation': [
|
239
|
-
]
|
240
|
-
},
|
241
|
-
root_map={
|
242
|
-
'validations': {
|
243
|
-
},
|
244
|
-
'allowed_values': {
|
245
|
-
},
|
246
|
-
'openapi_types': {
|
247
|
-
'namespace':
|
248
|
-
(str,),
|
249
|
-
'object':
|
250
|
-
(str,),
|
251
|
-
'relation':
|
252
|
-
(str,),
|
253
|
-
'max_depth':
|
254
|
-
(int,),
|
255
|
-
},
|
256
|
-
'attribute_map': {
|
257
|
-
'namespace': 'namespace',
|
258
|
-
'object': 'object',
|
259
|
-
'relation': 'relation',
|
260
|
-
'max_depth': 'max-depth',
|
261
|
-
},
|
262
|
-
'location_map': {
|
263
|
-
'namespace': 'query',
|
264
|
-
'object': 'query',
|
265
|
-
'relation': 'query',
|
266
|
-
'max_depth': 'query',
|
267
|
-
},
|
268
|
-
'collection_format_map': {
|
269
|
-
}
|
270
|
-
},
|
271
|
-
headers_map={
|
272
|
-
'accept': [
|
273
|
-
'application/json'
|
274
|
-
],
|
275
|
-
'content_type': [],
|
276
|
-
},
|
277
|
-
api_client=api_client
|
278
|
-
)
|
279
|
-
self.post_check_permission_endpoint = _Endpoint(
|
280
|
-
settings={
|
281
|
-
'response_type': (CheckPermissionResult,),
|
282
|
-
'auth': [
|
283
|
-
'oryAccessToken'
|
284
|
-
],
|
285
|
-
'endpoint_path': '/relation-tuples/check/openapi',
|
286
|
-
'operation_id': 'post_check_permission',
|
287
|
-
'http_method': 'POST',
|
288
|
-
'servers': None,
|
289
|
-
},
|
290
|
-
params_map={
|
291
|
-
'all': [
|
292
|
-
'max_depth',
|
293
|
-
'post_check_permission_body',
|
294
|
-
],
|
295
|
-
'required': [],
|
296
|
-
'nullable': [
|
297
|
-
],
|
298
|
-
'enum': [
|
299
|
-
],
|
300
|
-
'validation': [
|
301
|
-
]
|
302
|
-
},
|
303
|
-
root_map={
|
304
|
-
'validations': {
|
305
|
-
},
|
306
|
-
'allowed_values': {
|
307
|
-
},
|
308
|
-
'openapi_types': {
|
309
|
-
'max_depth':
|
310
|
-
(int,),
|
311
|
-
'post_check_permission_body':
|
312
|
-
(PostCheckPermissionBody,),
|
313
|
-
},
|
314
|
-
'attribute_map': {
|
315
|
-
'max_depth': 'max-depth',
|
316
|
-
},
|
317
|
-
'location_map': {
|
318
|
-
'max_depth': 'query',
|
319
|
-
'post_check_permission_body': 'body',
|
320
|
-
},
|
321
|
-
'collection_format_map': {
|
322
|
-
}
|
323
|
-
},
|
324
|
-
headers_map={
|
325
|
-
'accept': [
|
326
|
-
'application/json'
|
327
|
-
],
|
328
|
-
'content_type': [
|
329
|
-
'application/json'
|
330
|
-
]
|
331
|
-
},
|
332
|
-
api_client=api_client
|
333
|
-
)
|
334
|
-
self.post_check_permission_or_error_endpoint = _Endpoint(
|
335
|
-
settings={
|
336
|
-
'response_type': (CheckPermissionResult,),
|
337
|
-
'auth': [
|
338
|
-
'oryAccessToken'
|
339
|
-
],
|
340
|
-
'endpoint_path': '/relation-tuples/check',
|
341
|
-
'operation_id': 'post_check_permission_or_error',
|
342
|
-
'http_method': 'POST',
|
343
|
-
'servers': None,
|
344
|
-
},
|
345
|
-
params_map={
|
346
|
-
'all': [
|
347
|
-
'max_depth',
|
348
|
-
'post_check_permission_or_error_body',
|
349
|
-
],
|
350
|
-
'required': [],
|
351
|
-
'nullable': [
|
352
|
-
],
|
353
|
-
'enum': [
|
354
|
-
],
|
355
|
-
'validation': [
|
356
|
-
]
|
357
|
-
},
|
358
|
-
root_map={
|
359
|
-
'validations': {
|
360
|
-
},
|
361
|
-
'allowed_values': {
|
362
|
-
},
|
363
|
-
'openapi_types': {
|
364
|
-
'max_depth':
|
365
|
-
(int,),
|
366
|
-
'post_check_permission_or_error_body':
|
367
|
-
(PostCheckPermissionOrErrorBody,),
|
368
|
-
},
|
369
|
-
'attribute_map': {
|
370
|
-
'max_depth': 'max-depth',
|
371
|
-
},
|
372
|
-
'location_map': {
|
373
|
-
'max_depth': 'query',
|
374
|
-
'post_check_permission_or_error_body': 'body',
|
375
|
-
},
|
376
|
-
'collection_format_map': {
|
377
|
-
}
|
378
|
-
},
|
379
|
-
headers_map={
|
380
|
-
'accept': [
|
381
|
-
'application/json'
|
382
|
-
],
|
383
|
-
'content_type': [
|
384
|
-
'application/json'
|
385
|
-
]
|
386
|
-
},
|
387
|
-
api_client=api_client
|
388
|
-
)
|
389
44
|
|
45
|
+
|
46
|
+
@validate_call
|
390
47
|
def check_permission(
|
391
48
|
self,
|
392
|
-
|
393
|
-
|
394
|
-
"
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
'
|
472
|
-
|
473
|
-
|
474
|
-
|
49
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
50
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
51
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
52
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
53
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
54
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
55
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
56
|
+
max_depth: Optional[StrictInt] = None,
|
57
|
+
_request_timeout: Union[
|
58
|
+
None,
|
59
|
+
Annotated[StrictFloat, Field(gt=0)],
|
60
|
+
Tuple[
|
61
|
+
Annotated[StrictFloat, Field(gt=0)],
|
62
|
+
Annotated[StrictFloat, Field(gt=0)]
|
63
|
+
]
|
64
|
+
] = None,
|
65
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
66
|
+
_content_type: Optional[StrictStr] = None,
|
67
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
68
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
69
|
+
) -> CheckPermissionResult:
|
70
|
+
"""Check a permission
|
71
|
+
|
72
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
73
|
+
|
74
|
+
:param namespace: Namespace of the Relationship
|
75
|
+
:type namespace: str
|
76
|
+
:param object: Object of the Relationship
|
77
|
+
:type object: str
|
78
|
+
:param relation: Relation of the Relationship
|
79
|
+
:type relation: str
|
80
|
+
:param subject_id: SubjectID of the Relationship
|
81
|
+
:type subject_id: str
|
82
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
83
|
+
:type subject_set_namespace: str
|
84
|
+
:param subject_set_object: Object of the Subject Set
|
85
|
+
:type subject_set_object: str
|
86
|
+
:param subject_set_relation: Relation of the Subject Set
|
87
|
+
:type subject_set_relation: str
|
88
|
+
:param max_depth:
|
89
|
+
:type max_depth: int
|
90
|
+
:param _request_timeout: timeout setting for this request. If one
|
91
|
+
number provided, it will be total request
|
92
|
+
timeout. It can also be a pair (tuple) of
|
93
|
+
(connection, read) timeouts.
|
94
|
+
:type _request_timeout: int, tuple(int, int), optional
|
95
|
+
:param _request_auth: set to override the auth_settings for an a single
|
96
|
+
request; this effectively ignores the
|
97
|
+
authentication in the spec for a single request.
|
98
|
+
:type _request_auth: dict, optional
|
99
|
+
:param _content_type: force content-type for the request.
|
100
|
+
:type _content_type: str, Optional
|
101
|
+
:param _headers: set to override the headers for a single
|
102
|
+
request; this effectively ignores the headers
|
103
|
+
in the spec for a single request.
|
104
|
+
:type _headers: dict, optional
|
105
|
+
:param _host_index: set to override the host_index for a single
|
106
|
+
request; this effectively ignores the host_index
|
107
|
+
in the spec for a single request.
|
108
|
+
:type _host_index: int, optional
|
109
|
+
:return: Returns the result object.
|
110
|
+
""" # noqa: E501
|
111
|
+
|
112
|
+
_param = self._check_permission_serialize(
|
113
|
+
namespace=namespace,
|
114
|
+
object=object,
|
115
|
+
relation=relation,
|
116
|
+
subject_id=subject_id,
|
117
|
+
subject_set_namespace=subject_set_namespace,
|
118
|
+
subject_set_object=subject_set_object,
|
119
|
+
subject_set_relation=subject_set_relation,
|
120
|
+
max_depth=max_depth,
|
121
|
+
_request_auth=_request_auth,
|
122
|
+
_content_type=_content_type,
|
123
|
+
_headers=_headers,
|
124
|
+
_host_index=_host_index
|
125
|
+
)
|
126
|
+
|
127
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
128
|
+
'200': "CheckPermissionResult",
|
129
|
+
'400': "ErrorGeneric",
|
130
|
+
}
|
131
|
+
response_data = self.api_client.call_api(
|
132
|
+
*_param,
|
133
|
+
_request_timeout=_request_timeout
|
134
|
+
)
|
135
|
+
response_data.read()
|
136
|
+
return self.api_client.response_deserialize(
|
137
|
+
response_data=response_data,
|
138
|
+
response_types_map=_response_types_map,
|
139
|
+
).data
|
140
|
+
|
141
|
+
|
142
|
+
@validate_call
|
143
|
+
def check_permission_with_http_info(
|
144
|
+
self,
|
145
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
146
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
147
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
148
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
149
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
150
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
151
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
152
|
+
max_depth: Optional[StrictInt] = None,
|
153
|
+
_request_timeout: Union[
|
154
|
+
None,
|
155
|
+
Annotated[StrictFloat, Field(gt=0)],
|
156
|
+
Tuple[
|
157
|
+
Annotated[StrictFloat, Field(gt=0)],
|
158
|
+
Annotated[StrictFloat, Field(gt=0)]
|
159
|
+
]
|
160
|
+
] = None,
|
161
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
162
|
+
_content_type: Optional[StrictStr] = None,
|
163
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
164
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
165
|
+
) -> ApiResponse[CheckPermissionResult]:
|
166
|
+
"""Check a permission
|
167
|
+
|
168
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
169
|
+
|
170
|
+
:param namespace: Namespace of the Relationship
|
171
|
+
:type namespace: str
|
172
|
+
:param object: Object of the Relationship
|
173
|
+
:type object: str
|
174
|
+
:param relation: Relation of the Relationship
|
175
|
+
:type relation: str
|
176
|
+
:param subject_id: SubjectID of the Relationship
|
177
|
+
:type subject_id: str
|
178
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
179
|
+
:type subject_set_namespace: str
|
180
|
+
:param subject_set_object: Object of the Subject Set
|
181
|
+
:type subject_set_object: str
|
182
|
+
:param subject_set_relation: Relation of the Subject Set
|
183
|
+
:type subject_set_relation: str
|
184
|
+
:param max_depth:
|
185
|
+
:type max_depth: int
|
186
|
+
:param _request_timeout: timeout setting for this request. If one
|
187
|
+
number provided, it will be total request
|
188
|
+
timeout. It can also be a pair (tuple) of
|
189
|
+
(connection, read) timeouts.
|
190
|
+
:type _request_timeout: int, tuple(int, int), optional
|
191
|
+
:param _request_auth: set to override the auth_settings for an a single
|
192
|
+
request; this effectively ignores the
|
193
|
+
authentication in the spec for a single request.
|
194
|
+
:type _request_auth: dict, optional
|
195
|
+
:param _content_type: force content-type for the request.
|
196
|
+
:type _content_type: str, Optional
|
197
|
+
:param _headers: set to override the headers for a single
|
198
|
+
request; this effectively ignores the headers
|
199
|
+
in the spec for a single request.
|
200
|
+
:type _headers: dict, optional
|
201
|
+
:param _host_index: set to override the host_index for a single
|
202
|
+
request; this effectively ignores the host_index
|
203
|
+
in the spec for a single request.
|
204
|
+
:type _host_index: int, optional
|
205
|
+
:return: Returns the result object.
|
206
|
+
""" # noqa: E501
|
207
|
+
|
208
|
+
_param = self._check_permission_serialize(
|
209
|
+
namespace=namespace,
|
210
|
+
object=object,
|
211
|
+
relation=relation,
|
212
|
+
subject_id=subject_id,
|
213
|
+
subject_set_namespace=subject_set_namespace,
|
214
|
+
subject_set_object=subject_set_object,
|
215
|
+
subject_set_relation=subject_set_relation,
|
216
|
+
max_depth=max_depth,
|
217
|
+
_request_auth=_request_auth,
|
218
|
+
_content_type=_content_type,
|
219
|
+
_headers=_headers,
|
220
|
+
_host_index=_host_index
|
221
|
+
)
|
222
|
+
|
223
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
224
|
+
'200': "CheckPermissionResult",
|
225
|
+
'400': "ErrorGeneric",
|
226
|
+
}
|
227
|
+
response_data = self.api_client.call_api(
|
228
|
+
*_param,
|
229
|
+
_request_timeout=_request_timeout
|
230
|
+
)
|
231
|
+
response_data.read()
|
232
|
+
return self.api_client.response_deserialize(
|
233
|
+
response_data=response_data,
|
234
|
+
response_types_map=_response_types_map,
|
235
|
+
)
|
236
|
+
|
237
|
+
|
238
|
+
@validate_call
|
239
|
+
def check_permission_without_preload_content(
|
240
|
+
self,
|
241
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
242
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
243
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
244
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
245
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
246
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
247
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
248
|
+
max_depth: Optional[StrictInt] = None,
|
249
|
+
_request_timeout: Union[
|
250
|
+
None,
|
251
|
+
Annotated[StrictFloat, Field(gt=0)],
|
252
|
+
Tuple[
|
253
|
+
Annotated[StrictFloat, Field(gt=0)],
|
254
|
+
Annotated[StrictFloat, Field(gt=0)]
|
255
|
+
]
|
256
|
+
] = None,
|
257
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
258
|
+
_content_type: Optional[StrictStr] = None,
|
259
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
260
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
261
|
+
) -> RESTResponseType:
|
262
|
+
"""Check a permission
|
475
263
|
|
264
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
265
|
+
|
266
|
+
:param namespace: Namespace of the Relationship
|
267
|
+
:type namespace: str
|
268
|
+
:param object: Object of the Relationship
|
269
|
+
:type object: str
|
270
|
+
:param relation: Relation of the Relationship
|
271
|
+
:type relation: str
|
272
|
+
:param subject_id: SubjectID of the Relationship
|
273
|
+
:type subject_id: str
|
274
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
275
|
+
:type subject_set_namespace: str
|
276
|
+
:param subject_set_object: Object of the Subject Set
|
277
|
+
:type subject_set_object: str
|
278
|
+
:param subject_set_relation: Relation of the Subject Set
|
279
|
+
:type subject_set_relation: str
|
280
|
+
:param max_depth:
|
281
|
+
:type max_depth: int
|
282
|
+
:param _request_timeout: timeout setting for this request. If one
|
283
|
+
number provided, it will be total request
|
284
|
+
timeout. It can also be a pair (tuple) of
|
285
|
+
(connection, read) timeouts.
|
286
|
+
:type _request_timeout: int, tuple(int, int), optional
|
287
|
+
:param _request_auth: set to override the auth_settings for an a single
|
288
|
+
request; this effectively ignores the
|
289
|
+
authentication in the spec for a single request.
|
290
|
+
:type _request_auth: dict, optional
|
291
|
+
:param _content_type: force content-type for the request.
|
292
|
+
:type _content_type: str, Optional
|
293
|
+
:param _headers: set to override the headers for a single
|
294
|
+
request; this effectively ignores the headers
|
295
|
+
in the spec for a single request.
|
296
|
+
:type _headers: dict, optional
|
297
|
+
:param _host_index: set to override the host_index for a single
|
298
|
+
request; this effectively ignores the host_index
|
299
|
+
in the spec for a single request.
|
300
|
+
:type _host_index: int, optional
|
301
|
+
:return: Returns the result object.
|
302
|
+
""" # noqa: E501
|
303
|
+
|
304
|
+
_param = self._check_permission_serialize(
|
305
|
+
namespace=namespace,
|
306
|
+
object=object,
|
307
|
+
relation=relation,
|
308
|
+
subject_id=subject_id,
|
309
|
+
subject_set_namespace=subject_set_namespace,
|
310
|
+
subject_set_object=subject_set_object,
|
311
|
+
subject_set_relation=subject_set_relation,
|
312
|
+
max_depth=max_depth,
|
313
|
+
_request_auth=_request_auth,
|
314
|
+
_content_type=_content_type,
|
315
|
+
_headers=_headers,
|
316
|
+
_host_index=_host_index
|
317
|
+
)
|
318
|
+
|
319
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
320
|
+
'200': "CheckPermissionResult",
|
321
|
+
'400': "ErrorGeneric",
|
322
|
+
}
|
323
|
+
response_data = self.api_client.call_api(
|
324
|
+
*_param,
|
325
|
+
_request_timeout=_request_timeout
|
326
|
+
)
|
327
|
+
return response_data.response
|
328
|
+
|
329
|
+
|
330
|
+
def _check_permission_serialize(
|
331
|
+
self,
|
332
|
+
namespace,
|
333
|
+
object,
|
334
|
+
relation,
|
335
|
+
subject_id,
|
336
|
+
subject_set_namespace,
|
337
|
+
subject_set_object,
|
338
|
+
subject_set_relation,
|
339
|
+
max_depth,
|
340
|
+
_request_auth,
|
341
|
+
_content_type,
|
342
|
+
_headers,
|
343
|
+
_host_index,
|
344
|
+
) -> RequestSerialized:
|
345
|
+
|
346
|
+
_host = None
|
347
|
+
|
348
|
+
_collection_formats: Dict[str, str] = {
|
349
|
+
}
|
350
|
+
|
351
|
+
_path_params: Dict[str, str] = {}
|
352
|
+
_query_params: List[Tuple[str, str]] = []
|
353
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
354
|
+
_form_params: List[Tuple[str, str]] = []
|
355
|
+
_files: Dict[str, str] = {}
|
356
|
+
_body_params: Optional[bytes] = None
|
357
|
+
|
358
|
+
# process the path parameters
|
359
|
+
# process the query parameters
|
360
|
+
if namespace is not None:
|
361
|
+
|
362
|
+
_query_params.append(('namespace', namespace))
|
363
|
+
|
364
|
+
if object is not None:
|
365
|
+
|
366
|
+
_query_params.append(('object', object))
|
367
|
+
|
368
|
+
if relation is not None:
|
369
|
+
|
370
|
+
_query_params.append(('relation', relation))
|
371
|
+
|
372
|
+
if subject_id is not None:
|
373
|
+
|
374
|
+
_query_params.append(('subject_id', subject_id))
|
375
|
+
|
376
|
+
if subject_set_namespace is not None:
|
377
|
+
|
378
|
+
_query_params.append(('subject_set.namespace', subject_set_namespace))
|
379
|
+
|
380
|
+
if subject_set_object is not None:
|
381
|
+
|
382
|
+
_query_params.append(('subject_set.object', subject_set_object))
|
383
|
+
|
384
|
+
if subject_set_relation is not None:
|
385
|
+
|
386
|
+
_query_params.append(('subject_set.relation', subject_set_relation))
|
387
|
+
|
388
|
+
if max_depth is not None:
|
389
|
+
|
390
|
+
_query_params.append(('max-depth', max_depth))
|
391
|
+
|
392
|
+
# process the header parameters
|
393
|
+
# process the form parameters
|
394
|
+
# process the body parameter
|
395
|
+
|
396
|
+
|
397
|
+
# set the HTTP header `Accept`
|
398
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
399
|
+
[
|
400
|
+
'application/json'
|
401
|
+
]
|
402
|
+
)
|
403
|
+
|
404
|
+
|
405
|
+
# authentication setting
|
406
|
+
_auth_settings: List[str] = [
|
407
|
+
'oryAccessToken'
|
408
|
+
]
|
409
|
+
|
410
|
+
return self.api_client.param_serialize(
|
411
|
+
method='GET',
|
412
|
+
resource_path='/relation-tuples/check/openapi',
|
413
|
+
path_params=_path_params,
|
414
|
+
query_params=_query_params,
|
415
|
+
header_params=_header_params,
|
416
|
+
body=_body_params,
|
417
|
+
post_params=_form_params,
|
418
|
+
files=_files,
|
419
|
+
auth_settings=_auth_settings,
|
420
|
+
collection_formats=_collection_formats,
|
421
|
+
_host=_host,
|
422
|
+
_request_auth=_request_auth
|
423
|
+
)
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
@validate_call
|
476
429
|
def check_permission_or_error(
|
477
430
|
self,
|
478
|
-
|
479
|
-
|
480
|
-
"
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
'
|
558
|
-
|
559
|
-
|
560
|
-
|
431
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
432
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
433
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
434
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
435
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
436
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
437
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
438
|
+
max_depth: Optional[StrictInt] = None,
|
439
|
+
_request_timeout: Union[
|
440
|
+
None,
|
441
|
+
Annotated[StrictFloat, Field(gt=0)],
|
442
|
+
Tuple[
|
443
|
+
Annotated[StrictFloat, Field(gt=0)],
|
444
|
+
Annotated[StrictFloat, Field(gt=0)]
|
445
|
+
]
|
446
|
+
] = None,
|
447
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
448
|
+
_content_type: Optional[StrictStr] = None,
|
449
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
450
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
451
|
+
) -> CheckPermissionResult:
|
452
|
+
"""Check a permission
|
453
|
+
|
454
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
455
|
+
|
456
|
+
:param namespace: Namespace of the Relationship
|
457
|
+
:type namespace: str
|
458
|
+
:param object: Object of the Relationship
|
459
|
+
:type object: str
|
460
|
+
:param relation: Relation of the Relationship
|
461
|
+
:type relation: str
|
462
|
+
:param subject_id: SubjectID of the Relationship
|
463
|
+
:type subject_id: str
|
464
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
465
|
+
:type subject_set_namespace: str
|
466
|
+
:param subject_set_object: Object of the Subject Set
|
467
|
+
:type subject_set_object: str
|
468
|
+
:param subject_set_relation: Relation of the Subject Set
|
469
|
+
:type subject_set_relation: str
|
470
|
+
:param max_depth:
|
471
|
+
:type max_depth: int
|
472
|
+
:param _request_timeout: timeout setting for this request. If one
|
473
|
+
number provided, it will be total request
|
474
|
+
timeout. It can also be a pair (tuple) of
|
475
|
+
(connection, read) timeouts.
|
476
|
+
:type _request_timeout: int, tuple(int, int), optional
|
477
|
+
:param _request_auth: set to override the auth_settings for an a single
|
478
|
+
request; this effectively ignores the
|
479
|
+
authentication in the spec for a single request.
|
480
|
+
:type _request_auth: dict, optional
|
481
|
+
:param _content_type: force content-type for the request.
|
482
|
+
:type _content_type: str, Optional
|
483
|
+
:param _headers: set to override the headers for a single
|
484
|
+
request; this effectively ignores the headers
|
485
|
+
in the spec for a single request.
|
486
|
+
:type _headers: dict, optional
|
487
|
+
:param _host_index: set to override the host_index for a single
|
488
|
+
request; this effectively ignores the host_index
|
489
|
+
in the spec for a single request.
|
490
|
+
:type _host_index: int, optional
|
491
|
+
:return: Returns the result object.
|
492
|
+
""" # noqa: E501
|
493
|
+
|
494
|
+
_param = self._check_permission_or_error_serialize(
|
495
|
+
namespace=namespace,
|
496
|
+
object=object,
|
497
|
+
relation=relation,
|
498
|
+
subject_id=subject_id,
|
499
|
+
subject_set_namespace=subject_set_namespace,
|
500
|
+
subject_set_object=subject_set_object,
|
501
|
+
subject_set_relation=subject_set_relation,
|
502
|
+
max_depth=max_depth,
|
503
|
+
_request_auth=_request_auth,
|
504
|
+
_content_type=_content_type,
|
505
|
+
_headers=_headers,
|
506
|
+
_host_index=_host_index
|
507
|
+
)
|
508
|
+
|
509
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
510
|
+
'200': "CheckPermissionResult",
|
511
|
+
'400': "ErrorGeneric",
|
512
|
+
'403': "CheckPermissionResult",
|
513
|
+
}
|
514
|
+
response_data = self.api_client.call_api(
|
515
|
+
*_param,
|
516
|
+
_request_timeout=_request_timeout
|
517
|
+
)
|
518
|
+
response_data.read()
|
519
|
+
return self.api_client.response_deserialize(
|
520
|
+
response_data=response_data,
|
521
|
+
response_types_map=_response_types_map,
|
522
|
+
).data
|
523
|
+
|
524
|
+
|
525
|
+
@validate_call
|
526
|
+
def check_permission_or_error_with_http_info(
|
527
|
+
self,
|
528
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
529
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
530
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
531
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
532
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
533
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
534
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
535
|
+
max_depth: Optional[StrictInt] = None,
|
536
|
+
_request_timeout: Union[
|
537
|
+
None,
|
538
|
+
Annotated[StrictFloat, Field(gt=0)],
|
539
|
+
Tuple[
|
540
|
+
Annotated[StrictFloat, Field(gt=0)],
|
541
|
+
Annotated[StrictFloat, Field(gt=0)]
|
542
|
+
]
|
543
|
+
] = None,
|
544
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
545
|
+
_content_type: Optional[StrictStr] = None,
|
546
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
547
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
548
|
+
) -> ApiResponse[CheckPermissionResult]:
|
549
|
+
"""Check a permission
|
550
|
+
|
551
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
552
|
+
|
553
|
+
:param namespace: Namespace of the Relationship
|
554
|
+
:type namespace: str
|
555
|
+
:param object: Object of the Relationship
|
556
|
+
:type object: str
|
557
|
+
:param relation: Relation of the Relationship
|
558
|
+
:type relation: str
|
559
|
+
:param subject_id: SubjectID of the Relationship
|
560
|
+
:type subject_id: str
|
561
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
562
|
+
:type subject_set_namespace: str
|
563
|
+
:param subject_set_object: Object of the Subject Set
|
564
|
+
:type subject_set_object: str
|
565
|
+
:param subject_set_relation: Relation of the Subject Set
|
566
|
+
:type subject_set_relation: str
|
567
|
+
:param max_depth:
|
568
|
+
:type max_depth: int
|
569
|
+
:param _request_timeout: timeout setting for this request. If one
|
570
|
+
number provided, it will be total request
|
571
|
+
timeout. It can also be a pair (tuple) of
|
572
|
+
(connection, read) timeouts.
|
573
|
+
:type _request_timeout: int, tuple(int, int), optional
|
574
|
+
:param _request_auth: set to override the auth_settings for an a single
|
575
|
+
request; this effectively ignores the
|
576
|
+
authentication in the spec for a single request.
|
577
|
+
:type _request_auth: dict, optional
|
578
|
+
:param _content_type: force content-type for the request.
|
579
|
+
:type _content_type: str, Optional
|
580
|
+
:param _headers: set to override the headers for a single
|
581
|
+
request; this effectively ignores the headers
|
582
|
+
in the spec for a single request.
|
583
|
+
:type _headers: dict, optional
|
584
|
+
:param _host_index: set to override the host_index for a single
|
585
|
+
request; this effectively ignores the host_index
|
586
|
+
in the spec for a single request.
|
587
|
+
:type _host_index: int, optional
|
588
|
+
:return: Returns the result object.
|
589
|
+
""" # noqa: E501
|
590
|
+
|
591
|
+
_param = self._check_permission_or_error_serialize(
|
592
|
+
namespace=namespace,
|
593
|
+
object=object,
|
594
|
+
relation=relation,
|
595
|
+
subject_id=subject_id,
|
596
|
+
subject_set_namespace=subject_set_namespace,
|
597
|
+
subject_set_object=subject_set_object,
|
598
|
+
subject_set_relation=subject_set_relation,
|
599
|
+
max_depth=max_depth,
|
600
|
+
_request_auth=_request_auth,
|
601
|
+
_content_type=_content_type,
|
602
|
+
_headers=_headers,
|
603
|
+
_host_index=_host_index
|
604
|
+
)
|
605
|
+
|
606
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
607
|
+
'200': "CheckPermissionResult",
|
608
|
+
'400': "ErrorGeneric",
|
609
|
+
'403': "CheckPermissionResult",
|
610
|
+
}
|
611
|
+
response_data = self.api_client.call_api(
|
612
|
+
*_param,
|
613
|
+
_request_timeout=_request_timeout
|
614
|
+
)
|
615
|
+
response_data.read()
|
616
|
+
return self.api_client.response_deserialize(
|
617
|
+
response_data=response_data,
|
618
|
+
response_types_map=_response_types_map,
|
619
|
+
)
|
620
|
+
|
621
|
+
|
622
|
+
@validate_call
|
623
|
+
def check_permission_or_error_without_preload_content(
|
624
|
+
self,
|
625
|
+
namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Relationship")] = None,
|
626
|
+
object: Annotated[Optional[StrictStr], Field(description="Object of the Relationship")] = None,
|
627
|
+
relation: Annotated[Optional[StrictStr], Field(description="Relation of the Relationship")] = None,
|
628
|
+
subject_id: Annotated[Optional[StrictStr], Field(description="SubjectID of the Relationship")] = None,
|
629
|
+
subject_set_namespace: Annotated[Optional[StrictStr], Field(description="Namespace of the Subject Set")] = None,
|
630
|
+
subject_set_object: Annotated[Optional[StrictStr], Field(description="Object of the Subject Set")] = None,
|
631
|
+
subject_set_relation: Annotated[Optional[StrictStr], Field(description="Relation of the Subject Set")] = None,
|
632
|
+
max_depth: Optional[StrictInt] = None,
|
633
|
+
_request_timeout: Union[
|
634
|
+
None,
|
635
|
+
Annotated[StrictFloat, Field(gt=0)],
|
636
|
+
Tuple[
|
637
|
+
Annotated[StrictFloat, Field(gt=0)],
|
638
|
+
Annotated[StrictFloat, Field(gt=0)]
|
639
|
+
]
|
640
|
+
] = None,
|
641
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
642
|
+
_content_type: Optional[StrictStr] = None,
|
643
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
644
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
645
|
+
) -> RESTResponseType:
|
646
|
+
"""Check a permission
|
647
|
+
|
648
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
649
|
+
|
650
|
+
:param namespace: Namespace of the Relationship
|
651
|
+
:type namespace: str
|
652
|
+
:param object: Object of the Relationship
|
653
|
+
:type object: str
|
654
|
+
:param relation: Relation of the Relationship
|
655
|
+
:type relation: str
|
656
|
+
:param subject_id: SubjectID of the Relationship
|
657
|
+
:type subject_id: str
|
658
|
+
:param subject_set_namespace: Namespace of the Subject Set
|
659
|
+
:type subject_set_namespace: str
|
660
|
+
:param subject_set_object: Object of the Subject Set
|
661
|
+
:type subject_set_object: str
|
662
|
+
:param subject_set_relation: Relation of the Subject Set
|
663
|
+
:type subject_set_relation: str
|
664
|
+
:param max_depth:
|
665
|
+
:type max_depth: int
|
666
|
+
:param _request_timeout: timeout setting for this request. If one
|
667
|
+
number provided, it will be total request
|
668
|
+
timeout. It can also be a pair (tuple) of
|
669
|
+
(connection, read) timeouts.
|
670
|
+
:type _request_timeout: int, tuple(int, int), optional
|
671
|
+
:param _request_auth: set to override the auth_settings for an a single
|
672
|
+
request; this effectively ignores the
|
673
|
+
authentication in the spec for a single request.
|
674
|
+
:type _request_auth: dict, optional
|
675
|
+
:param _content_type: force content-type for the request.
|
676
|
+
:type _content_type: str, Optional
|
677
|
+
:param _headers: set to override the headers for a single
|
678
|
+
request; this effectively ignores the headers
|
679
|
+
in the spec for a single request.
|
680
|
+
:type _headers: dict, optional
|
681
|
+
:param _host_index: set to override the host_index for a single
|
682
|
+
request; this effectively ignores the host_index
|
683
|
+
in the spec for a single request.
|
684
|
+
:type _host_index: int, optional
|
685
|
+
:return: Returns the result object.
|
686
|
+
""" # noqa: E501
|
687
|
+
|
688
|
+
_param = self._check_permission_or_error_serialize(
|
689
|
+
namespace=namespace,
|
690
|
+
object=object,
|
691
|
+
relation=relation,
|
692
|
+
subject_id=subject_id,
|
693
|
+
subject_set_namespace=subject_set_namespace,
|
694
|
+
subject_set_object=subject_set_object,
|
695
|
+
subject_set_relation=subject_set_relation,
|
696
|
+
max_depth=max_depth,
|
697
|
+
_request_auth=_request_auth,
|
698
|
+
_content_type=_content_type,
|
699
|
+
_headers=_headers,
|
700
|
+
_host_index=_host_index
|
701
|
+
)
|
702
|
+
|
703
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
704
|
+
'200': "CheckPermissionResult",
|
705
|
+
'400': "ErrorGeneric",
|
706
|
+
'403': "CheckPermissionResult",
|
707
|
+
}
|
708
|
+
response_data = self.api_client.call_api(
|
709
|
+
*_param,
|
710
|
+
_request_timeout=_request_timeout
|
711
|
+
)
|
712
|
+
return response_data.response
|
713
|
+
|
714
|
+
|
715
|
+
def _check_permission_or_error_serialize(
|
716
|
+
self,
|
717
|
+
namespace,
|
718
|
+
object,
|
719
|
+
relation,
|
720
|
+
subject_id,
|
721
|
+
subject_set_namespace,
|
722
|
+
subject_set_object,
|
723
|
+
subject_set_relation,
|
724
|
+
max_depth,
|
725
|
+
_request_auth,
|
726
|
+
_content_type,
|
727
|
+
_headers,
|
728
|
+
_host_index,
|
729
|
+
) -> RequestSerialized:
|
730
|
+
|
731
|
+
_host = None
|
561
732
|
|
733
|
+
_collection_formats: Dict[str, str] = {
|
734
|
+
}
|
735
|
+
|
736
|
+
_path_params: Dict[str, str] = {}
|
737
|
+
_query_params: List[Tuple[str, str]] = []
|
738
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
739
|
+
_form_params: List[Tuple[str, str]] = []
|
740
|
+
_files: Dict[str, str] = {}
|
741
|
+
_body_params: Optional[bytes] = None
|
742
|
+
|
743
|
+
# process the path parameters
|
744
|
+
# process the query parameters
|
745
|
+
if namespace is not None:
|
746
|
+
|
747
|
+
_query_params.append(('namespace', namespace))
|
748
|
+
|
749
|
+
if object is not None:
|
750
|
+
|
751
|
+
_query_params.append(('object', object))
|
752
|
+
|
753
|
+
if relation is not None:
|
754
|
+
|
755
|
+
_query_params.append(('relation', relation))
|
756
|
+
|
757
|
+
if subject_id is not None:
|
758
|
+
|
759
|
+
_query_params.append(('subject_id', subject_id))
|
760
|
+
|
761
|
+
if subject_set_namespace is not None:
|
762
|
+
|
763
|
+
_query_params.append(('subject_set.namespace', subject_set_namespace))
|
764
|
+
|
765
|
+
if subject_set_object is not None:
|
766
|
+
|
767
|
+
_query_params.append(('subject_set.object', subject_set_object))
|
768
|
+
|
769
|
+
if subject_set_relation is not None:
|
770
|
+
|
771
|
+
_query_params.append(('subject_set.relation', subject_set_relation))
|
772
|
+
|
773
|
+
if max_depth is not None:
|
774
|
+
|
775
|
+
_query_params.append(('max-depth', max_depth))
|
776
|
+
|
777
|
+
# process the header parameters
|
778
|
+
# process the form parameters
|
779
|
+
# process the body parameter
|
780
|
+
|
781
|
+
|
782
|
+
# set the HTTP header `Accept`
|
783
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
784
|
+
[
|
785
|
+
'application/json'
|
786
|
+
]
|
787
|
+
)
|
788
|
+
|
789
|
+
|
790
|
+
# authentication setting
|
791
|
+
_auth_settings: List[str] = [
|
792
|
+
'oryAccessToken'
|
793
|
+
]
|
794
|
+
|
795
|
+
return self.api_client.param_serialize(
|
796
|
+
method='GET',
|
797
|
+
resource_path='/relation-tuples/check',
|
798
|
+
path_params=_path_params,
|
799
|
+
query_params=_query_params,
|
800
|
+
header_params=_header_params,
|
801
|
+
body=_body_params,
|
802
|
+
post_params=_form_params,
|
803
|
+
files=_files,
|
804
|
+
auth_settings=_auth_settings,
|
805
|
+
collection_formats=_collection_formats,
|
806
|
+
_host=_host,
|
807
|
+
_request_auth=_request_auth
|
808
|
+
)
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
|
813
|
+
@validate_call
|
562
814
|
def expand_permissions(
|
815
|
+
self,
|
816
|
+
namespace: Annotated[StrictStr, Field(description="Namespace of the Subject Set")],
|
817
|
+
object: Annotated[StrictStr, Field(description="Object of the Subject Set")],
|
818
|
+
relation: Annotated[StrictStr, Field(description="Relation of the Subject Set")],
|
819
|
+
max_depth: Optional[StrictInt] = None,
|
820
|
+
_request_timeout: Union[
|
821
|
+
None,
|
822
|
+
Annotated[StrictFloat, Field(gt=0)],
|
823
|
+
Tuple[
|
824
|
+
Annotated[StrictFloat, Field(gt=0)],
|
825
|
+
Annotated[StrictFloat, Field(gt=0)]
|
826
|
+
]
|
827
|
+
] = None,
|
828
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
829
|
+
_content_type: Optional[StrictStr] = None,
|
830
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
831
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
832
|
+
) -> ExpandedPermissionTree:
|
833
|
+
"""Expand a Relationship into permissions.
|
834
|
+
|
835
|
+
Use this endpoint to expand a relationship tuple into permissions.
|
836
|
+
|
837
|
+
:param namespace: Namespace of the Subject Set (required)
|
838
|
+
:type namespace: str
|
839
|
+
:param object: Object of the Subject Set (required)
|
840
|
+
:type object: str
|
841
|
+
:param relation: Relation of the Subject Set (required)
|
842
|
+
:type relation: str
|
843
|
+
:param max_depth:
|
844
|
+
:type max_depth: int
|
845
|
+
:param _request_timeout: timeout setting for this request. If one
|
846
|
+
number provided, it will be total request
|
847
|
+
timeout. It can also be a pair (tuple) of
|
848
|
+
(connection, read) timeouts.
|
849
|
+
:type _request_timeout: int, tuple(int, int), optional
|
850
|
+
:param _request_auth: set to override the auth_settings for an a single
|
851
|
+
request; this effectively ignores the
|
852
|
+
authentication in the spec for a single request.
|
853
|
+
:type _request_auth: dict, optional
|
854
|
+
:param _content_type: force content-type for the request.
|
855
|
+
:type _content_type: str, Optional
|
856
|
+
:param _headers: set to override the headers for a single
|
857
|
+
request; this effectively ignores the headers
|
858
|
+
in the spec for a single request.
|
859
|
+
:type _headers: dict, optional
|
860
|
+
:param _host_index: set to override the host_index for a single
|
861
|
+
request; this effectively ignores the host_index
|
862
|
+
in the spec for a single request.
|
863
|
+
:type _host_index: int, optional
|
864
|
+
:return: Returns the result object.
|
865
|
+
""" # noqa: E501
|
866
|
+
|
867
|
+
_param = self._expand_permissions_serialize(
|
868
|
+
namespace=namespace,
|
869
|
+
object=object,
|
870
|
+
relation=relation,
|
871
|
+
max_depth=max_depth,
|
872
|
+
_request_auth=_request_auth,
|
873
|
+
_content_type=_content_type,
|
874
|
+
_headers=_headers,
|
875
|
+
_host_index=_host_index
|
876
|
+
)
|
877
|
+
|
878
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
879
|
+
'200': "ExpandedPermissionTree",
|
880
|
+
'400': "ErrorGeneric",
|
881
|
+
'404': "ErrorGeneric",
|
882
|
+
}
|
883
|
+
response_data = self.api_client.call_api(
|
884
|
+
*_param,
|
885
|
+
_request_timeout=_request_timeout
|
886
|
+
)
|
887
|
+
response_data.read()
|
888
|
+
return self.api_client.response_deserialize(
|
889
|
+
response_data=response_data,
|
890
|
+
response_types_map=_response_types_map,
|
891
|
+
).data
|
892
|
+
|
893
|
+
|
894
|
+
@validate_call
|
895
|
+
def expand_permissions_with_http_info(
|
896
|
+
self,
|
897
|
+
namespace: Annotated[StrictStr, Field(description="Namespace of the Subject Set")],
|
898
|
+
object: Annotated[StrictStr, Field(description="Object of the Subject Set")],
|
899
|
+
relation: Annotated[StrictStr, Field(description="Relation of the Subject Set")],
|
900
|
+
max_depth: Optional[StrictInt] = None,
|
901
|
+
_request_timeout: Union[
|
902
|
+
None,
|
903
|
+
Annotated[StrictFloat, Field(gt=0)],
|
904
|
+
Tuple[
|
905
|
+
Annotated[StrictFloat, Field(gt=0)],
|
906
|
+
Annotated[StrictFloat, Field(gt=0)]
|
907
|
+
]
|
908
|
+
] = None,
|
909
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
910
|
+
_content_type: Optional[StrictStr] = None,
|
911
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
912
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
913
|
+
) -> ApiResponse[ExpandedPermissionTree]:
|
914
|
+
"""Expand a Relationship into permissions.
|
915
|
+
|
916
|
+
Use this endpoint to expand a relationship tuple into permissions.
|
917
|
+
|
918
|
+
:param namespace: Namespace of the Subject Set (required)
|
919
|
+
:type namespace: str
|
920
|
+
:param object: Object of the Subject Set (required)
|
921
|
+
:type object: str
|
922
|
+
:param relation: Relation of the Subject Set (required)
|
923
|
+
:type relation: str
|
924
|
+
:param max_depth:
|
925
|
+
:type max_depth: int
|
926
|
+
:param _request_timeout: timeout setting for this request. If one
|
927
|
+
number provided, it will be total request
|
928
|
+
timeout. It can also be a pair (tuple) of
|
929
|
+
(connection, read) timeouts.
|
930
|
+
:type _request_timeout: int, tuple(int, int), optional
|
931
|
+
:param _request_auth: set to override the auth_settings for an a single
|
932
|
+
request; this effectively ignores the
|
933
|
+
authentication in the spec for a single request.
|
934
|
+
:type _request_auth: dict, optional
|
935
|
+
:param _content_type: force content-type for the request.
|
936
|
+
:type _content_type: str, Optional
|
937
|
+
:param _headers: set to override the headers for a single
|
938
|
+
request; this effectively ignores the headers
|
939
|
+
in the spec for a single request.
|
940
|
+
:type _headers: dict, optional
|
941
|
+
:param _host_index: set to override the host_index for a single
|
942
|
+
request; this effectively ignores the host_index
|
943
|
+
in the spec for a single request.
|
944
|
+
:type _host_index: int, optional
|
945
|
+
:return: Returns the result object.
|
946
|
+
""" # noqa: E501
|
947
|
+
|
948
|
+
_param = self._expand_permissions_serialize(
|
949
|
+
namespace=namespace,
|
950
|
+
object=object,
|
951
|
+
relation=relation,
|
952
|
+
max_depth=max_depth,
|
953
|
+
_request_auth=_request_auth,
|
954
|
+
_content_type=_content_type,
|
955
|
+
_headers=_headers,
|
956
|
+
_host_index=_host_index
|
957
|
+
)
|
958
|
+
|
959
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
960
|
+
'200': "ExpandedPermissionTree",
|
961
|
+
'400': "ErrorGeneric",
|
962
|
+
'404': "ErrorGeneric",
|
963
|
+
}
|
964
|
+
response_data = self.api_client.call_api(
|
965
|
+
*_param,
|
966
|
+
_request_timeout=_request_timeout
|
967
|
+
)
|
968
|
+
response_data.read()
|
969
|
+
return self.api_client.response_deserialize(
|
970
|
+
response_data=response_data,
|
971
|
+
response_types_map=_response_types_map,
|
972
|
+
)
|
973
|
+
|
974
|
+
|
975
|
+
@validate_call
|
976
|
+
def expand_permissions_without_preload_content(
|
977
|
+
self,
|
978
|
+
namespace: Annotated[StrictStr, Field(description="Namespace of the Subject Set")],
|
979
|
+
object: Annotated[StrictStr, Field(description="Object of the Subject Set")],
|
980
|
+
relation: Annotated[StrictStr, Field(description="Relation of the Subject Set")],
|
981
|
+
max_depth: Optional[StrictInt] = None,
|
982
|
+
_request_timeout: Union[
|
983
|
+
None,
|
984
|
+
Annotated[StrictFloat, Field(gt=0)],
|
985
|
+
Tuple[
|
986
|
+
Annotated[StrictFloat, Field(gt=0)],
|
987
|
+
Annotated[StrictFloat, Field(gt=0)]
|
988
|
+
]
|
989
|
+
] = None,
|
990
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
991
|
+
_content_type: Optional[StrictStr] = None,
|
992
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
993
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
994
|
+
) -> RESTResponseType:
|
995
|
+
"""Expand a Relationship into permissions.
|
996
|
+
|
997
|
+
Use this endpoint to expand a relationship tuple into permissions.
|
998
|
+
|
999
|
+
:param namespace: Namespace of the Subject Set (required)
|
1000
|
+
:type namespace: str
|
1001
|
+
:param object: Object of the Subject Set (required)
|
1002
|
+
:type object: str
|
1003
|
+
:param relation: Relation of the Subject Set (required)
|
1004
|
+
:type relation: str
|
1005
|
+
:param max_depth:
|
1006
|
+
:type max_depth: int
|
1007
|
+
:param _request_timeout: timeout setting for this request. If one
|
1008
|
+
number provided, it will be total request
|
1009
|
+
timeout. It can also be a pair (tuple) of
|
1010
|
+
(connection, read) timeouts.
|
1011
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1012
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1013
|
+
request; this effectively ignores the
|
1014
|
+
authentication in the spec for a single request.
|
1015
|
+
:type _request_auth: dict, optional
|
1016
|
+
:param _content_type: force content-type for the request.
|
1017
|
+
:type _content_type: str, Optional
|
1018
|
+
:param _headers: set to override the headers for a single
|
1019
|
+
request; this effectively ignores the headers
|
1020
|
+
in the spec for a single request.
|
1021
|
+
:type _headers: dict, optional
|
1022
|
+
:param _host_index: set to override the host_index for a single
|
1023
|
+
request; this effectively ignores the host_index
|
1024
|
+
in the spec for a single request.
|
1025
|
+
:type _host_index: int, optional
|
1026
|
+
:return: Returns the result object.
|
1027
|
+
""" # noqa: E501
|
1028
|
+
|
1029
|
+
_param = self._expand_permissions_serialize(
|
1030
|
+
namespace=namespace,
|
1031
|
+
object=object,
|
1032
|
+
relation=relation,
|
1033
|
+
max_depth=max_depth,
|
1034
|
+
_request_auth=_request_auth,
|
1035
|
+
_content_type=_content_type,
|
1036
|
+
_headers=_headers,
|
1037
|
+
_host_index=_host_index
|
1038
|
+
)
|
1039
|
+
|
1040
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1041
|
+
'200': "ExpandedPermissionTree",
|
1042
|
+
'400': "ErrorGeneric",
|
1043
|
+
'404': "ErrorGeneric",
|
1044
|
+
}
|
1045
|
+
response_data = self.api_client.call_api(
|
1046
|
+
*_param,
|
1047
|
+
_request_timeout=_request_timeout
|
1048
|
+
)
|
1049
|
+
return response_data.response
|
1050
|
+
|
1051
|
+
|
1052
|
+
def _expand_permissions_serialize(
|
563
1053
|
self,
|
564
1054
|
namespace,
|
565
1055
|
object,
|
566
1056
|
relation,
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
)
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
kwargs['_spec_property_naming'] = kwargs.get(
|
640
|
-
'_spec_property_naming', False
|
641
|
-
)
|
642
|
-
kwargs['_content_type'] = kwargs.get(
|
643
|
-
'_content_type')
|
644
|
-
kwargs['_host_index'] = kwargs.get('_host_index')
|
645
|
-
kwargs['_request_auths'] = kwargs.get('_request_auths', None)
|
646
|
-
kwargs['namespace'] = \
|
647
|
-
namespace
|
648
|
-
kwargs['object'] = \
|
649
|
-
object
|
650
|
-
kwargs['relation'] = \
|
651
|
-
relation
|
652
|
-
return self.expand_permissions_endpoint.call_with_http_info(**kwargs)
|
1057
|
+
max_depth,
|
1058
|
+
_request_auth,
|
1059
|
+
_content_type,
|
1060
|
+
_headers,
|
1061
|
+
_host_index,
|
1062
|
+
) -> RequestSerialized:
|
1063
|
+
|
1064
|
+
_host = None
|
1065
|
+
|
1066
|
+
_collection_formats: Dict[str, str] = {
|
1067
|
+
}
|
1068
|
+
|
1069
|
+
_path_params: Dict[str, str] = {}
|
1070
|
+
_query_params: List[Tuple[str, str]] = []
|
1071
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1072
|
+
_form_params: List[Tuple[str, str]] = []
|
1073
|
+
_files: Dict[str, str] = {}
|
1074
|
+
_body_params: Optional[bytes] = None
|
1075
|
+
|
1076
|
+
# process the path parameters
|
1077
|
+
# process the query parameters
|
1078
|
+
if namespace is not None:
|
1079
|
+
|
1080
|
+
_query_params.append(('namespace', namespace))
|
1081
|
+
|
1082
|
+
if object is not None:
|
1083
|
+
|
1084
|
+
_query_params.append(('object', object))
|
1085
|
+
|
1086
|
+
if relation is not None:
|
1087
|
+
|
1088
|
+
_query_params.append(('relation', relation))
|
1089
|
+
|
1090
|
+
if max_depth is not None:
|
1091
|
+
|
1092
|
+
_query_params.append(('max-depth', max_depth))
|
1093
|
+
|
1094
|
+
# process the header parameters
|
1095
|
+
# process the form parameters
|
1096
|
+
# process the body parameter
|
1097
|
+
|
1098
|
+
|
1099
|
+
# set the HTTP header `Accept`
|
1100
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1101
|
+
[
|
1102
|
+
'application/json'
|
1103
|
+
]
|
1104
|
+
)
|
1105
|
+
|
1106
|
+
|
1107
|
+
# authentication setting
|
1108
|
+
_auth_settings: List[str] = [
|
1109
|
+
'oryAccessToken'
|
1110
|
+
]
|
1111
|
+
|
1112
|
+
return self.api_client.param_serialize(
|
1113
|
+
method='GET',
|
1114
|
+
resource_path='/relation-tuples/expand',
|
1115
|
+
path_params=_path_params,
|
1116
|
+
query_params=_query_params,
|
1117
|
+
header_params=_header_params,
|
1118
|
+
body=_body_params,
|
1119
|
+
post_params=_form_params,
|
1120
|
+
files=_files,
|
1121
|
+
auth_settings=_auth_settings,
|
1122
|
+
collection_formats=_collection_formats,
|
1123
|
+
_host=_host,
|
1124
|
+
_request_auth=_request_auth
|
1125
|
+
)
|
1126
|
+
|
1127
|
+
|
1128
|
+
|
653
1129
|
|
1130
|
+
@validate_call
|
654
1131
|
def post_check_permission(
|
655
1132
|
self,
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
'
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
)
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
1133
|
+
max_depth: Optional[StrictInt] = None,
|
1134
|
+
post_check_permission_body: Optional[PostCheckPermissionBody] = None,
|
1135
|
+
_request_timeout: Union[
|
1136
|
+
None,
|
1137
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1138
|
+
Tuple[
|
1139
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1140
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1141
|
+
]
|
1142
|
+
] = None,
|
1143
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1144
|
+
_content_type: Optional[StrictStr] = None,
|
1145
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1146
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1147
|
+
) -> CheckPermissionResult:
|
1148
|
+
"""Check a permission
|
1149
|
+
|
1150
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1151
|
+
|
1152
|
+
:param max_depth:
|
1153
|
+
:type max_depth: int
|
1154
|
+
:param post_check_permission_body:
|
1155
|
+
:type post_check_permission_body: PostCheckPermissionBody
|
1156
|
+
:param _request_timeout: timeout setting for this request. If one
|
1157
|
+
number provided, it will be total request
|
1158
|
+
timeout. It can also be a pair (tuple) of
|
1159
|
+
(connection, read) timeouts.
|
1160
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1161
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1162
|
+
request; this effectively ignores the
|
1163
|
+
authentication in the spec for a single request.
|
1164
|
+
:type _request_auth: dict, optional
|
1165
|
+
:param _content_type: force content-type for the request.
|
1166
|
+
:type _content_type: str, Optional
|
1167
|
+
:param _headers: set to override the headers for a single
|
1168
|
+
request; this effectively ignores the headers
|
1169
|
+
in the spec for a single request.
|
1170
|
+
:type _headers: dict, optional
|
1171
|
+
:param _host_index: set to override the host_index for a single
|
1172
|
+
request; this effectively ignores the host_index
|
1173
|
+
in the spec for a single request.
|
1174
|
+
:type _host_index: int, optional
|
1175
|
+
:return: Returns the result object.
|
1176
|
+
""" # noqa: E501
|
1177
|
+
|
1178
|
+
_param = self._post_check_permission_serialize(
|
1179
|
+
max_depth=max_depth,
|
1180
|
+
post_check_permission_body=post_check_permission_body,
|
1181
|
+
_request_auth=_request_auth,
|
1182
|
+
_content_type=_content_type,
|
1183
|
+
_headers=_headers,
|
1184
|
+
_host_index=_host_index
|
1185
|
+
)
|
1186
|
+
|
1187
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1188
|
+
'200': "CheckPermissionResult",
|
1189
|
+
'400': "ErrorGeneric",
|
1190
|
+
}
|
1191
|
+
response_data = self.api_client.call_api(
|
1192
|
+
*_param,
|
1193
|
+
_request_timeout=_request_timeout
|
1194
|
+
)
|
1195
|
+
response_data.read()
|
1196
|
+
return self.api_client.response_deserialize(
|
1197
|
+
response_data=response_data,
|
1198
|
+
response_types_map=_response_types_map,
|
1199
|
+
).data
|
1200
|
+
|
1201
|
+
|
1202
|
+
@validate_call
|
1203
|
+
def post_check_permission_with_http_info(
|
1204
|
+
self,
|
1205
|
+
max_depth: Optional[StrictInt] = None,
|
1206
|
+
post_check_permission_body: Optional[PostCheckPermissionBody] = None,
|
1207
|
+
_request_timeout: Union[
|
1208
|
+
None,
|
1209
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1210
|
+
Tuple[
|
1211
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1212
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1213
|
+
]
|
1214
|
+
] = None,
|
1215
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1216
|
+
_content_type: Optional[StrictStr] = None,
|
1217
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1218
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1219
|
+
) -> ApiResponse[CheckPermissionResult]:
|
1220
|
+
"""Check a permission
|
1221
|
+
|
1222
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1223
|
+
|
1224
|
+
:param max_depth:
|
1225
|
+
:type max_depth: int
|
1226
|
+
:param post_check_permission_body:
|
1227
|
+
:type post_check_permission_body: PostCheckPermissionBody
|
1228
|
+
:param _request_timeout: timeout setting for this request. If one
|
1229
|
+
number provided, it will be total request
|
1230
|
+
timeout. It can also be a pair (tuple) of
|
1231
|
+
(connection, read) timeouts.
|
1232
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1233
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1234
|
+
request; this effectively ignores the
|
1235
|
+
authentication in the spec for a single request.
|
1236
|
+
:type _request_auth: dict, optional
|
1237
|
+
:param _content_type: force content-type for the request.
|
1238
|
+
:type _content_type: str, Optional
|
1239
|
+
:param _headers: set to override the headers for a single
|
1240
|
+
request; this effectively ignores the headers
|
1241
|
+
in the spec for a single request.
|
1242
|
+
:type _headers: dict, optional
|
1243
|
+
:param _host_index: set to override the host_index for a single
|
1244
|
+
request; this effectively ignores the host_index
|
1245
|
+
in the spec for a single request.
|
1246
|
+
:type _host_index: int, optional
|
1247
|
+
:return: Returns the result object.
|
1248
|
+
""" # noqa: E501
|
1249
|
+
|
1250
|
+
_param = self._post_check_permission_serialize(
|
1251
|
+
max_depth=max_depth,
|
1252
|
+
post_check_permission_body=post_check_permission_body,
|
1253
|
+
_request_auth=_request_auth,
|
1254
|
+
_content_type=_content_type,
|
1255
|
+
_headers=_headers,
|
1256
|
+
_host_index=_host_index
|
1257
|
+
)
|
1258
|
+
|
1259
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1260
|
+
'200': "CheckPermissionResult",
|
1261
|
+
'400': "ErrorGeneric",
|
1262
|
+
}
|
1263
|
+
response_data = self.api_client.call_api(
|
1264
|
+
*_param,
|
1265
|
+
_request_timeout=_request_timeout
|
1266
|
+
)
|
1267
|
+
response_data.read()
|
1268
|
+
return self.api_client.response_deserialize(
|
1269
|
+
response_data=response_data,
|
1270
|
+
response_types_map=_response_types_map,
|
1271
|
+
)
|
1272
|
+
|
1273
|
+
|
1274
|
+
@validate_call
|
1275
|
+
def post_check_permission_without_preload_content(
|
1276
|
+
self,
|
1277
|
+
max_depth: Optional[StrictInt] = None,
|
1278
|
+
post_check_permission_body: Optional[PostCheckPermissionBody] = None,
|
1279
|
+
_request_timeout: Union[
|
1280
|
+
None,
|
1281
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1282
|
+
Tuple[
|
1283
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1284
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1285
|
+
]
|
1286
|
+
] = None,
|
1287
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1288
|
+
_content_type: Optional[StrictStr] = None,
|
1289
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1290
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1291
|
+
) -> RESTResponseType:
|
1292
|
+
"""Check a permission
|
1293
|
+
|
1294
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1295
|
+
|
1296
|
+
:param max_depth:
|
1297
|
+
:type max_depth: int
|
1298
|
+
:param post_check_permission_body:
|
1299
|
+
:type post_check_permission_body: PostCheckPermissionBody
|
1300
|
+
:param _request_timeout: timeout setting for this request. If one
|
1301
|
+
number provided, it will be total request
|
1302
|
+
timeout. It can also be a pair (tuple) of
|
1303
|
+
(connection, read) timeouts.
|
1304
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1305
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1306
|
+
request; this effectively ignores the
|
1307
|
+
authentication in the spec for a single request.
|
1308
|
+
:type _request_auth: dict, optional
|
1309
|
+
:param _content_type: force content-type for the request.
|
1310
|
+
:type _content_type: str, Optional
|
1311
|
+
:param _headers: set to override the headers for a single
|
1312
|
+
request; this effectively ignores the headers
|
1313
|
+
in the spec for a single request.
|
1314
|
+
:type _headers: dict, optional
|
1315
|
+
:param _host_index: set to override the host_index for a single
|
1316
|
+
request; this effectively ignores the host_index
|
1317
|
+
in the spec for a single request.
|
1318
|
+
:type _host_index: int, optional
|
1319
|
+
:return: Returns the result object.
|
1320
|
+
""" # noqa: E501
|
1321
|
+
|
1322
|
+
_param = self._post_check_permission_serialize(
|
1323
|
+
max_depth=max_depth,
|
1324
|
+
post_check_permission_body=post_check_permission_body,
|
1325
|
+
_request_auth=_request_auth,
|
1326
|
+
_content_type=_content_type,
|
1327
|
+
_headers=_headers,
|
1328
|
+
_host_index=_host_index
|
1329
|
+
)
|
1330
|
+
|
1331
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1332
|
+
'200': "CheckPermissionResult",
|
1333
|
+
'400': "ErrorGeneric",
|
1334
|
+
}
|
1335
|
+
response_data = self.api_client.call_api(
|
1336
|
+
*_param,
|
1337
|
+
_request_timeout=_request_timeout
|
1338
|
+
)
|
1339
|
+
return response_data.response
|
1340
|
+
|
1341
|
+
|
1342
|
+
def _post_check_permission_serialize(
|
1343
|
+
self,
|
1344
|
+
max_depth,
|
1345
|
+
post_check_permission_body,
|
1346
|
+
_request_auth,
|
1347
|
+
_content_type,
|
1348
|
+
_headers,
|
1349
|
+
_host_index,
|
1350
|
+
) -> RequestSerialized:
|
1351
|
+
|
1352
|
+
_host = None
|
1353
|
+
|
1354
|
+
_collection_formats: Dict[str, str] = {
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
_path_params: Dict[str, str] = {}
|
1358
|
+
_query_params: List[Tuple[str, str]] = []
|
1359
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1360
|
+
_form_params: List[Tuple[str, str]] = []
|
1361
|
+
_files: Dict[str, str] = {}
|
1362
|
+
_body_params: Optional[bytes] = None
|
1363
|
+
|
1364
|
+
# process the path parameters
|
1365
|
+
# process the query parameters
|
1366
|
+
if max_depth is not None:
|
1367
|
+
|
1368
|
+
_query_params.append(('max-depth', max_depth))
|
1369
|
+
|
1370
|
+
# process the header parameters
|
1371
|
+
# process the form parameters
|
1372
|
+
# process the body parameter
|
1373
|
+
if post_check_permission_body is not None:
|
1374
|
+
_body_params = post_check_permission_body
|
1375
|
+
|
1376
|
+
|
1377
|
+
# set the HTTP header `Accept`
|
1378
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1379
|
+
[
|
1380
|
+
'application/json'
|
1381
|
+
]
|
1382
|
+
)
|
1383
|
+
|
1384
|
+
# set the HTTP header `Content-Type`
|
1385
|
+
if _content_type:
|
1386
|
+
_header_params['Content-Type'] = _content_type
|
1387
|
+
else:
|
1388
|
+
_default_content_type = (
|
1389
|
+
self.api_client.select_header_content_type(
|
1390
|
+
[
|
1391
|
+
'application/json'
|
1392
|
+
]
|
1393
|
+
)
|
1394
|
+
)
|
1395
|
+
if _default_content_type is not None:
|
1396
|
+
_header_params['Content-Type'] = _default_content_type
|
1397
|
+
|
1398
|
+
# authentication setting
|
1399
|
+
_auth_settings: List[str] = [
|
1400
|
+
'oryAccessToken'
|
1401
|
+
]
|
1402
|
+
|
1403
|
+
return self.api_client.param_serialize(
|
1404
|
+
method='POST',
|
1405
|
+
resource_path='/relation-tuples/check/openapi',
|
1406
|
+
path_params=_path_params,
|
1407
|
+
query_params=_query_params,
|
1408
|
+
header_params=_header_params,
|
1409
|
+
body=_body_params,
|
1410
|
+
post_params=_form_params,
|
1411
|
+
files=_files,
|
1412
|
+
auth_settings=_auth_settings,
|
1413
|
+
collection_formats=_collection_formats,
|
1414
|
+
_host=_host,
|
1415
|
+
_request_auth=_request_auth
|
1416
|
+
)
|
1417
|
+
|
1418
|
+
|
733
1419
|
|
1420
|
+
|
1421
|
+
@validate_call
|
734
1422
|
def post_check_permission_or_error(
|
735
1423
|
self,
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
'
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
)
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
1424
|
+
max_depth: Optional[StrictInt] = None,
|
1425
|
+
post_check_permission_or_error_body: Optional[PostCheckPermissionOrErrorBody] = None,
|
1426
|
+
_request_timeout: Union[
|
1427
|
+
None,
|
1428
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1429
|
+
Tuple[
|
1430
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1431
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1432
|
+
]
|
1433
|
+
] = None,
|
1434
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1435
|
+
_content_type: Optional[StrictStr] = None,
|
1436
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1437
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1438
|
+
) -> CheckPermissionResult:
|
1439
|
+
"""Check a permission
|
1440
|
+
|
1441
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1442
|
+
|
1443
|
+
:param max_depth:
|
1444
|
+
:type max_depth: int
|
1445
|
+
:param post_check_permission_or_error_body:
|
1446
|
+
:type post_check_permission_or_error_body: PostCheckPermissionOrErrorBody
|
1447
|
+
:param _request_timeout: timeout setting for this request. If one
|
1448
|
+
number provided, it will be total request
|
1449
|
+
timeout. It can also be a pair (tuple) of
|
1450
|
+
(connection, read) timeouts.
|
1451
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1452
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1453
|
+
request; this effectively ignores the
|
1454
|
+
authentication in the spec for a single request.
|
1455
|
+
:type _request_auth: dict, optional
|
1456
|
+
:param _content_type: force content-type for the request.
|
1457
|
+
:type _content_type: str, Optional
|
1458
|
+
:param _headers: set to override the headers for a single
|
1459
|
+
request; this effectively ignores the headers
|
1460
|
+
in the spec for a single request.
|
1461
|
+
:type _headers: dict, optional
|
1462
|
+
:param _host_index: set to override the host_index for a single
|
1463
|
+
request; this effectively ignores the host_index
|
1464
|
+
in the spec for a single request.
|
1465
|
+
:type _host_index: int, optional
|
1466
|
+
:return: Returns the result object.
|
1467
|
+
""" # noqa: E501
|
1468
|
+
|
1469
|
+
_param = self._post_check_permission_or_error_serialize(
|
1470
|
+
max_depth=max_depth,
|
1471
|
+
post_check_permission_or_error_body=post_check_permission_or_error_body,
|
1472
|
+
_request_auth=_request_auth,
|
1473
|
+
_content_type=_content_type,
|
1474
|
+
_headers=_headers,
|
1475
|
+
_host_index=_host_index
|
1476
|
+
)
|
1477
|
+
|
1478
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1479
|
+
'200': "CheckPermissionResult",
|
1480
|
+
'400': "ErrorGeneric",
|
1481
|
+
'403': "CheckPermissionResult",
|
1482
|
+
}
|
1483
|
+
response_data = self.api_client.call_api(
|
1484
|
+
*_param,
|
1485
|
+
_request_timeout=_request_timeout
|
1486
|
+
)
|
1487
|
+
response_data.read()
|
1488
|
+
return self.api_client.response_deserialize(
|
1489
|
+
response_data=response_data,
|
1490
|
+
response_types_map=_response_types_map,
|
1491
|
+
).data
|
1492
|
+
|
1493
|
+
|
1494
|
+
@validate_call
|
1495
|
+
def post_check_permission_or_error_with_http_info(
|
1496
|
+
self,
|
1497
|
+
max_depth: Optional[StrictInt] = None,
|
1498
|
+
post_check_permission_or_error_body: Optional[PostCheckPermissionOrErrorBody] = None,
|
1499
|
+
_request_timeout: Union[
|
1500
|
+
None,
|
1501
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1502
|
+
Tuple[
|
1503
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1504
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1505
|
+
]
|
1506
|
+
] = None,
|
1507
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1508
|
+
_content_type: Optional[StrictStr] = None,
|
1509
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1510
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1511
|
+
) -> ApiResponse[CheckPermissionResult]:
|
1512
|
+
"""Check a permission
|
1513
|
+
|
1514
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1515
|
+
|
1516
|
+
:param max_depth:
|
1517
|
+
:type max_depth: int
|
1518
|
+
:param post_check_permission_or_error_body:
|
1519
|
+
:type post_check_permission_or_error_body: PostCheckPermissionOrErrorBody
|
1520
|
+
:param _request_timeout: timeout setting for this request. If one
|
1521
|
+
number provided, it will be total request
|
1522
|
+
timeout. It can also be a pair (tuple) of
|
1523
|
+
(connection, read) timeouts.
|
1524
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1525
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1526
|
+
request; this effectively ignores the
|
1527
|
+
authentication in the spec for a single request.
|
1528
|
+
:type _request_auth: dict, optional
|
1529
|
+
:param _content_type: force content-type for the request.
|
1530
|
+
:type _content_type: str, Optional
|
1531
|
+
:param _headers: set to override the headers for a single
|
1532
|
+
request; this effectively ignores the headers
|
1533
|
+
in the spec for a single request.
|
1534
|
+
:type _headers: dict, optional
|
1535
|
+
:param _host_index: set to override the host_index for a single
|
1536
|
+
request; this effectively ignores the host_index
|
1537
|
+
in the spec for a single request.
|
1538
|
+
:type _host_index: int, optional
|
1539
|
+
:return: Returns the result object.
|
1540
|
+
""" # noqa: E501
|
1541
|
+
|
1542
|
+
_param = self._post_check_permission_or_error_serialize(
|
1543
|
+
max_depth=max_depth,
|
1544
|
+
post_check_permission_or_error_body=post_check_permission_or_error_body,
|
1545
|
+
_request_auth=_request_auth,
|
1546
|
+
_content_type=_content_type,
|
1547
|
+
_headers=_headers,
|
1548
|
+
_host_index=_host_index
|
1549
|
+
)
|
1550
|
+
|
1551
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1552
|
+
'200': "CheckPermissionResult",
|
1553
|
+
'400': "ErrorGeneric",
|
1554
|
+
'403': "CheckPermissionResult",
|
1555
|
+
}
|
1556
|
+
response_data = self.api_client.call_api(
|
1557
|
+
*_param,
|
1558
|
+
_request_timeout=_request_timeout
|
1559
|
+
)
|
1560
|
+
response_data.read()
|
1561
|
+
return self.api_client.response_deserialize(
|
1562
|
+
response_data=response_data,
|
1563
|
+
response_types_map=_response_types_map,
|
1564
|
+
)
|
1565
|
+
|
1566
|
+
|
1567
|
+
@validate_call
|
1568
|
+
def post_check_permission_or_error_without_preload_content(
|
1569
|
+
self,
|
1570
|
+
max_depth: Optional[StrictInt] = None,
|
1571
|
+
post_check_permission_or_error_body: Optional[PostCheckPermissionOrErrorBody] = None,
|
1572
|
+
_request_timeout: Union[
|
1573
|
+
None,
|
1574
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1575
|
+
Tuple[
|
1576
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1577
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1578
|
+
]
|
1579
|
+
] = None,
|
1580
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1581
|
+
_content_type: Optional[StrictStr] = None,
|
1582
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1583
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1584
|
+
) -> RESTResponseType:
|
1585
|
+
"""Check a permission
|
1586
|
+
|
1587
|
+
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.sh/docs/keto/concepts/api-overview).
|
1588
|
+
|
1589
|
+
:param max_depth:
|
1590
|
+
:type max_depth: int
|
1591
|
+
:param post_check_permission_or_error_body:
|
1592
|
+
:type post_check_permission_or_error_body: PostCheckPermissionOrErrorBody
|
1593
|
+
:param _request_timeout: timeout setting for this request. If one
|
1594
|
+
number provided, it will be total request
|
1595
|
+
timeout. It can also be a pair (tuple) of
|
1596
|
+
(connection, read) timeouts.
|
1597
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1598
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1599
|
+
request; this effectively ignores the
|
1600
|
+
authentication in the spec for a single request.
|
1601
|
+
:type _request_auth: dict, optional
|
1602
|
+
:param _content_type: force content-type for the request.
|
1603
|
+
:type _content_type: str, Optional
|
1604
|
+
:param _headers: set to override the headers for a single
|
1605
|
+
request; this effectively ignores the headers
|
1606
|
+
in the spec for a single request.
|
1607
|
+
:type _headers: dict, optional
|
1608
|
+
:param _host_index: set to override the host_index for a single
|
1609
|
+
request; this effectively ignores the host_index
|
1610
|
+
in the spec for a single request.
|
1611
|
+
:type _host_index: int, optional
|
1612
|
+
:return: Returns the result object.
|
1613
|
+
""" # noqa: E501
|
1614
|
+
|
1615
|
+
_param = self._post_check_permission_or_error_serialize(
|
1616
|
+
max_depth=max_depth,
|
1617
|
+
post_check_permission_or_error_body=post_check_permission_or_error_body,
|
1618
|
+
_request_auth=_request_auth,
|
1619
|
+
_content_type=_content_type,
|
1620
|
+
_headers=_headers,
|
1621
|
+
_host_index=_host_index
|
1622
|
+
)
|
1623
|
+
|
1624
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1625
|
+
'200': "CheckPermissionResult",
|
1626
|
+
'400': "ErrorGeneric",
|
1627
|
+
'403': "CheckPermissionResult",
|
1628
|
+
}
|
1629
|
+
response_data = self.api_client.call_api(
|
1630
|
+
*_param,
|
1631
|
+
_request_timeout=_request_timeout
|
1632
|
+
)
|
1633
|
+
return response_data.response
|
1634
|
+
|
1635
|
+
|
1636
|
+
def _post_check_permission_or_error_serialize(
|
1637
|
+
self,
|
1638
|
+
max_depth,
|
1639
|
+
post_check_permission_or_error_body,
|
1640
|
+
_request_auth,
|
1641
|
+
_content_type,
|
1642
|
+
_headers,
|
1643
|
+
_host_index,
|
1644
|
+
) -> RequestSerialized:
|
1645
|
+
|
1646
|
+
_host = None
|
1647
|
+
|
1648
|
+
_collection_formats: Dict[str, str] = {
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
_path_params: Dict[str, str] = {}
|
1652
|
+
_query_params: List[Tuple[str, str]] = []
|
1653
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1654
|
+
_form_params: List[Tuple[str, str]] = []
|
1655
|
+
_files: Dict[str, str] = {}
|
1656
|
+
_body_params: Optional[bytes] = None
|
1657
|
+
|
1658
|
+
# process the path parameters
|
1659
|
+
# process the query parameters
|
1660
|
+
if max_depth is not None:
|
1661
|
+
|
1662
|
+
_query_params.append(('max-depth', max_depth))
|
1663
|
+
|
1664
|
+
# process the header parameters
|
1665
|
+
# process the form parameters
|
1666
|
+
# process the body parameter
|
1667
|
+
if post_check_permission_or_error_body is not None:
|
1668
|
+
_body_params = post_check_permission_or_error_body
|
1669
|
+
|
1670
|
+
|
1671
|
+
# set the HTTP header `Accept`
|
1672
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1673
|
+
[
|
1674
|
+
'application/json'
|
1675
|
+
]
|
1676
|
+
)
|
1677
|
+
|
1678
|
+
# set the HTTP header `Content-Type`
|
1679
|
+
if _content_type:
|
1680
|
+
_header_params['Content-Type'] = _content_type
|
1681
|
+
else:
|
1682
|
+
_default_content_type = (
|
1683
|
+
self.api_client.select_header_content_type(
|
1684
|
+
[
|
1685
|
+
'application/json'
|
1686
|
+
]
|
1687
|
+
)
|
1688
|
+
)
|
1689
|
+
if _default_content_type is not None:
|
1690
|
+
_header_params['Content-Type'] = _default_content_type
|
1691
|
+
|
1692
|
+
# authentication setting
|
1693
|
+
_auth_settings: List[str] = [
|
1694
|
+
'oryAccessToken'
|
1695
|
+
]
|
1696
|
+
|
1697
|
+
return self.api_client.param_serialize(
|
1698
|
+
method='POST',
|
1699
|
+
resource_path='/relation-tuples/check',
|
1700
|
+
path_params=_path_params,
|
1701
|
+
query_params=_query_params,
|
1702
|
+
header_params=_header_params,
|
1703
|
+
body=_body_params,
|
1704
|
+
post_params=_form_params,
|
1705
|
+
files=_files,
|
1706
|
+
auth_settings=_auth_settings,
|
1707
|
+
collection_formats=_collection_formats,
|
1708
|
+
_host=_host,
|
1709
|
+
_request_auth=_request_auth
|
1710
|
+
)
|
1711
|
+
|
813
1712
|
|