├── .editorconfig ├── .flake8 ├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── has_changelog.yaml │ ├── publish_to_pypi.yaml │ ├── publish_to_test_pypi.yaml │ ├── readthedocs-pr-links.yaml │ ├── test.yaml │ └── update_pr_references.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── CONTRIBUTING.adoc ├── LICENSE ├── Makefile ├── README.rst ├── RELEASING.md ├── changelog.d ├── 20250604_172822_sirosen_bugfix_high_assuranc.rst ├── README.md ├── check-version-is-new.py ├── new_fragment.rst.j2 └── update-pr-refs.py ├── changelog.rst ├── docs ├── .buildinfo ├── _static │ ├── css │ │ └── globus_sdk_tab_borders.css │ └── logo.png ├── authorization.rst ├── authorization │ ├── gare.rst │ ├── globus_app │ │ ├── apps.rst │ │ ├── config.rst │ │ └── index.rst │ ├── globus_authorizers.rst │ ├── index.rst │ ├── login_flows.rst │ ├── scopes_and_consents │ │ ├── consents.rst │ │ ├── index.rst │ │ ├── mutable_scopes.rst │ │ └── scopes.rst │ └── token_caching │ │ ├── index.rst │ │ ├── storage_adapters.rst │ │ └── token_storages.rst ├── changelog.rst ├── conf.py ├── config.rst ├── core │ ├── base_client.rst │ ├── exceptions.rst │ ├── index.rst │ ├── paging.rst │ ├── responses.rst │ ├── transport.rst │ ├── utils.rst │ └── warnings.rst ├── examples │ ├── auth_manage_projects │ │ ├── index.rst │ │ ├── list_and_create_projects.py │ │ ├── list_projects.py │ │ └── manage_projects.py │ ├── authorization.rst │ ├── client_credentials.rst │ ├── create_and_run_flow │ │ ├── index.rst │ │ ├── manage_flow.py │ │ ├── manage_flow_minimal.py │ │ └── run_flow_minimal.py │ ├── endpoint_type_enum.rst │ ├── group_listing.rst │ ├── guest_collection_creation.rst │ ├── index.rst │ ├── minimal_transfer_script │ │ ├── index.rst │ │ ├── transfer_consent_required_proactive.py │ │ ├── transfer_consent_required_reactive.py │ │ └── transfer_minimal.py │ ├── native_app.rst │ ├── recursive_ls.rst │ ├── three_legged_oauth.rst │ ├── timer_management │ │ ├── create_timer.py │ │ ├── create_timer_data_access.py │ │ ├── delete_timer.py │ │ ├── index.rst │ │ └── list_timers.py │ ├── timer_operations.rst │ └── tokenstorage │ │ ├── dynamodb_tokenstorage.py │ │ └── index.rst ├── experimental │ ├── examples │ │ ├── endpoints_and_collections │ │ │ └── identifying_entity_type.rst │ │ ├── flows │ │ │ ├── create.rst │ │ │ ├── delete.rst │ │ │ ├── index.rst │ │ │ ├── list.rst │ │ │ └── run.rst │ │ ├── index.rst │ │ ├── oauth2 │ │ │ ├── authorizers.rst │ │ │ ├── customizing_token_storage.rst │ │ │ ├── globus_app.rst │ │ │ ├── index.rst │ │ │ ├── login_flows.rst │ │ │ └── three_legged_oauth.rst │ │ ├── projects │ │ │ ├── create.rst │ │ │ ├── delete.rst │ │ │ ├── index.rst │ │ │ └── list.rst │ │ └── transferring_data │ │ │ ├── recursive_ls.rst │ │ │ ├── schedule_transfer │ │ │ └── index.rst │ │ │ └── task_deadlines.rst │ └── index.rst ├── index.rst ├── license.rst ├── local_endpoints.rst ├── scopes.rst ├── services │ ├── auth.rst │ ├── compute.rst │ ├── flows.rst │ ├── gcs.rst │ ├── groups.rst │ ├── index.rst │ ├── search.rst │ ├── timer.rst │ └── transfer.rst ├── testing │ ├── getting_started.rst │ ├── index.rst │ ├── methods │ │ ├── auth.rst │ │ ├── flows.rst │ │ ├── gcs.rst │ │ ├── groups.rst │ │ ├── index.rst │ │ ├── search.rst │ │ ├── timers.rst │ │ └── transfer.rst │ └── reference.rst ├── tokenstorage.rst ├── tutorial.rst ├── upgrading.rst ├── user_guide │ ├── getting_started │ │ ├── index.rst │ │ ├── list_groups.py │ │ ├── list_groups_noapp.py │ │ ├── list_groups_noapp_with_storage.py │ │ ├── list_groups_with_login.py │ │ ├── minimal_script.rst │ │ ├── minimal_script_noapp.rst │ │ └── register_app.rst │ ├── installation.rst │ └── usage_patterns │ │ ├── data_transfer │ │ ├── create_guest_collection │ │ │ ├── create_guest_collection_client_owned.py │ │ │ ├── create_guest_collection_user_owned.py │ │ │ └── index.rst │ │ ├── detecting_data_access │ │ │ ├── index.rst │ │ │ └── submit_transfer_detect_data_access.py │ │ ├── index.rst │ │ ├── scheduled_transfers │ │ │ ├── create_timer.py │ │ │ ├── create_timer_detect_data_access.py │ │ │ └── index.rst │ │ ├── submit_transfer │ │ │ ├── index.rst │ │ │ ├── submit_transfer_collections_known.py │ │ │ └── submit_transfer_collections_unknown.py │ │ └── transfer_relative_deadline │ │ │ ├── index.rst │ │ │ └── submit_transfer_relative_deadline.py │ │ ├── index.rst │ │ └── sessions_and_consents │ │ ├── handling_transfer_auth_params │ │ ├── index.rst │ │ └── ls_with_session_handling.py │ │ └── index.rst └── versioning.rst ├── pyproject.toml ├── requirements ├── README.rst ├── py3.10 │ ├── test.txt │ └── typing.txt ├── py3.11 │ ├── docs.txt │ ├── test.txt │ └── typing.txt ├── py3.12 │ ├── test.txt │ └── typing.txt ├── py3.13 │ ├── test.txt │ └── typing.txt ├── py3.8 │ ├── test-mindeps.txt │ ├── test.txt │ └── typing.txt └── py3.9 │ ├── test.txt │ └── typing.txt ├── scripts ├── changelog2md.py ├── ensure_exports_are_documented.py ├── ensure_min_python_is_tested.py └── rtd-pre-sphinx-build.sh ├── setup.py ├── src └── globus_sdk │ ├── __init__.py │ ├── __init__.pyi │ ├── _globus_sdk_flake8.py │ ├── _guards.py │ ├── _lazy_import.py │ ├── _serializable.py │ ├── _sphinxext │ ├── __init__.py │ ├── autodoc_hooks.py │ ├── directives │ │ ├── __init__.py │ │ ├── add_content_directive.py │ │ ├── automethodlist.py │ │ ├── copy_params.py │ │ ├── enumerate_testing_fixtures.py │ │ ├── expand_testing_fixture.py │ │ ├── externaldoclink.py │ │ ├── list_known_scopes.py │ │ └── paginated_usage.py │ ├── roles.py │ └── utils.py │ ├── _testing │ ├── __init__.py │ ├── data │ │ ├── __init__.py │ │ ├── auth │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── create_child_client.py │ │ │ ├── create_client.py │ │ │ ├── create_client_credential.py │ │ │ ├── create_native_app_instance.py │ │ │ ├── create_policy.py │ │ │ ├── create_project.py │ │ │ ├── create_scope.py │ │ │ ├── delete_client.py │ │ │ ├── delete_client_credential.py │ │ │ ├── delete_policy.py │ │ │ ├── delete_project.py │ │ │ ├── delete_scope.py │ │ │ ├── get_client.py │ │ │ ├── get_client_credentials.py │ │ │ ├── get_clients.py │ │ │ ├── get_consents.py │ │ │ ├── get_identities.py │ │ │ ├── get_identity_providers.py │ │ │ ├── get_policies.py │ │ │ ├── get_policy.py │ │ │ ├── get_project.py │ │ │ ├── get_projects.py │ │ │ ├── get_scope.py │ │ │ ├── get_scopes.py │ │ │ ├── oauth2_client_credentials_tokens.py │ │ │ ├── oauth2_exchange_code_for_tokens.py │ │ │ ├── oauth2_get_dependent_tokens.py │ │ │ ├── oauth2_revoke_token.py │ │ │ ├── oauth2_token_introspect.py │ │ │ ├── oauth2_userinfo.py │ │ │ ├── update_client.py │ │ │ ├── update_policy.py │ │ │ ├── update_project.py │ │ │ ├── update_scope.py │ │ │ └── userinfo.py │ │ ├── compute │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── v2 │ │ │ │ ├── __init__.py │ │ │ │ ├── delete_endpoint.py │ │ │ │ ├── delete_function.py │ │ │ │ ├── get_endpoint.py │ │ │ │ ├── get_endpoint_status.py │ │ │ │ ├── get_endpoints.py │ │ │ │ ├── get_function.py │ │ │ │ ├── get_result_amqp_url.py │ │ │ │ ├── get_task.py │ │ │ │ ├── get_task_batch.py │ │ │ │ ├── get_task_group.py │ │ │ │ ├── get_version.py │ │ │ │ ├── lock_endpoint.py │ │ │ │ ├── register_endpoint.py │ │ │ │ ├── register_function.py │ │ │ │ └── submit.py │ │ │ └── v3 │ │ │ │ ├── __init__.py │ │ │ │ ├── get_endpoint_allowlist.py │ │ │ │ ├── lock_endpoint.py │ │ │ │ ├── register_endpoint.py │ │ │ │ ├── register_function.py │ │ │ │ ├── submit.py │ │ │ │ └── update_endpoint.py │ │ ├── flows │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── cancel_run.py │ │ │ ├── create_flow.py │ │ │ ├── delete_flow.py │ │ │ ├── delete_run.py │ │ │ ├── get_flow.py │ │ │ ├── get_run.py │ │ │ ├── get_run_definition.py │ │ │ ├── get_run_logs.py │ │ │ ├── list_flows.py │ │ │ ├── list_runs.py │ │ │ ├── resume_run.py │ │ │ ├── run_flow.py │ │ │ ├── update_flow.py │ │ │ ├── update_run.py │ │ │ └── validate_flow.py │ │ ├── globus_connect_server │ │ │ ├── __init__.py │ │ │ ├── create_storage_gateway.py │ │ │ ├── create_user_credential.py │ │ │ ├── delete_storage_gateway.py │ │ │ ├── delete_user_credential.py │ │ │ ├── get_collection_list.py │ │ │ ├── get_endpoint.py │ │ │ ├── get_gcs_info.py │ │ │ ├── get_storage_gateway.py │ │ │ ├── get_storage_gateway_list.py │ │ │ ├── get_user_credential.py │ │ │ ├── get_user_credential_list.py │ │ │ ├── update_endpoint.py │ │ │ ├── update_storage_gateway.py │ │ │ └── update_user_credential.py │ │ ├── groups │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── create_group.py │ │ │ ├── delete_group.py │ │ │ ├── get_group.py │ │ │ ├── get_group_by_subscription_id.py │ │ │ ├── get_my_groups.py │ │ │ └── set_group_policies.py │ │ ├── search │ │ │ ├── __init__.py │ │ │ ├── batch_delete_by_subject.py │ │ │ ├── create_index.py │ │ │ ├── create_role.py │ │ │ ├── delete_index.py │ │ │ ├── delete_role.py │ │ │ ├── get_role_list.py │ │ │ ├── index_list.py │ │ │ ├── post_search.py │ │ │ ├── reopen_index.py │ │ │ └── search.py │ │ ├── timer │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── create_job.py │ │ │ ├── create_timer.py │ │ │ ├── delete_job.py │ │ │ ├── get_job.py │ │ │ ├── list_jobs.py │ │ │ ├── pause_job.py │ │ │ ├── resume_job.py │ │ │ └── update_job.py │ │ └── transfer │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── create_endpoint.py │ │ │ ├── endpoint_manager_task_list.py │ │ │ ├── endpoint_manager_task_successful_transfers.py │ │ │ ├── get_endpoint.py │ │ │ ├── get_submission_id.py │ │ │ ├── operation_mkdir.py │ │ │ ├── operation_rename.py │ │ │ ├── operation_stat.py │ │ │ ├── set_subscription_id.py │ │ │ ├── submit_delete.py │ │ │ ├── submit_transfer.py │ │ │ ├── task_list.py │ │ │ └── update_endpoint.py │ ├── helpers.py │ ├── models.py │ └── registry.py │ ├── _types.py │ ├── authorizers │ ├── __init__.py │ ├── access_token.py │ ├── base.py │ ├── basic.py │ ├── client_credentials.py │ ├── refresh_token.py │ └── renewing.py │ ├── client.py │ ├── config │ ├── __init__.py │ ├── env_vars.py │ └── environments.py │ ├── exc │ ├── __init__.py │ ├── api.py │ ├── base.py │ ├── convert.py │ ├── err_info.py │ └── warnings.py │ ├── experimental │ ├── __init__.py │ ├── auth_requirements_error.py │ ├── consents.py │ ├── globus_app.py │ ├── login_flow_manager.py │ ├── scope_parser.py │ └── tokenstorage.py │ ├── gare │ ├── __init__.py │ ├── _auth_requirements_error.py │ ├── _functional_api.py │ └── _variants.py │ ├── globus_app │ ├── __init__.py │ ├── app.py │ ├── authorizer_factory.py │ ├── client_app.py │ ├── config.py │ ├── protocols.py │ └── user_app.py │ ├── local_endpoint │ ├── __init__.py │ ├── personal │ │ ├── __init__.py │ │ ├── endpoint.py │ │ └── owner_info.py │ └── server │ │ ├── __init__.py │ │ └── endpoint.py │ ├── login_flows │ ├── __init__.py │ ├── command_line_login_flow_manager.py │ ├── local_server_login_flow_manager │ │ ├── __init__.py │ │ ├── errors.py │ │ ├── html_files │ │ │ ├── __init__.py │ │ │ └── local_server_landing_page.html │ │ ├── local_server.py │ │ └── local_server_login_flow_manager.py │ └── login_flow_manager.py │ ├── paging │ ├── __init__.py │ ├── base.py │ ├── last_key.py │ ├── limit_offset.py │ ├── marker.py │ ├── next_token.py │ └── table.py │ ├── py.typed │ ├── response.py │ ├── scopes │ ├── __init__.py │ ├── _normalize.py │ ├── _parser.py │ ├── builder.py │ ├── consents │ │ ├── __init__.py │ │ ├── _errors.py │ │ └── _model.py │ ├── data │ │ ├── __init__.py │ │ ├── auth.py │ │ ├── compute.py │ │ ├── flows.py │ │ ├── gcs.py │ │ ├── groups.py │ │ ├── search.py │ │ ├── timers.py │ │ └── transfer.py │ ├── errors.py │ ├── representation.py │ └── scope_definition.py │ ├── services │ ├── __init__.py │ ├── auth │ │ ├── __init__.py │ │ ├── _common.py │ │ ├── client │ │ │ ├── __init__.py │ │ │ ├── base_login_client.py │ │ │ ├── confidential_client.py │ │ │ ├── native_client.py │ │ │ └── service_client.py │ │ ├── data.py │ │ ├── errors.py │ │ ├── flow_managers │ │ │ ├── __init__.py │ │ │ ├── authorization_code.py │ │ │ ├── base.py │ │ │ └── native_app.py │ │ ├── id_token_decoder.py │ │ ├── identity_map.py │ │ └── response │ │ │ ├── __init__.py │ │ │ ├── clients.py │ │ │ ├── consents.py │ │ │ ├── credentials.py │ │ │ ├── identities.py │ │ │ ├── oauth.py │ │ │ ├── policies.py │ │ │ ├── projects.py │ │ │ └── scopes.py │ ├── compute │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data.py │ │ └── errors.py │ ├── flows │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data.py │ │ ├── errors.py │ │ └── response.py │ ├── gcs │ │ ├── __init__.py │ │ ├── client.py │ │ ├── connector_table.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── _common.py │ │ │ ├── collection.py │ │ │ ├── endpoint.py │ │ │ ├── role.py │ │ │ ├── storage_gateway.py │ │ │ └── user_credential.py │ │ ├── errors.py │ │ └── response.py │ ├── groups │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data.py │ │ ├── errors.py │ │ └── manager.py │ ├── search │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data.py │ │ ├── errors.py │ │ └── response.py │ ├── timer.py │ ├── timers │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data.py │ │ └── errors.py │ └── transfer │ │ ├── __init__.py │ │ ├── client.py │ │ ├── data │ │ ├── __init__.py │ │ ├── delete_data.py │ │ └── transfer_data.py │ │ ├── errors.py │ │ ├── response │ │ ├── __init__.py │ │ ├── activation.py │ │ └── iterable.py │ │ └── transport.py │ ├── tokenstorage │ ├── __init__.py │ ├── v1 │ │ ├── __init__.py │ │ ├── base.py │ │ ├── file_adapters.py │ │ ├── memory_adapter.py │ │ └── sqlite_adapter.py │ └── v2 │ │ ├── __init__.py │ │ ├── base.py │ │ ├── json.py │ │ ├── memory.py │ │ ├── sqlite.py │ │ ├── token_data.py │ │ └── validating_token_storage │ │ ├── __init__.py │ │ ├── context.py │ │ ├── errors.py │ │ ├── storage.py │ │ └── validators.py │ ├── transport │ ├── __init__.py │ ├── _clientinfo.py │ ├── encoders.py │ ├── requests.py │ └── retry.py │ ├── utils.py │ └── version.py ├── tests ├── README ├── __init__.py ├── common │ ├── __init__.py │ ├── consents.py │ ├── constants.py │ ├── globus_responses.py │ └── response_mock.py ├── conftest.py ├── functional │ ├── __init__.py │ ├── _testing │ │ └── test_non_default_mock.py │ ├── base_client │ │ ├── conftest.py │ │ ├── test_advanced_http_options.py │ │ ├── test_default_headers.py │ │ ├── test_encodings.py │ │ ├── test_filter_missing.py │ │ └── test_retry_behavior.py │ ├── globus_app │ │ └── test_globus_app_token_handling.py │ ├── local_endpoint │ │ ├── __init__.py │ │ ├── test_personal.py │ │ └── test_server.py │ ├── login_flows │ │ ├── __init__.py │ │ └── test_login_flow_manager.py │ ├── services │ │ ├── auth │ │ │ ├── __init__.py │ │ │ ├── base │ │ │ │ ├── __init__.py │ │ │ │ ├── test_oauth2_refresh_token.py │ │ │ │ ├── test_oauth2_revoke_token.py │ │ │ │ └── test_oauth2_validate_token.py │ │ │ ├── confidential_client │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ ├── test_create_child_client.py │ │ │ │ ├── test_oauth2_client_credentials_tokens.py │ │ │ │ ├── test_oauth2_get_dependent_tokens.py │ │ │ │ ├── test_oauth2_start_flow.py │ │ │ │ └── test_oauth2_token_introspect.py │ │ │ ├── conftest.py │ │ │ ├── native_client │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ ├── test_create_native_app_instance.py │ │ │ │ ├── test_oauth2_refresh_token.py │ │ │ │ └── test_oauth2_start_flow.py │ │ │ ├── service_client │ │ │ │ ├── test_create_client.py │ │ │ │ ├── test_create_client_credential.py │ │ │ │ ├── test_create_policy.py │ │ │ │ ├── test_create_project.py │ │ │ │ ├── test_create_scope.py │ │ │ │ ├── test_delete_client.py │ │ │ │ ├── test_delete_client_credential.py │ │ │ │ ├── test_delete_policy.py │ │ │ │ ├── test_delete_project.py │ │ │ │ ├── test_delete_scope.py │ │ │ │ ├── test_get_client.py │ │ │ │ ├── test_get_client_credentials.py │ │ │ │ ├── test_get_clients.py │ │ │ │ ├── test_get_consents.py │ │ │ │ ├── test_get_identities.py │ │ │ │ ├── test_get_identity_providers.py │ │ │ │ ├── test_get_policies.py │ │ │ │ ├── test_get_policy.py │ │ │ │ ├── test_get_project.py │ │ │ │ ├── test_get_projects.py │ │ │ │ ├── test_get_scope.py │ │ │ │ ├── test_get_scopes.py │ │ │ │ ├── test_update_client.py │ │ │ │ ├── test_update_policy.py │ │ │ │ ├── test_update_project.py │ │ │ │ ├── test_update_scope.py │ │ │ │ └── test_userinfo.py │ │ │ ├── test_auth_client_flow.py │ │ │ ├── test_id_token.py │ │ │ └── test_identity_map.py │ │ ├── compute │ │ │ ├── conftest.py │ │ │ ├── v2 │ │ │ │ ├── __init__.py │ │ │ │ ├── test_delete_endpoint.py │ │ │ │ ├── test_delete_function.py │ │ │ │ ├── test_get_endpoint.py │ │ │ │ ├── test_get_endpoint_status.py │ │ │ │ ├── test_get_endpoints.py │ │ │ │ ├── test_get_function.py │ │ │ │ ├── test_get_result_amqp_url.py │ │ │ │ ├── test_get_task_batch.py │ │ │ │ ├── test_get_task_group.py │ │ │ │ ├── test_get_task_info.py │ │ │ │ ├── test_get_version.py │ │ │ │ ├── test_lock_endpoint.py │ │ │ │ ├── test_register_endpoint.py │ │ │ │ ├── test_register_function.py │ │ │ │ └── test_submit.py │ │ │ └── v3 │ │ │ │ ├── __init__.py │ │ │ │ ├── test_get_endpoint_allowlist.py │ │ │ │ ├── test_lock_endpoint.py │ │ │ │ ├── test_register_endpoint.py │ │ │ │ ├── test_register_function.py │ │ │ │ ├── test_submit.py │ │ │ │ └── test_update_endpoint.py │ │ ├── flows │ │ │ ├── conftest.py │ │ │ ├── test_flow_crud.py │ │ │ ├── test_flow_validate.py │ │ │ ├── test_get_run.py │ │ │ ├── test_get_run_logs.py │ │ │ ├── test_list_flows.py │ │ │ ├── test_list_runs.py │ │ │ ├── test_resume_run.py │ │ │ ├── test_run_crud.py │ │ │ └── test_run_flow.py │ │ ├── gcs │ │ │ ├── conftest.py │ │ │ ├── fixture_data │ │ │ │ ├── collection_list.json │ │ │ │ ├── create_collection.json │ │ │ │ ├── empty_success.json │ │ │ │ ├── get_collection │ │ │ │ │ ├── bad_version.json │ │ │ │ │ ├── includes_other.json │ │ │ │ │ ├── invalid_datatype_type.json │ │ │ │ │ ├── normal.json │ │ │ │ │ └── unexpectedly_flat.json │ │ │ │ ├── role_document.json │ │ │ │ ├── role_list.json │ │ │ │ ├── update_collection.json │ │ │ │ └── user_credential_list.json │ │ │ ├── test_collections.py │ │ │ ├── test_endpoints.py │ │ │ ├── test_get_collection_list.py │ │ │ ├── test_get_gcs_info.py │ │ │ ├── test_roles.py │ │ │ ├── test_scope_helpers.py │ │ │ ├── test_storage_gateways.py │ │ │ └── test_user_credential.py │ │ ├── groups │ │ │ ├── conftest.py │ │ │ ├── fixture_data │ │ │ │ ├── add_member.json │ │ │ │ ├── approve_pending.json │ │ │ │ ├── get_group_policies.json │ │ │ │ └── updated_group.json │ │ │ ├── manager │ │ │ │ ├── test_accept_invite.py │ │ │ │ ├── test_decline_invite.py │ │ │ │ ├── test_invite_member.py │ │ │ │ ├── test_join.py │ │ │ │ ├── test_leave.py │ │ │ │ ├── test_reject_join_request.py │ │ │ │ ├── test_remove_member.py │ │ │ │ └── test_request_join.py │ │ │ ├── test_create_group.py │ │ │ ├── test_delete_group.py │ │ │ ├── test_get_group.py │ │ │ ├── test_get_group_by_subscription_id.py │ │ │ ├── test_get_group_policies.py │ │ │ ├── test_get_identity_preferences.py │ │ │ ├── test_get_membership_fields.py │ │ │ ├── test_get_my_groups.py │ │ │ ├── test_group_memberships.py │ │ │ ├── test_set_group_policies.py │ │ │ ├── test_set_identity_preferences.py │ │ │ ├── test_set_membership_fields.py │ │ │ └── test_update_group.py │ │ ├── search │ │ │ ├── conftest.py │ │ │ ├── fixture_data │ │ │ │ ├── scroll_result_1.json │ │ │ │ └── scroll_result_2.json │ │ │ ├── test_batch_delete_by_subject.py │ │ │ ├── test_create_entry.py │ │ │ ├── test_create_index.py │ │ │ ├── test_delete_by_query.py │ │ │ ├── test_delete_entry.py │ │ │ ├── test_delete_index.py │ │ │ ├── test_delete_subject.py │ │ │ ├── test_get_entry.py │ │ │ ├── test_get_index.py │ │ │ ├── test_get_subject.py │ │ │ ├── test_get_task.py │ │ │ ├── test_get_task_list.py │ │ │ ├── test_index_list.py │ │ │ ├── test_ingest.py │ │ │ ├── test_reopen_index.py │ │ │ ├── test_search.py │ │ │ ├── test_search_roles.py │ │ │ └── test_update_entry.py │ │ ├── timers │ │ │ ├── conftest.py │ │ │ ├── test_create_timer.py │ │ │ └── test_jobs.py │ │ └── transfer │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── endpoint_manager │ │ │ ├── test_endpoint_manager_acl_list.py │ │ │ ├── test_endpoint_manager_cancel_status.py │ │ │ ├── test_endpoint_manager_cancel_tasks.py │ │ │ ├── test_endpoint_manager_create_pause_rule.py │ │ │ ├── test_endpoint_manager_delete_pause_rule.py │ │ │ ├── test_endpoint_manager_get_endpoint.py │ │ │ ├── test_endpoint_manager_get_pause_rule.py │ │ │ ├── test_endpoint_manager_get_task.py │ │ │ ├── test_endpoint_manager_hosted_endpoint_list.py │ │ │ ├── test_endpoint_manager_monitored_endpoints.py │ │ │ ├── test_endpoint_manager_pause_rule_list.py │ │ │ ├── test_endpoint_manager_pause_tasks.py │ │ │ ├── test_endpoint_manager_resume_tasks.py │ │ │ ├── test_endpoint_manager_task_pause_info.py │ │ │ ├── test_endpoint_manager_task_skipped_errors.py │ │ │ ├── test_endpoint_manager_task_successful_transfers.py │ │ │ ├── test_endpoint_manager_update_pause_rule.py │ │ │ ├── test_task_event_list.py │ │ │ └── test_task_list.py │ │ │ ├── fixture_data │ │ │ ├── activation_already_activated_stub.json │ │ │ ├── activation_stub.json │ │ │ ├── get_task1_active.json │ │ │ └── get_task1_succeeded.json │ │ │ ├── test_add_endpoint_acl_rule.py │ │ │ ├── test_add_endpoint_role.py │ │ │ ├── test_add_endpoint_server.py │ │ │ ├── test_bookmark_list.py │ │ │ ├── test_cancel_task.py │ │ │ ├── test_create_bookmark.py │ │ │ ├── test_create_shared_endpoint.py │ │ │ ├── test_delete_bookmark.py │ │ │ ├── test_delete_endpoint.py │ │ │ ├── test_delete_endpoint_acl_rule.py │ │ │ ├── test_delete_endpoint_role.py │ │ │ ├── test_delete_endpoint_server.py │ │ │ ├── test_endpoint_acl_list.py │ │ │ ├── test_endpoint_activate.py │ │ │ ├── test_endpoint_deactivate.py │ │ │ ├── test_endpoint_get_activation_requirements.py │ │ │ ├── test_endpoint_role_list.py │ │ │ ├── test_get_bookmark.py │ │ │ ├── test_get_endpoint_acl_rule.py │ │ │ ├── test_get_endpoint_role.py │ │ │ ├── test_get_endpoint_server.py │ │ │ ├── test_iterable.py │ │ │ ├── test_my_effective_pause_rule_list.py │ │ │ ├── test_my_shared_endpoint_list.py │ │ │ ├── test_operation_ls.py │ │ │ ├── test_operation_mkdir.py │ │ │ ├── test_operation_rename.py │ │ │ ├── test_operation_stat.py │ │ │ ├── test_operation_symlink.py │ │ │ ├── test_paginated.py │ │ │ ├── test_set_subscription_id.py │ │ │ ├── test_simple.py │ │ │ ├── test_task_event_list.py │ │ │ ├── test_task_list.py │ │ │ ├── test_task_pause_info.py │ │ │ ├── test_task_submit.py │ │ │ ├── test_task_successful_transfers.py │ │ │ ├── test_task_wait.py │ │ │ ├── test_update_bookmark.py │ │ │ ├── test_update_endpoint_acl_rule.py │ │ │ ├── test_update_endpoint_server.py │ │ │ └── test_update_task.py │ └── tokenstorage │ │ ├── v1 │ │ ├── conftest.py │ │ ├── test_simplejson_file.py │ │ └── test_sqlite.py │ │ └── v2 │ │ ├── conftest.py │ │ ├── test_common_tokenstorage.py │ │ ├── test_json_tokenstorage.py │ │ ├── test_memory_tokenstorage.py │ │ └── test_sqlite_tokenstorage.py ├── non-pytest │ ├── lazy-imports │ │ ├── test_for_import_cycles.py │ │ └── test_modules_do_not_require_requests.py │ ├── mypy-ignore-tests │ │ ├── README.rst │ │ ├── app_scope_requirements.py │ │ ├── auth_client_create_policy.py │ │ ├── auth_client_initialization.py │ │ ├── auth_client_jwk_methods.py │ │ ├── base_client_usage.py │ │ ├── custom_transport.py │ │ ├── get_authorize_url_supports_session_params.py │ │ ├── get_identities.py │ │ ├── group_helpers.py │ │ ├── identity_map.py │ │ ├── lazy_importer.py │ │ ├── pagination.py │ │ ├── responselike_protocol.py │ │ ├── scope_collection_type.py │ │ ├── specific_flow_scopes.py │ │ ├── test_consents_usage.py │ │ ├── test_flow_activity_notification_policy.py │ │ ├── test_guards.py │ │ ├── timer_client_aliasing.py │ │ └── transfer_data.py │ ├── performance │ │ └── parser_benchmark.py │ └── poetry-lock-test │ │ ├── .gitignore │ │ ├── README │ │ └── pyproject.toml ├── stub-testmod.sh └── unit │ ├── CA-Bundle.cert │ ├── __init__.py │ ├── _testing │ ├── test_construct_error.py │ └── test_registered_response.py │ ├── authorizers │ ├── test_access_token_authorizer.py │ ├── test_basic_authorizer.py │ ├── test_client_credentials_authorizer.py │ ├── test_null_authorizer.py │ ├── test_refresh_token_authorizer.py │ └── test_renewing_authorizer.py │ ├── errors │ ├── test_auth_errors.py │ ├── test_common_functionality.py │ ├── test_timers_errors.py │ └── test_transfer_errors.py │ ├── experimental │ └── test_legacy_support.py │ ├── globus_app │ ├── test_authorizer_factory.py │ ├── test_client_integration.py │ └── test_globus_app.py │ ├── helpers │ ├── __init__.py │ ├── gcs │ │ ├── __init__.py │ │ ├── test_collections.py │ │ ├── test_connector_table.py │ │ ├── test_role.py │ │ └── test_storage_gateway.py │ ├── test_auth_flow_managers.py │ ├── test_auth_scope_stringify.py │ ├── test_search.py │ ├── test_timer.py │ └── test_transfer.py │ ├── login_flows │ ├── __init__.py │ └── test_local_server.py │ ├── responses │ ├── __init__.py │ ├── conftest.py │ ├── test_activation_response.py │ ├── test_oauth_token_response.py │ ├── test_response.py │ ├── test_token_response_pickleability.py │ └── test_unpacking_gcs_response.py │ ├── scopes │ ├── test_consents.py │ ├── test_merge_scopes.py │ ├── test_mutable_scope.py │ ├── test_scope_builder.py │ ├── test_scope_normalization.py │ ├── test_scope_parser.py │ └── test_scope_parser_intermediate_representations.py │ ├── services │ ├── auth │ │ └── test_id_token_decoder.py │ ├── compute │ │ ├── test_canononical_client.py │ │ └── test_deprecated_data.py │ └── timers │ │ └── test_legacy_names.py │ ├── sphinxext │ ├── conftest.py │ ├── objects.inv │ ├── test_autodoc_signature_hook.py │ ├── test_automethodlist.py │ ├── test_base_add_content_directive.py │ ├── test_copyparams_directive.py │ ├── test_enumerate_fixtures.py │ ├── test_expand_testing_fixture.py │ ├── test_extdoclink_directive.py │ ├── test_extdoclink_role.py │ ├── test_list_known_scopes.py │ ├── test_paginated_usage.py │ └── test_utils.py │ ├── test_auth_clients.py │ ├── test_auth_requirements_error.py │ ├── test_base_client.py │ ├── test_config.py │ ├── test_gcs_client.py │ ├── test_guards.py │ ├── test_imports.py │ ├── test_lazy_imports.py │ ├── test_local_gcp.py │ ├── test_missing_type.py │ ├── test_paginator_signature_matching.py │ ├── test_paging.py │ ├── test_specific_flows_client.py │ ├── test_timers_client.py │ ├── test_utils.py │ ├── tokenstorage │ ├── v1 │ │ ├── test_memory_adapter.py │ │ ├── test_simplejson_adapter.py │ │ └── test_sqlite_adapter.py │ └── v2 │ │ ├── test_token_storage.py │ │ └── test_validating_token_storage.py │ └── transport │ ├── __init__.py │ ├── test_clientinfo.py │ ├── test_default_retry_policy.py │ ├── test_retry_check_runner.py │ ├── test_transfer_transport.py │ ├── test_transport.py │ ├── test_transport_authz_handling.py │ └── test_transport_encoders.py ├── tox.ini └── toxfile.py /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 4 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | 16 | [*.{json,yml,yaml}] 17 | indent_size = 2 18 | 19 | [Makefile] 20 | indent_style = tab 21 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = .git,.tox,__pycache__,.eggs,dist,.venv*,docs,build 3 | max-line-length = 88 4 | extend-ignore = W503,W504,E203 5 | 6 | # in pyi stubs, spacing rules are different (black handles this) 7 | per-file-ignores = *.pyi:E302,E305 8 | 9 | [flake8:local-plugins] 10 | extension = 11 | SDK = _globus_sdk_flake8:Plugin 12 | paths = ./src/globus_sdk/ 13 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # 2 | # codeowners reference: 3 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners 4 | # 5 | # for ease of comparison, usernames are kept alphabetized 6 | # 7 | 8 | # default rule 9 | * @aaschaer @ada-globus @derek-globus @kurtmckee @m1yag1 @MaxTueckeGlobus @sirosen 10 | 11 | # Flows service 12 | **/flows/ @ada-globus @derek-globus @kurtmckee @m1yag1 @MaxTueckeGlobus @sirosen 13 | docs/services/flows.rst @ada-globus @derek-globus @kurtmckee @m1yag1 @MaxTueckeGlobus @sirosen 14 | 15 | # Timer service 16 | **/timer/ @ada-globus @derek-globus @kurtmckee @m1yag1 @MaxTueckeGlobus @sirosen 17 | docs/services/timer.rst @ada-globus @derek-globus @kurtmckee @m1yag1 @MaxTueckeGlobus @sirosen 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | groups: 8 | github-actions: 9 | patterns: 10 | - "*" 11 | 12 | # Prevent updates of requirements files used only for testing. 13 | - package-ecosystem: "pip" 14 | directory: "/requirements/" 15 | schedule: 16 | interval: "monthly" 17 | ignore: 18 | - dependency-name: "*" 19 | -------------------------------------------------------------------------------- /.github/workflows/publish_to_pypi.yaml: -------------------------------------------------------------------------------- 1 | name: Publish PyPI Release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | environment: publish-pypi 11 | permissions: 12 | id-token: write 13 | 14 | steps: 15 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 16 | - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 17 | with: 18 | python-version: "3.11" 19 | 20 | - run: python -m pip install build 21 | - run: python -m build . 22 | 23 | - name: Publish to PyPI 24 | uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 25 | -------------------------------------------------------------------------------- /.github/workflows/publish_to_test_pypi.yaml: -------------------------------------------------------------------------------- 1 | name: Publish Test PyPI Release 2 | 3 | on: 4 | push: 5 | tags: ["*"] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | environment: publish-test-pypi 11 | permissions: 12 | id-token: write 13 | 14 | steps: 15 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 16 | - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 17 | with: 18 | python-version: "3.11" 19 | 20 | - run: python -m pip install build 21 | - run: python -m build . 22 | 23 | - name: Publish to TestPyPI 24 | uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 25 | with: 26 | repository-url: https://test.pypi.org/legacy/ 27 | -------------------------------------------------------------------------------- /.github/workflows/readthedocs-pr-links.yaml: -------------------------------------------------------------------------------- 1 | name: Read the Docs Pull Request Preview 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | documentation-links: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333 # v1.5 15 | with: 16 | project-slug: "globus-sdk-python" 17 | -------------------------------------------------------------------------------- /.github/workflows/update_pr_references.yaml: -------------------------------------------------------------------------------- 1 | name: update-pr-references 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - 4.x-dev 7 | 8 | jobs: 9 | update_pr_numbers_in_change_fragments: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 13 | - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 14 | with: 15 | python-version: '3.x' 16 | - name: update any PR numbers in change fragments 17 | run: | 18 | python ./changelog.d/update-pr-refs.py 19 | if [ "$(git status --porcelain)" = "" ]; then 20 | echo "no changes" 21 | else 22 | git add changelog.d/ 23 | git \ 24 | -c user.name="GitHub Actions" \ 25 | -c user.email="actions@github.com" \ 26 | commit -m '(actions) update PR references' 27 | git push origin 28 | fi 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | _build 3 | MANIFEST 4 | dist 5 | *.pyc 6 | .tox 7 | globus_sdk.egg-info 8 | eggs/ 9 | .eggs/ 10 | .idea 11 | 12 | # virtualenv 13 | .venv/ 14 | venv/ 15 | ENV/ 16 | env/ 17 | .env/ 18 | 19 | # pytest 20 | .pytest_cache 21 | .coverage 22 | .coverage.* 23 | 24 | # intermediary requirements files 25 | /requirements/*.in 26 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | configuration: docs/conf.py 5 | fail_on_warning: true 6 | 7 | build: 8 | os: "ubuntu-22.04" 9 | tools: 10 | python: "3.11" 11 | jobs: 12 | pre_build: 13 | - bash ./scripts/rtd-pre-sphinx-build.sh 14 | 15 | python: 16 | install: 17 | - method: pip 18 | path: . 19 | - requirements: "requirements/py3.11/docs.txt" 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SDK_VERSION=$(shell grep '^__version__' src/globus_sdk/version.py | cut -d '"' -f2) 2 | 3 | # these are just tox invocations wrapped nicely for convenience 4 | .PHONY: lint test docs all-checks 5 | lint: 6 | tox -e lint,mypy,mypy-test,pylint 7 | test: 8 | tox 9 | docs: 10 | tox -e docs 11 | all-checks: 12 | tox -e lint,pylint,mypy,mypy-test,test-lazy-imports,py37,py310,poetry-check,twine-check,docs 13 | 14 | .PHONY: showvars tag-release prepare-release 15 | showvars: 16 | @echo "SDK_VERSION=$(SDK_VERSION)" 17 | prepare-release: 18 | tox -e prepare-release 19 | tag-release: 20 | git tag -s "$(SDK_VERSION)" -m "v$(SDK_VERSION)" 21 | -git push $(shell git rev-parse --abbrev-ref @{push} | cut -d '/' -f1) refs/tags/$(SDK_VERSION) 22 | 23 | .PHONY: clean 24 | clean: 25 | rm -rf dist build *.egg-info .tox .venv 26 | find . -type d -name '__pycache__' -exec rm -r {} + 27 | -------------------------------------------------------------------------------- /changelog.d/20250604_172822_sirosen_bugfix_high_assuranc.rst: -------------------------------------------------------------------------------- 1 | Fixed 2 | ~~~~~ 3 | 4 | - Fix an error which caused the ``restrict_transfers_to_high_assurance`` field 5 | to be malformed when set on a collection payload type. (:pr:`1211`) 6 | -------------------------------------------------------------------------------- /changelog.d/README.md: -------------------------------------------------------------------------------- 1 | # Changelog Fragments 2 | 3 | Create changelog entries with `scriv` 4 | 5 | Use `scriv create --edit` to create a changelog fragment 6 | 7 | Fragments are collected for release as part of `make prepare-release` 8 | -------------------------------------------------------------------------------- /changelog.d/new_fragment.rst.j2: -------------------------------------------------------------------------------- 1 | .. 2 | .. A new scriv changelog fragment 3 | .. 4 | .. Uncomment the header that is right (remove the leading dots). 5 | .. 6 | .. Leave the "(:pr:`...`)" text in your change description. 7 | .. GitHub Actions will automatically replace it when the PR is merged. 8 | .. 9 | {% for cat in config.categories -%} 10 | .. {{ cat }} 11 | .. {{ config.rst_header_chars[1] * (cat|length) }} 12 | .. 13 | .. - A bullet item for the {{ cat }} category. (:pr:`NUMBER`) 14 | .. 15 | {% endfor -%} 16 | -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 09663896a363f5a893d1993939ee5df0 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/_static/css/globus_sdk_tab_borders.css: -------------------------------------------------------------------------------- 1 | /* custom CSS to add a border to tab groups 2 | * see also: 3 | * https://github.com/pradyunsg/furo/discussions/633 */ 4 | :root { 5 | /* default to '#aaa', which looks okay in both light and dark */ 6 | --tabset-border-color: #aaa; 7 | } 8 | /* set the border color to decrease contrast a little on dark theme 9 | * this detection logic is taken from furo, which sets data-theme on the body 10 | * element when the user toggles the color scheme */ 11 | @media (prefers-color-scheme: dark) { 12 | body:not([data-theme="light"]) { 13 | --tabset-border-color: #777; 14 | } 15 | } 16 | .sd-tab-set { 17 | border-style: solid; 18 | border-width: 1px; 19 | border-radius: 3px; 20 | border-color: var(--tabset-border-color); 21 | padding: 1px; 22 | } 23 | .sd-tab-set .sd-tab-content { 24 | padding: 4px; 25 | } 26 | -------------------------------------------------------------------------------- /docs/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/docs/_static/logo.png -------------------------------------------------------------------------------- /docs/authorization.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | The documentation which was found on this page has moved to 4 | :ref:`Globus Authorizers `. 5 | -------------------------------------------------------------------------------- /docs/authorization/globus_app/index.rst: -------------------------------------------------------------------------------- 1 | .. _globus_app: 2 | 3 | Globus App 4 | ========== 5 | 6 | For a narrative-style introduction to the concepts contained within GlobusApp, see 7 | :ref:`using_globus_app`. 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | apps 13 | config 14 | -------------------------------------------------------------------------------- /docs/authorization/index.rst: -------------------------------------------------------------------------------- 1 | Globus SDK Authorization 2 | ======================== 3 | 4 | Components of the Globus SDK which handle application authorization. 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | globus_app/index 10 | globus_authorizers 11 | scopes_and_consents/index 12 | login_flows 13 | token_caching/index 14 | gare 15 | -------------------------------------------------------------------------------- /docs/authorization/token_caching/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Token Caching 3 | ============= 4 | 5 | The documentation in this section provides references for interfaces and standard 6 | implementations for caching OAuth2 tokens. While there are two distinct class 7 | hierarchies, :ref:`token_storages` and its predecessor :ref:`storage_adapters`, we 8 | recommend using the former. ``TokenStorage`` is a newer iteration of the token storage 9 | interface and includes a superset of the functionality previously supported in 10 | ``StorageAdapter``. 11 | 12 | All constructs from both hierarchies are importable from the ``globus_sdk.tokenstorage`` 13 | namespace. 14 | 15 | .. toctree:: 16 | :maxdepth: 1 17 | 18 | token_storages 19 | storage_adapters 20 | 21 | -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../changelog.rst 2 | -------------------------------------------------------------------------------- /docs/core/base_client.rst: -------------------------------------------------------------------------------- 1 | BaseClient 2 | ========== 3 | 4 | All service clients support the low level interface, provided by the 5 | ``BaseClient``, from which all client types inherit. 6 | 7 | A client object contains a ``transport``, an object responsible for sending 8 | requests, encoding data, and handling potential retries. It also may include an 9 | optional ``authorizer``, an object responsible for handling token 10 | authentication for requests. 11 | 12 | BaseClient 13 | ---------- 14 | 15 | .. autoclass:: globus_sdk.BaseClient 16 | :members: scopes, resource_server, attach_globus_app, get, put, post, patch, delete, request 17 | :member-order: bysource 18 | -------------------------------------------------------------------------------- /docs/core/index.rst: -------------------------------------------------------------------------------- 1 | Globus SDK Core 2 | =============== 3 | 4 | Underlying components of the Globus SDK. 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | base_client 10 | transport 11 | responses 12 | paging 13 | exceptions 14 | warnings 15 | 16 | .. toctree:: 17 | :hidden: 18 | 19 | utils 20 | -------------------------------------------------------------------------------- /docs/core/responses.rst: -------------------------------------------------------------------------------- 1 | Responses 2 | ========= 3 | 4 | Unless noted otherwise, all method return values for Globus SDK Clients are 5 | ``GlobusHTTPResponse`` objects. 6 | 7 | To customize client methods with additional detail, the SDK uses subclasses of 8 | ``GlobusHTTPResponse``. 9 | 10 | .. autoclass:: globus_sdk.response.GlobusHTTPResponse 11 | :members: 12 | :show-inheritance: 13 | 14 | .. autoclass:: globus_sdk.response.IterableResponse 15 | :members: 16 | :show-inheritance: 17 | 18 | .. autoclass:: globus_sdk.response.ArrayResponse 19 | :members: 20 | :show-inheritance: 21 | -------------------------------------------------------------------------------- /docs/examples/index.rst: -------------------------------------------------------------------------------- 1 | .. _examples: 2 | 3 | Globus SDK Examples 4 | =================== 5 | 6 | Each of these pages contains an example of a piece of SDK functionality. 7 | 8 | .. toctree:: 9 | minimal_transfer_script/index 10 | auth_manage_projects/index 11 | create_and_run_flow/index 12 | tokenstorage/index 13 | group_listing 14 | authorization 15 | native_app 16 | client_credentials 17 | three_legged_oauth 18 | recursive_ls 19 | endpoint_type_enum 20 | timer_management/index 21 | guest_collection_creation 22 | -------------------------------------------------------------------------------- /docs/examples/timer_management/delete_timer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import argparse 4 | 5 | import globus_sdk 6 | from globus_sdk.experimental.globus_app import UserApp 7 | 8 | # Tutorial Client ID - 9 | NATIVE_CLIENT_ID = "61338d24-54d5-408f-a10d-66c06b59f6d2" 10 | USER_APP = UserApp("manage-timers-example", client_id=NATIVE_CLIENT_ID) 11 | 12 | 13 | def main(): 14 | parser = argparse.ArgumentParser() 15 | parser.add_argument("TIMER_ID") 16 | args = parser.parse_args() 17 | 18 | client = globus_sdk.TimersClient(app=USER_APP) 19 | 20 | client.delete_job(args.TIMER_ID) 21 | print("Finished deleting timer.") 22 | 23 | 24 | if __name__ == "__main__": 25 | main() 26 | -------------------------------------------------------------------------------- /docs/examples/timer_management/list_timers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import globus_sdk 4 | from globus_sdk.experimental.globus_app import UserApp 5 | 6 | # Tutorial Client ID - 7 | NATIVE_CLIENT_ID = "61338d24-54d5-408f-a10d-66c06b59f6d2" 8 | USER_APP = UserApp("manage-timers-example", client_id=NATIVE_CLIENT_ID) 9 | 10 | 11 | def main(): 12 | client = globus_sdk.TimersClient(app=USER_APP) 13 | 14 | first = True 15 | for record in client.list_jobs(query_params={"filter_active": True})["jobs"]: 16 | if not first: 17 | print("---") 18 | first = False 19 | print("name:", record["name"]) 20 | print("id:", record["job_id"]) 21 | 22 | 23 | if __name__ == "__main__": 24 | main() 25 | -------------------------------------------------------------------------------- /docs/examples/timer_operations.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | The documentation which was found on this page has moved to 4 | :ref:`Timer Management Examples `. 5 | -------------------------------------------------------------------------------- /docs/examples/tokenstorage/index.rst: -------------------------------------------------------------------------------- 1 | .. _example_tokenstorage: 2 | 3 | Token Storage Adapters 4 | ====================== 5 | 6 | DynamoDB Token Storage 7 | ---------------------- 8 | 9 | The following example demonstrates a token storage adapter which uses AWS 10 | DynamoDB as the backend storage mechanism. 11 | 12 | Unlike the builtin adapters for JSON and sqlite, there is no capability here 13 | for an enumeration of all of the tokens in storage. This is because DynamoDB 14 | functions as a key-value store, and can efficiently map keys, but features slow 15 | sequential scans for enumeration. The example therefore demonstrates that 16 | key-value stores with limited or no capabilities for table scans can be used to 17 | implement the token storage interface. 18 | 19 | .. literalinclude:: dynamodb_tokenstorage.py 20 | :caption: ``dynamodb_tokenstorage.py`` [:download:`download `] 21 | :language: python 22 | -------------------------------------------------------------------------------- /docs/experimental/examples/endpoints_and_collections/identifying_entity_type.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Identifying Entity Type 5 | ======================= 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/flows/create.rst: -------------------------------------------------------------------------------- 1 | 2 | Creating a Flow 3 | =============== 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/flows/delete.rst: -------------------------------------------------------------------------------- 1 | 2 | Deleting a Flow 3 | =============== 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/flows/index.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Flows 5 | ===== 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | 10 | create 11 | list 12 | run 13 | delete 14 | -------------------------------------------------------------------------------- /docs/experimental/examples/flows/list.rst: -------------------------------------------------------------------------------- 1 | 2 | Listing Flows 3 | ============= 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/flows/run.rst: -------------------------------------------------------------------------------- 1 | 2 | Running a Flow 3 | ============== 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Updated Examples 3 | ================ 4 | 5 | This experimental doc restructures the existing :ref:`examples` section by: 6 | 7 | * Grouping examples by common topic 8 | * Consolidating & updating examples into a more uniform active format 9 | * Updating references to leverage the latest SDK constructs (notably GlobusApp) 10 | 11 | While in ``experimental`` it should be considered a work in progress and subject to 12 | change. Once complete, it'll be merged into the main documentation, replacing the 13 | existing examples section. 14 | 15 | .. toctree:: 16 | :maxdepth: 2 17 | 18 | oauth2/index 19 | -------------------------------------------------------------------------------- /docs/experimental/examples/oauth2/authorizers.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Using Authorizers 5 | ================= 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/oauth2/customizing_token_storage.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Customizing Token Storage 5 | ========================= 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/oauth2/index.rst: -------------------------------------------------------------------------------- 1 | 2 | OAuth2 at Globus 3 | ================ 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | globus_app 9 | -------------------------------------------------------------------------------- /docs/experimental/examples/oauth2/login_flows.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Running Login Flows 5 | =================== 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/oauth2/three_legged_oauth.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Performing Three-Legged OAuth in Flask 5 | ======================================== 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/projects/create.rst: -------------------------------------------------------------------------------- 1 | 2 | Creating a Project 3 | ================== 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/projects/delete.rst: -------------------------------------------------------------------------------- 1 | 2 | Deleting a Project 3 | ================== 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/projects/index.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Auth Projects 5 | ============= 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | 10 | create 11 | list 12 | delete 13 | -------------------------------------------------------------------------------- /docs/experimental/examples/projects/list.rst: -------------------------------------------------------------------------------- 1 | 2 | Listing Projects 3 | ================ 4 | 5 | TODO 6 | -------------------------------------------------------------------------------- /docs/experimental/examples/transferring_data/recursive_ls.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Recursively Listing a Filesystem 5 | ================================ 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/transferring_data/schedule_transfer/index.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Scheduling a Transfer 5 | ===================== 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/experimental/examples/transferring_data/task_deadlines.rst: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | Setting Task Deadlines 5 | ====================== 6 | 7 | TODO 8 | -------------------------------------------------------------------------------- /docs/local_endpoints.rst: -------------------------------------------------------------------------------- 1 | .. _local_endpoints: 2 | 3 | Local Endpoints 4 | =============== 5 | 6 | .. currentmodule:: globus_sdk 7 | 8 | Unlike SDK functionality for accessing Globus APIs, the locally available 9 | Globus Endpoints require special treatment. 10 | These accesses are not authenticated via Globus Auth, and may rely upon the 11 | state of the local filesystem, running processes, and the permissions of local 12 | users. 13 | 14 | Globus Connect Server 15 | --------------------- 16 | 17 | .. autoclass:: LocalGlobusConnectServer 18 | :members: 19 | :member-order: bysource 20 | 21 | Globus Connect Personal 22 | ----------------------- 23 | 24 | Globus Connect Personal endpoints belonging to the current user may be accessed 25 | via instances of the following class: 26 | 27 | .. autoclass:: LocalGlobusConnectPersonal 28 | :members: 29 | :member-order: bysource 30 | 31 | .. autoclass:: GlobusConnectPersonalOwnerInfo 32 | :members: 33 | :member-order: bysource 34 | -------------------------------------------------------------------------------- /docs/scopes.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | The documentation which was found on this page has moved to :ref:`Scopes `. 4 | -------------------------------------------------------------------------------- /docs/testing/index.rst: -------------------------------------------------------------------------------- 1 | .. warning:: 2 | 3 | This component is an *alpha*. Interfaces may change outside of the 4 | normal semver policy. 5 | 6 | .. _testing_root: 7 | 8 | Globus SDK _testing 9 | =================== 10 | 11 | .. warning:: 12 | 13 | The exact data and payloads provided via ``_testing`` are a best 14 | approximation of API responses. They may change in any SDK release to be 15 | more accurate. 16 | 17 | .. toctree:: 18 | :caption: Contents 19 | 20 | getting_started 21 | reference 22 | methods/index 23 | -------------------------------------------------------------------------------- /docs/testing/methods/auth.rst: -------------------------------------------------------------------------------- 1 | Globus Auth _testing Method List 2 | ================================ 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.AuthClient 5 | -------------------------------------------------------------------------------- /docs/testing/methods/flows.rst: -------------------------------------------------------------------------------- 1 | Globus Flows _testing Method List 2 | ================================= 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.FlowsClient 5 | 6 | .. enumeratetestingfixtures:: globus_sdk.SpecificFlowClient 7 | -------------------------------------------------------------------------------- /docs/testing/methods/gcs.rst: -------------------------------------------------------------------------------- 1 | Globus Connect Server _testing Method List 2 | ========================================== 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.GCSClient 5 | -------------------------------------------------------------------------------- /docs/testing/methods/groups.rst: -------------------------------------------------------------------------------- 1 | Globus Groups _testing Method List 2 | ================================== 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.GroupsClient 5 | -------------------------------------------------------------------------------- /docs/testing/methods/index.rst: -------------------------------------------------------------------------------- 1 | .. warning:: 2 | 3 | This component is an *alpha*. Interfaces may change outside of the 4 | normal semver policy. 5 | 6 | _testing Method List 7 | ==================== 8 | 9 | These pages list all methods which have ``globus_sdk._testing`` response data, 10 | and the casenames for those data. 11 | 12 | .. toctree:: 13 | :caption: Clients 14 | 15 | auth 16 | groups 17 | transfer 18 | gcs 19 | timers 20 | flows 21 | search 22 | -------------------------------------------------------------------------------- /docs/testing/methods/search.rst: -------------------------------------------------------------------------------- 1 | Globus Search _testing Method List 2 | ================================== 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.SearchClient 5 | -------------------------------------------------------------------------------- /docs/testing/methods/timers.rst: -------------------------------------------------------------------------------- 1 | Globus Timers _testing Method List 2 | ================================== 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.TimersClient 5 | -------------------------------------------------------------------------------- /docs/testing/methods/transfer.rst: -------------------------------------------------------------------------------- 1 | Globus Transfer _testing Method List 2 | ==================================== 3 | 4 | .. enumeratetestingfixtures:: globus_sdk.TransferClient 5 | -------------------------------------------------------------------------------- /docs/testing/reference.rst: -------------------------------------------------------------------------------- 1 | .. warning:: 2 | 3 | This component is an *alpha*. Interfaces may change outside of the 4 | normal semver policy. 5 | 6 | _testing Reference 7 | ================== 8 | 9 | .. module:: globus_sdk._testing 10 | 11 | Functions 12 | --------- 13 | 14 | .. autofunction:: get_last_request 15 | 16 | .. autofunction:: register_response_set 17 | 18 | .. autofunction:: get_response_set 19 | 20 | .. autofunction:: load_response_set 21 | 22 | .. autofunction:: load_response 23 | 24 | .. autofunction:: construct_error 25 | 26 | Classes 27 | ------- 28 | 29 | .. autoclass:: RegisteredResponse 30 | :members: 31 | :member-order: bysource 32 | 33 | .. autoclass:: ResponseList 34 | :members: 35 | :member-order: bysource 36 | 37 | .. autoclass:: ResponseSet 38 | :members: 39 | :member-order: bysource 40 | -------------------------------------------------------------------------------- /docs/tokenstorage.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | The documentation which was found on this page has moved to :ref:`storage_adapters`. 4 | -------------------------------------------------------------------------------- /docs/tutorial.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | The documentation which was found on this page has moved to :ref:`Getting Started `. 4 | 5 | -------------------------------------------------------------------------------- /docs/user_guide/getting_started/index.rst: -------------------------------------------------------------------------------- 1 | .. _tutorials: 2 | 3 | .. _getting_started: 4 | 5 | Getting Started 6 | =============== 7 | 8 | These docs cover basic usage of the Globus SDK. 9 | 10 | They takes you through a simple step-by-step flow for registering your 11 | application, and then using that registered application to login and 12 | interact with services. 13 | 14 | Two example scripts are offered -- one using the ``GlobusApp`` class and one 15 | without it. ``GlobusApp`` is recommended for most use cases, but there are 16 | scenarios which are not supported by it. Reading the non-``GlobusApp`` example 17 | may also enhance your understanding of how ``GlobusApp`` works. 18 | 19 | .. toctree:: 20 | :caption: How To Use the SDK 21 | :maxdepth: 1 22 | 23 | Register an App in Globus Auth 24 | Create a Minimal Script 25 | Create a Minimal Script Without GlobusApp 26 | -------------------------------------------------------------------------------- /docs/user_guide/getting_started/list_groups.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | 3 | # this is the tutorial client ID 4 | # replace this string with your ID for production use 5 | CLIENT_ID = "61338d24-54d5-408f-a10d-66c06b59f6d2" 6 | 7 | # create your app 8 | my_app = globus_sdk.UserApp("my-user-app", client_id=CLIENT_ID) 9 | 10 | # create a client with your app 11 | groups_client = globus_sdk.GroupsClient(app=my_app) 12 | 13 | # call out to the Groups service to get a listing 14 | my_groups = groups_client.get_my_groups() 15 | 16 | # print in CSV format 17 | print("ID,Name,Roles") 18 | for group in my_groups: 19 | roles = "|".join({m["role"] for m in group["my_memberships"]}) 20 | print(",".join([group["id"], f'"{group["name"]}"', roles])) 21 | -------------------------------------------------------------------------------- /docs/user_guide/getting_started/list_groups_with_login.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | 3 | # this is the tutorial client ID 4 | # replace this string with your ID for production use 5 | CLIENT_ID = "61338d24-54d5-408f-a10d-66c06b59f6d2" 6 | 7 | # create your app 8 | my_app = globus_sdk.UserApp("my-user-app", client_id=CLIENT_ID) 9 | 10 | # create a client with your app 11 | groups_client = globus_sdk.GroupsClient(app=my_app) 12 | 13 | # Important! The login step needs to happen after the `groups_client` is created 14 | # so that the app will know that you need credentials for Globus Groups 15 | my_app.login() 16 | 17 | # call out to the Groups service to get a listing 18 | my_groups = groups_client.get_my_groups() 19 | 20 | # print in CSV format 21 | print("ID,Name,Roles") 22 | for group in my_groups: 23 | roles = "|".join({m["role"] for m in group["my_memberships"]}) 24 | print(",".join([group["id"], f'"{group["name"]}"', roles])) 25 | -------------------------------------------------------------------------------- /docs/user_guide/installation.rst: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | The Globus SDK requires `Python 3 `_. 5 | If a supported version of Python is not already installed on your system, see 6 | this `Python installation guide \ 7 | `_. 8 | 9 | The simplest way to install the Globus SDK is using the ``pip`` package manager 10 | (https://pypi.python.org/pypi/pip), which is included in most Python 11 | installations: 12 | 13 | :: 14 | 15 | pip install globus-sdk 16 | 17 | This will install the Globus SDK and it's dependencies. 18 | 19 | Bleeding edge versions of the Globus SDK can be installed by checking out the 20 | git repository and installing it manually: 21 | 22 | :: 23 | 24 | git clone https://github.com/globus/globus-sdk-python.git 25 | cd globus-sdk-python 26 | pip install . 27 | -------------------------------------------------------------------------------- /docs/user_guide/usage_patterns/data_transfer/index.rst: -------------------------------------------------------------------------------- 1 | .. _userguide_data_transfer: 2 | 3 | Data Transfer 4 | ============= 5 | 6 | Globus provides numerous features and components aimed at robust and reliable 7 | data transfer, integrating with your existing storage systems. 8 | 9 | These docs focus on Globus Connect Personal, Globus Connect Server, and Globus 10 | Transfer. 11 | Additionally, integrating these components with other Globus services like 12 | Timers is covered. 13 | 14 | .. toctree:: 15 | :caption: How to Manage Data Transfers using the SDK 16 | :maxdepth: 1 17 | 18 | submit_transfer/index 19 | scheduled_transfers/index 20 | detecting_data_access/index 21 | create_guest_collection/index 22 | transfer_relative_deadline/index 23 | -------------------------------------------------------------------------------- /requirements/README.rst: -------------------------------------------------------------------------------- 1 | Requirements Data 2 | ----------------- 3 | 4 | These ``*.txt`` data are autogenerated from ``[dependency-groups]`` data. 5 | There are gitignored, hidden ``.in`` files in this directory as a part of that process. 6 | 7 | Modify the sources manually, then regenerate the "pinned" or "locked" dependencies with ``tox r -m freezedeps``. 8 | -------------------------------------------------------------------------------- /requirements/py3.11/test.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.11 3 | # by the following command: 4 | # 5 | # tox p -m freezedeps 6 | # 7 | certifi==2024.8.30 8 | # via requests 9 | charset-normalizer==3.4.0 10 | # via requests 11 | coverage==7.6.3 12 | # via -r .test.in 13 | execnet==2.1.1 14 | # via pytest-xdist 15 | flaky==3.8.1 16 | # via -r .test.in 17 | idna==3.10 18 | # via requests 19 | iniconfig==2.0.0 20 | # via pytest 21 | packaging==24.1 22 | # via pytest 23 | pluggy==1.5.0 24 | # via pytest 25 | pytest==8.3.3 26 | # via 27 | # -r .test.in 28 | # pytest-randomly 29 | # pytest-xdist 30 | pytest-randomly==3.15.0 31 | # via -r .test.in 32 | pytest-xdist==3.6.1 33 | # via -r .test.in 34 | pyyaml==6.0.2 35 | # via responses 36 | requests==2.32.3 37 | # via responses 38 | responses==0.25.3 39 | # via -r .test.in 40 | urllib3==2.2.3 41 | # via 42 | # requests 43 | # responses 44 | -------------------------------------------------------------------------------- /requirements/py3.12/test.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.12 3 | # by the following command: 4 | # 5 | # tox p -m freezedeps 6 | # 7 | certifi==2024.8.30 8 | # via requests 9 | charset-normalizer==3.4.0 10 | # via requests 11 | coverage==7.6.3 12 | # via -r .test.in 13 | execnet==2.1.1 14 | # via pytest-xdist 15 | flaky==3.8.1 16 | # via -r .test.in 17 | idna==3.10 18 | # via requests 19 | iniconfig==2.0.0 20 | # via pytest 21 | packaging==24.1 22 | # via pytest 23 | pluggy==1.5.0 24 | # via pytest 25 | pytest==8.3.3 26 | # via 27 | # -r .test.in 28 | # pytest-randomly 29 | # pytest-xdist 30 | pytest-randomly==3.15.0 31 | # via -r .test.in 32 | pytest-xdist==3.6.1 33 | # via -r .test.in 34 | pyyaml==6.0.2 35 | # via responses 36 | requests==2.32.3 37 | # via responses 38 | responses==0.25.3 39 | # via -r .test.in 40 | urllib3==2.2.3 41 | # via 42 | # requests 43 | # responses 44 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /src/globus_sdk/_sphinxext/directives/__init__.py: -------------------------------------------------------------------------------- 1 | from .add_content_directive import AddContentDirective 2 | from .automethodlist import AutoMethodList 3 | from .copy_params import CopyParams 4 | from .enumerate_testing_fixtures import EnumerateTestingFixtures 5 | from .expand_testing_fixture import ExpandTestingFixture 6 | from .externaldoclink import ExternalDocLink 7 | from .list_known_scopes import ListKnownScopes 8 | from .paginated_usage import PaginatedUsage 9 | 10 | __all__ = ( 11 | "AddContentDirective", 12 | "AutoMethodList", 13 | "CopyParams", 14 | "EnumerateTestingFixtures", 15 | "ExpandTestingFixture", 16 | "ExternalDocLink", 17 | "ListKnownScopes", 18 | "PaginatedUsage", 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/_sphinxext/directives/paginated_usage.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | 3 | from .add_content_directive import AddContentDirective 4 | 5 | 6 | class PaginatedUsage(AddContentDirective): 7 | has_content = False 8 | required_arguments = 1 9 | optional_arguments = 0 10 | 11 | def gen_rst(self) -> t.Iterator[str]: 12 | yield "This method supports paginated access. " 13 | yield "To use the paginated variant, give the same arguments as normal, " 14 | yield "but prefix the method name with ``paginated``, as in" 15 | yield "" 16 | yield ".. code-block::" 17 | yield "" 18 | yield f" client.paginated.{self.arguments[0]}(...)" 19 | yield "" 20 | yield "For more information, see" 21 | yield ":ref:`how to make paginated calls `." 22 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/__init__.py: -------------------------------------------------------------------------------- 1 | from .helpers import construct_error, get_last_request 2 | from .models import RegisteredResponse, ResponseList, ResponseSet 3 | from .registry import ( 4 | get_response_set, 5 | load_response, 6 | load_response_set, 7 | register_response_set, 8 | ) 9 | 10 | __all__ = ( 11 | "get_last_request", 12 | "construct_error", 13 | "ResponseSet", 14 | "ResponseList", 15 | "RegisteredResponse", 16 | "load_response_set", 17 | "load_response", 18 | "get_response_set", 19 | "register_response_set", 20 | ) 21 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/auth/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/delete_client_credential.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | CREDENTIAL = { 6 | "name": "foo", 7 | "id": str(uuid.uuid1()), 8 | "created": "2023-10-21T22:46:15.845937+00:00", 9 | "client": "7dee4432-0297-4989-ad23-a2b672a52b12", 10 | "secret": None, 11 | } 12 | 13 | RESPONSES = ResponseSet( 14 | default=RegisteredResponse( 15 | service="auth", 16 | method="DELETE", 17 | path=f"/v2/api/clients/{CREDENTIAL['client']}/credentials/{CREDENTIAL['id']}", 18 | json={"credential": CREDENTIAL}, 19 | metadata={ 20 | "credential_id": CREDENTIAL["id"], 21 | "client_id": CREDENTIAL["client"], 22 | }, 23 | ), 24 | ) 25 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/delete_policy.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | POLICY = { 6 | "high_assurance": False, 7 | "domain_constraints_include": ["greenlight.org"], 8 | "display_name": "GreenLight domain Only Policy", 9 | "description": "Only allow access from @greenlight.org", 10 | "id": str(uuid.uuid1()), 11 | "domain_constraints_exclude": None, 12 | "project_id": "da84e531-1afb-43cb-8c87-135ab580516a", 13 | "authentication_assurance_timeout": 35, 14 | "required_mfa": False, 15 | } 16 | 17 | RESPONSES = ResponseSet( 18 | default=RegisteredResponse( 19 | service="auth", 20 | method="DELETE", 21 | path=f"/v2/api/policies/{POLICY['id']}", 22 | json={"policy": POLICY}, 23 | metadata={ 24 | "policy_id": POLICY["id"], 25 | }, 26 | ) 27 | ) 28 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/delete_scope.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | SCOPE = { 6 | "scope_string": "https://auth.globus.org/scopes/3f33d83f-ec0a-4190-887d-0622e7c4ee9a/manager", # noqa: E501 7 | "allows_refresh_token": False, 8 | "id": str(uuid.uuid1()), 9 | "advertised": False, 10 | "required_domains": [], 11 | "name": "Client manage scope", 12 | "description": "Manage configuration of this client", 13 | "client": "3f33d83f-ec0a-4190-887d-0622e7c4ee9a", 14 | "dependent_scopes": [], 15 | } 16 | 17 | RESPONSES = ResponseSet( 18 | default=RegisteredResponse( 19 | service="auth", 20 | method="DELETE", 21 | path=f"/v2/api/scopes/{SCOPE['id']}", 22 | json={"scope": SCOPE}, 23 | metadata={ 24 | "scope_id": SCOPE["id"], 25 | }, 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/get_client_credentials.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | CREDENTIAL = { 6 | "name": "foo", 7 | "id": str(uuid.uuid1()), 8 | "created": "2023-10-21T22:46:15.845937+00:00", 9 | "client": "7dee4432-0297-4989-ad23-a2b672a52b12", 10 | "secret": None, 11 | } 12 | 13 | RESPONSES = ResponseSet( 14 | default=RegisteredResponse( 15 | service="auth", 16 | path=f"/v2/api/clients/{CREDENTIAL['client']}/credentials", 17 | json={"credentials": [CREDENTIAL]}, 18 | metadata={ 19 | "credential_id": CREDENTIAL["id"], 20 | "client_id": CREDENTIAL["client"], 21 | }, 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/get_policy.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | POLICY = { 6 | "high_assurance": False, 7 | "domain_constraints_include": ["greenlight.org"], 8 | "display_name": "GreenLight domain Only Policy", 9 | "description": "Only allow access from @greenlight.org", 10 | "id": str(uuid.uuid1()), 11 | "domain_constraints_exclude": None, 12 | "project_id": "da84e531-1afb-43cb-8c87-135ab580516a", 13 | "authentication_assurance_timeout": 35, 14 | "required_mfa": False, 15 | } 16 | 17 | RESPONSES = ResponseSet( 18 | default=RegisteredResponse( 19 | service="auth", 20 | path=f"/v2/api/policies/{POLICY['id']}", 21 | json={"policy": POLICY}, 22 | metadata={ 23 | "policy_id": POLICY["id"], 24 | }, 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/get_scope.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | SCOPE = { 6 | "scope_string": "https://auth.globus.org/scopes/3f33d83f-ec0a-4190-887d-0622e7c4ee9a/manager", # noqa: E501 7 | "allows_refresh_token": False, 8 | "id": str(uuid.uuid1()), 9 | "advertised": False, 10 | "required_domains": [], 11 | "name": "Client manage scope", 12 | "description": "Manage configuration of this client", 13 | "client": "3f33d83f-ec0a-4190-887d-0622e7c4ee9a", 14 | "dependent_scopes": [], 15 | } 16 | 17 | RESPONSES = ResponseSet( 18 | default=RegisteredResponse( 19 | service="auth", 20 | path=f"/v2/api/scopes/{SCOPE['id']}", 21 | json={"scope": SCOPE}, 22 | metadata={ 23 | "scope_id": SCOPE["id"], 24 | }, 25 | ), 26 | ) 27 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/oauth2_revoke_token.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | RESPONSES = ResponseSet( 4 | default=RegisteredResponse( 5 | service="auth", 6 | path="/v2/oauth2/token/revoke", 7 | method="POST", 8 | json={"active": False}, 9 | ) 10 | ) 11 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/oauth2_userinfo.py: -------------------------------------------------------------------------------- 1 | # this is a clone of the userinfo.py data for compatibility across testing 2 | # it should be removed in a future release 3 | from .userinfo import RESPONSES 4 | 5 | __all__ = ("RESPONSES",) 6 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/auth/userinfo.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import FORBIDDEN_AUTH_RESPONSE, UNAUTHORIZED_AUTH_RESPONSE 4 | 5 | RESPONSES = ResponseSet( 6 | unauthorized=RegisteredResponse( 7 | service="auth", 8 | path="/v2/oauth2/userinfo", 9 | status=401, 10 | json=UNAUTHORIZED_AUTH_RESPONSE.json, 11 | metadata={ 12 | "error_id": UNAUTHORIZED_AUTH_RESPONSE.error_id, 13 | **UNAUTHORIZED_AUTH_RESPONSE.metadata_include, 14 | }, 15 | ), 16 | forbidden=RegisteredResponse( 17 | service="auth", 18 | path="/v2/oauth2/userinfo", 19 | status=403, 20 | json=FORBIDDEN_AUTH_RESPONSE.json, 21 | metadata={ 22 | "error_id": FORBIDDEN_AUTH_RESPONSE.error_id, 23 | **FORBIDDEN_AUTH_RESPONSE.metadata_include, 24 | }, 25 | ), 26 | ) 27 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/compute/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/compute/v2/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/delete_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"endpoint_id": ENDPOINT_ID}, 7 | default=RegisteredResponse( 8 | service="compute", 9 | path=f"/v2/endpoints/{ENDPOINT_ID}", 10 | method="DELETE", 11 | json={"result": 302}, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/delete_function.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import FUNCTION_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"function_id": FUNCTION_ID}, 7 | default=RegisteredResponse( 8 | service="compute", 9 | path=f"/v2/functions/{FUNCTION_ID}", 10 | method="DELETE", 11 | json={"result": 302}, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_endpoint_status.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "status": "online", 7 | "details": { 8 | "total_workers": 1, 9 | "idle_workers": 0, 10 | "pending_tasks": 0, 11 | "outstanding_tasks": 0, 12 | "managers": 1, 13 | }, 14 | } 15 | 16 | RESPONSES = ResponseSet( 17 | metadata={"endpoint_id": ENDPOINT_ID}, 18 | default=RegisteredResponse( 19 | service="compute", 20 | path=f"/v2/endpoints/{ENDPOINT_ID}/status", 21 | method="GET", 22 | json=DEFAULT_RESPONSE_DOC, 23 | ), 24 | ) 25 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_endpoints.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID, ENDPOINT_ID_2, USER_ID 4 | 5 | DEFAULT_RESPONSE_DOC = [ 6 | { 7 | "uuid": ENDPOINT_ID, 8 | "name": "my-endpoint", 9 | "display_name": "My Endpoint", 10 | "owner": USER_ID, 11 | }, 12 | { 13 | "uuid": ENDPOINT_ID_2, 14 | "name": "my-second-endpoint", 15 | "display_name": "My Second Endpoint", 16 | "owner": USER_ID, 17 | }, 18 | ] 19 | 20 | RESPONSES = ResponseSet( 21 | metadata={"endpoint_id": ENDPOINT_ID, "endpoint_id_2": ENDPOINT_ID_2}, 22 | default=RegisteredResponse( 23 | service="compute", 24 | path="/v2/endpoints", 25 | method="GET", 26 | json=DEFAULT_RESPONSE_DOC, 27 | ), 28 | ) 29 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_function.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import FUNCTION_CODE, FUNCTION_ID, FUNCTION_NAME 4 | 5 | FUNCTION_DOC = { 6 | "function_uuid": FUNCTION_ID, 7 | "function_name": FUNCTION_NAME, 8 | "function_code": FUNCTION_CODE, 9 | "description": "I just wanted to say hello.", 10 | "metadata": {"python_version": "3.12.6", "sdk_version": "2.28.1"}, 11 | } 12 | 13 | RESPONSES = ResponseSet( 14 | metadata={ 15 | "function_id": FUNCTION_ID, 16 | "function_name": FUNCTION_NAME, 17 | "function_code": FUNCTION_CODE, 18 | }, 19 | default=RegisteredResponse( 20 | service="compute", 21 | path=f"/v2/functions/{FUNCTION_ID}", 22 | method="GET", 23 | json=FUNCTION_DOC, 24 | ), 25 | ) 26 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_result_amqp_url.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | DEFAULT_RESPONSE_DOC = { 4 | "queue_prefix": "some_prefix", 5 | "connection_url": "amqps://user:password@amqp.fqdn", 6 | } 7 | 8 | RESPONSES = ResponseSet( 9 | default=RegisteredResponse( 10 | service="compute", 11 | path="/v2/get_amqp_result_connection_url", 12 | method="GET", 13 | json=DEFAULT_RESPONSE_DOC, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_task.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import TASK_DOC, TASK_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"task_id": TASK_ID}, 7 | default=RegisteredResponse( 8 | service="compute", 9 | path=f"/v2/tasks/{TASK_ID}", 10 | method="GET", 11 | json=TASK_DOC, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_task_batch.py: -------------------------------------------------------------------------------- 1 | from responses.matchers import json_params_matcher 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | from .._common import TASK_DOC, TASK_ID 6 | 7 | TASK_BATCH_DOC = { 8 | "response": "batch", 9 | "results": {TASK_ID: TASK_DOC}, 10 | } 11 | 12 | RESPONSES = ResponseSet( 13 | metadata={"task_id": TASK_ID}, 14 | default=RegisteredResponse( 15 | service="compute", 16 | path="/v2/batch_status", 17 | method="POST", 18 | json=TASK_BATCH_DOC, 19 | # Ensure task_ids is a list 20 | match=[json_params_matcher({"task_ids": [TASK_ID]})], 21 | ), 22 | ) 23 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_task_group.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import TASK_GROUP_ID, TASK_ID, TASK_ID_2 4 | 5 | TASK_BATCH_DOC = { 6 | "taskgroup_id": TASK_GROUP_ID, 7 | "create_websockets_queue": True, 8 | "tasks": [ 9 | {"id": TASK_ID, "created_at": "2021-05-05T15:00:00.000000"}, 10 | {"id": TASK_ID_2, "created_at": "2021-05-05T15:01:00.000000"}, 11 | ], 12 | } 13 | 14 | RESPONSES = ResponseSet( 15 | metadata={ 16 | "task_group_id": TASK_GROUP_ID, 17 | "task_id": TASK_ID, 18 | "task_id_2": TASK_ID_2, 19 | }, 20 | default=RegisteredResponse( 21 | service="compute", 22 | path=f"/v2/taskgroup/{TASK_GROUP_ID}", 23 | method="GET", 24 | json=TASK_BATCH_DOC, 25 | ), 26 | ) 27 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/get_version.py: -------------------------------------------------------------------------------- 1 | from responses.matchers import query_param_matcher 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | API_VERSION = "1.23.0" 6 | ALL_RESPONSE_DOC = { 7 | "api": API_VERSION, 8 | "min_sdk_version": "1.0.0a6", 9 | "min_endpoint_version": "1.0.0a0", 10 | "git_sha": "80b2ef87bc546b3b386cf2e1d372f4be50f10bc4", 11 | } 12 | 13 | RESPONSES = ResponseSet( 14 | metadata={"api_version": API_VERSION}, 15 | default=RegisteredResponse( 16 | service="compute", 17 | path="/v2/version", 18 | method="GET", 19 | json=API_VERSION, # type: ignore[arg-type] 20 | ), 21 | all=RegisteredResponse( 22 | service="compute", 23 | path="/v2/version", 24 | method="GET", 25 | json=ALL_RESPONSE_DOC, 26 | match=[query_param_matcher(params={"service": "all"})], 27 | ), 28 | ) 29 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/lock_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "lock_expiration_timestamp": "2021-07-01T00:00:00.000000", 8 | } 9 | 10 | RESPONSES = ResponseSet( 11 | metadata={"endpoint_id": ENDPOINT_ID}, 12 | default=RegisteredResponse( 13 | service="compute", 14 | path=f"/v2/endpoints/{ENDPOINT_ID}/lock", 15 | method="POST", 16 | json=DEFAULT_RESPONSE_DOC, 17 | ), 18 | ) 19 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/register_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "task_queue_info": { 8 | "connection_url": "amqps://user:password@mq.fqdn", 9 | "exchange": "some_exchange", 10 | "queue": "some_queue", 11 | }, 12 | "result_queue_info": { 13 | "connection_url": "amqps://user:password@mq.fqdn", 14 | "exchange": "some_exchange", 15 | "queue": "some_queue", 16 | "queue_publish_kwargs": {}, 17 | }, 18 | "warnings": [], 19 | } 20 | 21 | RESPONSES = ResponseSet( 22 | metadata={"endpoint_id": ENDPOINT_ID}, 23 | default=RegisteredResponse( 24 | service="compute", 25 | path="/v2/endpoints", 26 | method="POST", 27 | json=DEFAULT_RESPONSE_DOC, 28 | ), 29 | ) 30 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v2/register_function.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import FUNCTION_CODE, FUNCTION_ID, FUNCTION_NAME 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={ 7 | "function_id": FUNCTION_ID, 8 | "function_name": FUNCTION_NAME, 9 | "function_code": FUNCTION_CODE, 10 | }, 11 | default=RegisteredResponse( 12 | service="compute", 13 | path="/v2/functions", 14 | method="POST", 15 | json={"function_uuid": FUNCTION_ID}, 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/compute/v3/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/get_endpoint_allowlist.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID, FUNCTION_ID, FUNCTION_ID_2 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "restricted": True, 8 | "functions": [FUNCTION_ID, FUNCTION_ID_2], 9 | } 10 | 11 | RESPONSES = ResponseSet( 12 | metadata={"endpoint_id": ENDPOINT_ID}, 13 | default=RegisteredResponse( 14 | service="compute", 15 | path=f"/v3/endpoints/{ENDPOINT_ID}/allowed_functions", 16 | method="GET", 17 | json=DEFAULT_RESPONSE_DOC, 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/lock_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "lock_expiration_timestamp": "2021-07-01T00:00:00.000000", 8 | } 9 | 10 | RESPONSES = ResponseSet( 11 | metadata={"endpoint_id": ENDPOINT_ID}, 12 | default=RegisteredResponse( 13 | service="compute", 14 | path=f"/v3/endpoints/{ENDPOINT_ID}/lock", 15 | method="POST", 16 | json=DEFAULT_RESPONSE_DOC, 17 | ), 18 | ) 19 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/register_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "task_queue_info": { 8 | "connection_url": "amqps://user:password@mq.fqdn", 9 | "exchange": "some_exchange", 10 | "queue": "some_queue", 11 | }, 12 | "result_queue_info": { 13 | "connection_url": "amqps://user:password@mq.fqdn", 14 | "exchange": "some_exchange", 15 | "queue": "some_queue", 16 | "queue_publish_kwargs": {}, 17 | }, 18 | } 19 | 20 | RESPONSES = ResponseSet( 21 | default=RegisteredResponse( 22 | service="compute", 23 | path="/v3/endpoints", 24 | method="POST", 25 | json=DEFAULT_RESPONSE_DOC, 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/register_function.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import FUNCTION_CODE, FUNCTION_ID, FUNCTION_NAME 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "function_uuid": FUNCTION_ID, 7 | } 8 | 9 | RESPONSES = ResponseSet( 10 | metadata={ 11 | "function_id": FUNCTION_ID, 12 | "function_name": FUNCTION_NAME, 13 | "function_code": FUNCTION_CODE, 14 | }, 15 | default=RegisteredResponse( 16 | service="compute", 17 | path="/v3/functions", 18 | method="POST", 19 | json=DEFAULT_RESPONSE_DOC, 20 | ), 21 | ) 22 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/submit.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID, FUNCTION_ID, TASK_GROUP_ID, TASK_ID, TASK_ID_2 4 | 5 | REQUEST_ID = "5158de19-10b5-4deb-9d87-a86c1dec3460" 6 | 7 | SUBMIT_RESPONSE = { 8 | "request_id": REQUEST_ID, 9 | "task_group_id": TASK_GROUP_ID, 10 | "endpoint_id": ENDPOINT_ID, 11 | "tasks": { 12 | FUNCTION_ID: [TASK_ID, TASK_ID_2], 13 | }, 14 | } 15 | 16 | RESPONSES = ResponseSet( 17 | metadata={ 18 | "endpoint_id": ENDPOINT_ID, 19 | "function_id": FUNCTION_ID, 20 | "task_id": TASK_ID, 21 | "task_id_2": TASK_ID_2, 22 | "task_group_id": TASK_GROUP_ID, 23 | "request_id": REQUEST_ID, 24 | }, 25 | default=RegisteredResponse( 26 | service="compute", 27 | path=f"/v3/endpoints/{ENDPOINT_ID}/submit", 28 | method="POST", 29 | json=SUBMIT_RESPONSE, 30 | ), 31 | ) 32 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/compute/v3/update_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from .._common import ENDPOINT_ID 4 | 5 | DEFAULT_RESPONSE_DOC = { 6 | "endpoint_id": ENDPOINT_ID, 7 | "task_queue_info": { 8 | "connection_url": "amqps://user:password@mq.fqdn", 9 | "exchange": "some_exchange", 10 | "queue": "some_queue", 11 | }, 12 | "result_queue_info": { 13 | "connection_url": "amqps://user:password@mq.fqdn", 14 | "exchange": "some_exchange", 15 | "queue": "some_queue", 16 | "queue_publish_kwargs": {}, 17 | }, 18 | } 19 | 20 | RESPONSES = ResponseSet( 21 | metadata={"endpoint_id": ENDPOINT_ID}, 22 | default=RegisteredResponse( 23 | service="compute", 24 | path=f"/v3/endpoints/{ENDPOINT_ID}", 25 | method="PUT", 26 | json=DEFAULT_RESPONSE_DOC, 27 | ), 28 | ) 29 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/flows/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/cancel_run.py: -------------------------------------------------------------------------------- 1 | import copy 2 | 3 | from globus_sdk._testing import RegisteredResponse, ResponseSet 4 | 5 | from ._common import TWO_HOP_TRANSFER_RUN 6 | 7 | RUN_ID = TWO_HOP_TRANSFER_RUN["run_id"] 8 | SUCCESS_RESPONSE = copy.deepcopy(TWO_HOP_TRANSFER_RUN) 9 | SUCCESS_RESPONSE.update( 10 | { 11 | "status": "FAILED", 12 | "display_status": "FAILED", 13 | "details": { 14 | "time": "2023-06-12T23:04:42.121000+00:00", 15 | "code": "FlowCanceled", 16 | "description": "The Flow Instance was canceled by the user", 17 | "details": {}, 18 | }, 19 | } 20 | ) 21 | 22 | RESPONSES = ResponseSet( 23 | metadata={"run_id": RUN_ID}, 24 | default=RegisteredResponse( 25 | service="flows", 26 | method="POST", 27 | path=f"/runs/{RUN_ID}/cancel", 28 | json=SUCCESS_RESPONSE, 29 | ), 30 | ) 31 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/get_flow.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TWO_HOP_TRANSFER_FLOW_DOC, TWO_HOP_TRANSFER_FLOW_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={ 7 | "flow_id": TWO_HOP_TRANSFER_FLOW_ID, 8 | "title": TWO_HOP_TRANSFER_FLOW_DOC["title"], 9 | }, 10 | default=RegisteredResponse( 11 | service="flows", 12 | path=f"/flows/{TWO_HOP_TRANSFER_FLOW_ID}", 13 | json=TWO_HOP_TRANSFER_FLOW_DOC, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/get_run_definition.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing import RegisteredResponse, ResponseList, ResponseSet 4 | 5 | from ._common import RUN_ID 6 | 7 | GET_RUN_DEFINITION = { 8 | "flow_id": str(uuid.uuid4()), 9 | "definition": { 10 | "States": {"no-op": {"End": True, "Type": "Pass"}}, 11 | "StartAt": "no-op", 12 | }, 13 | "input_schema": {}, 14 | } 15 | 16 | 17 | RESPONSES = ResponseSet( 18 | metadata={"run_id": RUN_ID}, 19 | default=ResponseList( 20 | RegisteredResponse( 21 | service="flows", 22 | method="GET", 23 | path=f"/runs/{RUN_ID}/definition", 24 | json=GET_RUN_DEFINITION, 25 | ), 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/resume_run.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TWO_HOP_TRANSFER_RUN 4 | 5 | FLOW_ID = TWO_HOP_TRANSFER_RUN["flow_id"] 6 | RUN_ID = TWO_HOP_TRANSFER_RUN["run_id"] 7 | RESPONSES = ResponseSet( 8 | metadata={"run_id": RUN_ID, "flow_id": FLOW_ID}, 9 | default=RegisteredResponse( 10 | service="flows", 11 | method="POST", 12 | path=f"/runs/{RUN_ID}/resume", 13 | json=TWO_HOP_TRANSFER_RUN, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/flows/update_run.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TWO_HOP_TRANSFER_RUN 4 | 5 | FLOW_ID = TWO_HOP_TRANSFER_RUN["flow_id"] 6 | RUN_ID = TWO_HOP_TRANSFER_RUN["run_id"] 7 | RESPONSES = ResponseSet( 8 | metadata={"run_id": RUN_ID, "flow_id": FLOW_ID}, 9 | default=RegisteredResponse( 10 | service="flows", 11 | method="PUT", 12 | path=f"/runs/{RUN_ID}", 13 | json=TWO_HOP_TRANSFER_RUN, 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/globus_connect_server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/globus_connect_server/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/globus_connect_server/delete_user_credential.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | CREDENTIAL_ID = "af43d884-64a1-4414-897a-680c32374439" 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"id": CREDENTIAL_ID}, 7 | default=RegisteredResponse( 8 | service="gcs", 9 | path=f"/user_credentials/{CREDENTIAL_ID}", 10 | method="DELETE", 11 | json={ 12 | "DATA_TYPE": "result#1.0.0", 13 | "code": "success", 14 | "data": [], 15 | "detail": "success", 16 | "has_next_page": False, 17 | "http_response_code": 200, 18 | "message": f"Deleted User Credential {CREDENTIAL_ID}", 19 | }, 20 | ), 21 | ) 22 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/groups/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/create_group.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import BASE_GROUP_DOC, GROUP_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"group_id": GROUP_ID}, 7 | default=RegisteredResponse( 8 | service="groups", 9 | path="/groups", 10 | method="POST", 11 | json=BASE_GROUP_DOC, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/delete_group.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import BASE_GROUP_DOC, GROUP_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"group_id": GROUP_ID}, 7 | default=RegisteredResponse( 8 | service="groups", 9 | path=f"/groups/{GROUP_ID}", 10 | method="DELETE", 11 | json=BASE_GROUP_DOC, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/get_group.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import ( 4 | BASE_GROUP_DOC, 5 | GROUP_ID, 6 | SUBSCRIPTION_GROUP_DOC, 7 | SUBSCRIPTION_GROUP_ID, 8 | SUBSCRIPTION_ID, 9 | ) 10 | 11 | RESPONSES = ResponseSet( 12 | metadata={"group_id": GROUP_ID}, 13 | default=RegisteredResponse( 14 | service="groups", 15 | path=f"/groups/{GROUP_ID}", 16 | json=BASE_GROUP_DOC, 17 | ), 18 | subscription=RegisteredResponse( 19 | service="groups", 20 | path=f"/groups/{SUBSCRIPTION_GROUP_ID}", 21 | json=SUBSCRIPTION_GROUP_DOC, 22 | metadata={ 23 | "group_id": SUBSCRIPTION_GROUP_ID, 24 | "subscription_id": SUBSCRIPTION_ID, 25 | }, 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/get_group_by_subscription_id.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import SUBSCRIPTION_GROUP_ID, SUBSCRIPTION_ID, SUBSCRIPTION_INFO 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"group_id": SUBSCRIPTION_GROUP_ID, "subscription_id": SUBSCRIPTION_ID}, 7 | default=RegisteredResponse( 8 | service="groups", 9 | path=f"/subscription_info/{SUBSCRIPTION_ID}", 10 | json={ 11 | "group_id": SUBSCRIPTION_GROUP_ID, 12 | "subscription_id": SUBSCRIPTION_ID, 13 | # this API returns restricted subscription_info 14 | "subscription_info": { 15 | k: v 16 | for k, v in SUBSCRIPTION_INFO.items() 17 | if k in ("is_high_assurance", "is_baa", "connectors") 18 | }, 19 | }, 20 | ), 21 | ) 22 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/groups/set_group_policies.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import GROUP_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"group_id": GROUP_ID}, 7 | default=RegisteredResponse( 8 | service="groups", 9 | path=f"/groups/{GROUP_ID}/policies", 10 | method="PUT", 11 | json={ 12 | "is_high_assurance": False, 13 | "authentication_assurance_timeout": 28800, 14 | "group_visibility": "private", 15 | "group_members_visibility": "managers", 16 | "join_requests": False, 17 | "signup_fields": ["address1"], 18 | }, 19 | ), 20 | ) 21 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/search/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/search/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/search/batch_delete_by_subject.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 4 | 5 | INDEX_ID = str(uuid.uuid1()) 6 | TASK_ID = str(uuid.uuid1()) 7 | 8 | 9 | RESPONSES = ResponseSet( 10 | metadata={"index_id": INDEX_ID, "task_id": TASK_ID}, 11 | default=RegisteredResponse( 12 | service="search", 13 | path=f"/v1/index/{INDEX_ID}/batch_delete_by_subject", 14 | method="POST", 15 | json={"task_id": TASK_ID}, 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/search/delete_role.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | INDEX_ID = "60d1160b-f016-40b0-8545-99619865873d" 4 | IDENTITY_ID = "46bd0f56-e24f-11e5-a510-131bef46955c" 5 | ROLE_ID = "MDMwMjM5" 6 | 7 | 8 | RESPONSES = ResponseSet( 9 | metadata={"index_id": INDEX_ID, "identity_id": IDENTITY_ID, "role_id": ROLE_ID}, 10 | default=RegisteredResponse( 11 | service="search", 12 | path=f"/v1/index/{INDEX_ID}/role/{ROLE_ID}", 13 | method="DELETE", 14 | json={ 15 | "deleted": { 16 | "creation_date": "2022-01-26 21:53:06", 17 | "id": ROLE_ID, 18 | "index_id": INDEX_ID, 19 | "principal": f"urn:globus:auth:identity:{IDENTITY_ID}", 20 | "principal_type": "identity", 21 | "role_name": "writer", 22 | }, 23 | "success": True, 24 | }, 25 | ), 26 | ) 27 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/timer/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/create_timer.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import DEST_EP_ID, SOURCE_EP_ID, TIMER_ID, V2_TRANSFER_TIMER 4 | 5 | RESPONSES = ResponseSet( 6 | default=RegisteredResponse( 7 | service="timer", 8 | path="/v2/timer", 9 | method="POST", 10 | json={ 11 | "timer": V2_TRANSFER_TIMER, 12 | }, 13 | status=201, 14 | metadata={ 15 | "timer_id": TIMER_ID, 16 | "source_endpoint": SOURCE_EP_ID, 17 | "destination_endpoint": DEST_EP_ID, 18 | }, 19 | ), 20 | ) 21 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/delete_job.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TIMER_ID, V1_TIMER 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"job_id": TIMER_ID}, 7 | default=RegisteredResponse( 8 | service="timer", 9 | path=f"/jobs/{TIMER_ID}", 10 | method="DELETE", 11 | json=V1_TIMER, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/list_jobs.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TIMER_ID, V1_TIMER 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"job_ids": [TIMER_ID]}, 7 | default=RegisteredResponse( 8 | service="timer", 9 | path="/jobs/", 10 | method="GET", 11 | json={"jobs": [V1_TIMER]}, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/pause_job.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TIMER_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"job_id": TIMER_ID}, 7 | default=RegisteredResponse( 8 | service="timer", 9 | path=f"/jobs/{TIMER_ID}/pause", 10 | method="POST", 11 | json={"message": f"Successfully paused job {TIMER_ID}."}, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/resume_job.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TIMER_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"job_id": TIMER_ID}, 7 | default=RegisteredResponse( 8 | service="timer", 9 | path=f"/jobs/{TIMER_ID}/resume", 10 | method="POST", 11 | json={"message": f"Successfully resumed job {TIMER_ID}."}, 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/timer/update_job.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TIMER_ID, V1_TIMER 4 | 5 | UPDATED_NAME = "updated name" 6 | UPDATED_TIMER = dict(V1_TIMER) 7 | UPDATED_TIMER["name"] = UPDATED_NAME # mypy complains if this is onelinerized 8 | 9 | RESPONSES = ResponseSet( 10 | metadata={"job_id": TIMER_ID, "name": UPDATED_NAME}, 11 | default=RegisteredResponse( 12 | service="timer", 13 | path=f"/jobs/{TIMER_ID}", 14 | method="PATCH", 15 | json=UPDATED_TIMER, 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/_testing/data/transfer/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/_common.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | 4 | def _as_uuid(s: str) -> str: 5 | return str(uuid.UUID(int=int(s, 36))) 6 | 7 | 8 | SUBMISSION_ID = _as_uuid("submission_id") 9 | ENDPOINT_ID = _as_uuid("endpoint_id") 10 | TASK_ID = _as_uuid("task_id") 11 | SUBSCRIPTION_ID = _as_uuid("subscription_id") 12 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/create_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import ENDPOINT_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"endpoint_id": ENDPOINT_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | method="POST", 10 | path="/endpoint", 11 | json={ 12 | "DATA_TYPE": "endpoint_create_result", 13 | "display_name": "my cool endpoint", 14 | "code": "Created", 15 | "globus_connect_setup_key": None, 16 | "id": ENDPOINT_ID, 17 | "message": "Endpoint created successfully", 18 | "request_id": "d4MqMwFJ9", 19 | "resource": "/endpoint", 20 | }, 21 | ), 22 | ) 23 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/endpoint_manager_task_successful_transfers.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import TASK_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"task_id": TASK_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | method="GET", 10 | path=f"/endpoint_manager/task/{TASK_ID}/successful_transfers", 11 | json={ 12 | "DATA_TYPE": "successful_transfers", 13 | "marker": 0, 14 | "next_marker": 93979, 15 | "DATA": [ 16 | { 17 | "destination_path": "/path/to/destination", 18 | "source_path": "/path/to/source", 19 | "DATA_TYPE": "successful_transfer", 20 | } 21 | ], 22 | }, 23 | ), 24 | ) 25 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/get_submission_id.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import SUBMISSION_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"submission_id": SUBMISSION_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | path="/submission_id", 10 | json={"value": SUBMISSION_ID}, 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/operation_mkdir.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import ENDPOINT_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"endpoint_id": ENDPOINT_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | method="POST", 10 | path=f"/operation/endpoint/{ENDPOINT_ID}/mkdir", 11 | json={ 12 | "DATA_TYPE": "mkdir_result", 13 | "code": "DirectoryCreated", 14 | "message": "The directory was created successfully", 15 | "request_id": "ShbIUzrWT", 16 | "resource": f"/operation/endpoint/{ENDPOINT_ID}/mkdir", 17 | }, 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/operation_rename.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import ENDPOINT_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"endpoint_id": ENDPOINT_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | method="POST", 10 | path=f"/operation/endpoint/{ENDPOINT_ID}/rename", 11 | json={ 12 | "DATA_TYPE": "result", 13 | "code": "FileRenamed", 14 | "message": "File or directory renamed successfully", 15 | "request_id": "ShbIUzrWT", 16 | "resource": f"/operation/endpoint/{ENDPOINT_ID}/rename", 17 | }, 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/_testing/data/transfer/update_endpoint.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing.models import RegisteredResponse, ResponseSet 2 | 3 | from ._common import ENDPOINT_ID 4 | 5 | RESPONSES = ResponseSet( 6 | metadata={"endpoint_id": ENDPOINT_ID}, 7 | default=RegisteredResponse( 8 | service="transfer", 9 | method="PUT", 10 | path=f"/endpoint/{ENDPOINT_ID}", 11 | json={ 12 | "DATA_TYPE": "result", 13 | "code": "Updated", 14 | "message": "Endpoint updated successfully", 15 | "request_id": "6aZjzldyM", 16 | "resource": f"/endpoint/{ENDPOINT_ID}", 17 | }, 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/_types.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import datetime 4 | import typing as t 5 | import uuid 6 | 7 | if t.TYPE_CHECKING: 8 | from globus_sdk.scopes import MutableScope, Scope 9 | 10 | 11 | # these types are aliases meant for internal use 12 | IntLike = t.Union[int, str] 13 | UUIDLike = t.Union[uuid.UUID, str] 14 | DateLike = t.Union[str, datetime.datetime] 15 | 16 | ScopeCollectionType = t.Union[ 17 | str, 18 | "MutableScope", 19 | "Scope", 20 | t.Iterable["ScopeCollectionType"], 21 | ] 22 | 23 | 24 | class ResponseLike(t.Protocol): 25 | @property 26 | def http_status(self) -> int: ... 27 | 28 | @property 29 | def http_reason(self) -> str: ... 30 | 31 | @property 32 | def headers(self) -> t.Mapping[str, str]: ... 33 | 34 | @property 35 | def content_type(self) -> str | None: ... 36 | 37 | @property 38 | def text(self) -> str: ... 39 | 40 | @property 41 | def binary_content(self) -> bytes: ... 42 | -------------------------------------------------------------------------------- /src/globus_sdk/authorizers/__init__.py: -------------------------------------------------------------------------------- 1 | from .access_token import AccessTokenAuthorizer 2 | from .base import GlobusAuthorizer, NullAuthorizer, StaticGlobusAuthorizer 3 | from .basic import BasicAuthorizer 4 | from .client_credentials import ClientCredentialsAuthorizer 5 | from .refresh_token import RefreshTokenAuthorizer 6 | from .renewing import RenewingAuthorizer 7 | 8 | __all__ = [ 9 | "GlobusAuthorizer", 10 | "NullAuthorizer", 11 | "StaticGlobusAuthorizer", 12 | "BasicAuthorizer", 13 | "AccessTokenAuthorizer", 14 | "RefreshTokenAuthorizer", 15 | "ClientCredentialsAuthorizer", 16 | "RenewingAuthorizer", 17 | ] 18 | -------------------------------------------------------------------------------- /src/globus_sdk/config/__init__.py: -------------------------------------------------------------------------------- 1 | from .env_vars import get_environment_name, get_http_timeout, get_ssl_verify 2 | from .environments import EnvConfig, get_service_url, get_webapp_url 3 | 4 | __all__ = ( 5 | "EnvConfig", 6 | "get_environment_name", 7 | "get_ssl_verify", 8 | "get_http_timeout", 9 | "get_service_url", 10 | "get_webapp_url", 11 | ) 12 | -------------------------------------------------------------------------------- /src/globus_sdk/exc/base.py: -------------------------------------------------------------------------------- 1 | class GlobusError(Exception): 2 | """ 3 | Root of the Globus Exception hierarchy. 4 | """ 5 | 6 | 7 | class GlobusSDKUsageError(GlobusError, ValueError): 8 | """ 9 | A ``GlobusSDKUsageError`` may be thrown in cases in which the SDK 10 | detects that it is being used improperly. 11 | 12 | These errors typically indicate that some contract regarding SDK usage 13 | (e.g. required order of operations) has been violated. 14 | """ 15 | 16 | 17 | class ValidationError(GlobusError, ValueError): 18 | """ 19 | A ``ValidationError`` may be raised when the SDK is instructed to handle or 20 | parse data which can be seen to be invalid without an external service 21 | interaction. 22 | 23 | These errors typically do not indicate a usage error similar to 24 | ``GlobusSDKUsageError``, but rather that the data is invalid. 25 | """ 26 | -------------------------------------------------------------------------------- /src/globus_sdk/exc/warnings.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import warnings 4 | 5 | 6 | class RemovedInV4Warning(DeprecationWarning): 7 | """ 8 | This warning indicates that a feature or usage was detected which will be 9 | unsupported in globus-sdk version 4. 10 | 11 | Users are encouraged to resolve these warnings when possible. 12 | """ 13 | 14 | 15 | def warn_deprecated(message: str, stacklevel: int = 2) -> None: 16 | warnings.warn(message, RemovedInV4Warning, stacklevel=stacklevel) 17 | -------------------------------------------------------------------------------- /src/globus_sdk/experimental/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/experimental/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/gare/__init__.py: -------------------------------------------------------------------------------- 1 | from ._auth_requirements_error import GARE, GlobusAuthorizationParameters 2 | from ._functional_api import has_gares, is_gare, to_gare, to_gares 3 | 4 | __all__ = ( 5 | "GARE", 6 | "GlobusAuthorizationParameters", 7 | "to_gare", 8 | "to_gares", 9 | "is_gare", 10 | "has_gares", 11 | ) 12 | -------------------------------------------------------------------------------- /src/globus_sdk/globus_app/__init__.py: -------------------------------------------------------------------------------- 1 | from .app import GlobusApp 2 | from .client_app import ClientApp 3 | from .config import GlobusAppConfig 4 | from .protocols import ( 5 | IDTokenDecoderProvider, 6 | LoginFlowManagerProvider, 7 | TokenStorageProvider, 8 | TokenValidationErrorHandler, 9 | ) 10 | from .user_app import UserApp 11 | 12 | __all__ = ( 13 | "GlobusApp", 14 | "UserApp", 15 | "ClientApp", 16 | "GlobusAppConfig", 17 | # Protocols 18 | "IDTokenDecoderProvider", 19 | "TokenValidationErrorHandler", 20 | "TokenStorageProvider", 21 | "LoginFlowManagerProvider", 22 | ) 23 | -------------------------------------------------------------------------------- /src/globus_sdk/local_endpoint/__init__.py: -------------------------------------------------------------------------------- 1 | from .personal import GlobusConnectPersonalOwnerInfo, LocalGlobusConnectPersonal 2 | from .server import LocalGlobusConnectServer 3 | 4 | __all__ = ( 5 | "GlobusConnectPersonalOwnerInfo", 6 | "LocalGlobusConnectPersonal", 7 | "LocalGlobusConnectServer", 8 | ) 9 | -------------------------------------------------------------------------------- /src/globus_sdk/local_endpoint/personal/__init__.py: -------------------------------------------------------------------------------- 1 | from .endpoint import LocalGlobusConnectPersonal 2 | from .owner_info import GlobusConnectPersonalOwnerInfo 3 | 4 | __all__ = ( 5 | "LocalGlobusConnectPersonal", 6 | "GlobusConnectPersonalOwnerInfo", 7 | ) 8 | -------------------------------------------------------------------------------- /src/globus_sdk/local_endpoint/server/__init__.py: -------------------------------------------------------------------------------- 1 | from .endpoint import LocalGlobusConnectServer 2 | 3 | __all__ = ("LocalGlobusConnectServer",) 4 | -------------------------------------------------------------------------------- /src/globus_sdk/login_flows/__init__.py: -------------------------------------------------------------------------------- 1 | from .command_line_login_flow_manager import ( 2 | CommandLineLoginFlowEOFError, 3 | CommandLineLoginFlowManager, 4 | ) 5 | from .local_server_login_flow_manager import ( 6 | LocalServerEnvironmentalLoginError, 7 | LocalServerLoginError, 8 | LocalServerLoginFlowManager, 9 | ) 10 | from .login_flow_manager import LoginFlowManager 11 | 12 | __all__ = ( 13 | "CommandLineLoginFlowManager", 14 | "CommandLineLoginFlowEOFError", 15 | "LocalServerLoginError", 16 | "LocalServerEnvironmentalLoginError", 17 | "LocalServerLoginFlowManager", 18 | "LoginFlowManager", 19 | ) 20 | -------------------------------------------------------------------------------- /src/globus_sdk/login_flows/local_server_login_flow_manager/__init__.py: -------------------------------------------------------------------------------- 1 | from .errors import LocalServerEnvironmentalLoginError, LocalServerLoginError 2 | from .local_server_login_flow_manager import LocalServerLoginFlowManager 3 | 4 | __all__ = [ 5 | "LocalServerLoginError", 6 | "LocalServerEnvironmentalLoginError", 7 | "LocalServerLoginFlowManager", 8 | ] 9 | -------------------------------------------------------------------------------- /src/globus_sdk/login_flows/local_server_login_flow_manager/errors.py: -------------------------------------------------------------------------------- 1 | class LocalServerLoginError(Exception): 2 | """An error raised during a LocalServerLoginFlowManager's run.""" 3 | 4 | 5 | class LocalServerEnvironmentalLoginError(LocalServerLoginError): 6 | """ 7 | Error raised when a local server login flow fails to start due to incompatible 8 | environment conditions (e.g., a remote session or text-only browser). 9 | """ 10 | -------------------------------------------------------------------------------- /src/globus_sdk/login_flows/local_server_login_flow_manager/html_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/login_flows/local_server_login_flow_manager/html_files/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/paging/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import Paginator, has_paginator 2 | from .last_key import LastKeyPaginator 3 | from .limit_offset import HasNextPaginator, LimitOffsetTotalPaginator 4 | from .marker import MarkerPaginator, NullableMarkerPaginator 5 | from .next_token import NextTokenPaginator 6 | from .table import PaginatorTable 7 | 8 | __all__ = ( 9 | "Paginator", 10 | "PaginatorTable", 11 | "has_paginator", 12 | "MarkerPaginator", 13 | "NullableMarkerPaginator", 14 | "NextTokenPaginator", 15 | "LastKeyPaginator", 16 | "HasNextPaginator", 17 | "LimitOffsetTotalPaginator", 18 | ) 19 | -------------------------------------------------------------------------------- /src/globus_sdk/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/py.typed -------------------------------------------------------------------------------- /src/globus_sdk/scopes/consents/__init__.py: -------------------------------------------------------------------------------- 1 | from ._errors import ConsentParseError, ConsentTreeConstructionError 2 | from ._model import Consent, ConsentForest, ConsentTree 3 | 4 | __all__ = ( 5 | "Consent", 6 | "ConsentTree", 7 | "ConsentForest", 8 | "ConsentParseError", 9 | "ConsentTreeConstructionError", 10 | ) 11 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/consents/_errors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing as t 4 | 5 | if t.TYPE_CHECKING: 6 | from ._model import Consent 7 | 8 | 9 | class ConsentParseError(Exception): 10 | """An error raised if consent parsing/loading fails.""" 11 | 12 | def __init__(self, message: str, raw_consent: dict[str, t.Any]) -> None: 13 | super().__init__(message) 14 | self.raw_consent = raw_consent 15 | 16 | 17 | class ConsentTreeConstructionError(Exception): 18 | """An error raised if consent tree construction fails.""" 19 | 20 | def __init__(self, message: str, consents: list[Consent]) -> None: 21 | super().__init__(message) 22 | self.consents = consents 23 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/__init__.py: -------------------------------------------------------------------------------- 1 | from .auth import AuthScopes 2 | from .compute import ComputeScopes 3 | from .flows import FlowsScopes, SpecificFlowScopeBuilder 4 | from .gcs import GCSCollectionScopeBuilder, GCSEndpointScopeBuilder 5 | from .groups import GroupsScopes, NexusScopes 6 | from .search import SearchScopes 7 | from .timers import TimersScopes 8 | from .transfer import TransferScopes 9 | 10 | __all__ = ( 11 | "AuthScopes", 12 | "ComputeScopes", 13 | "FlowsScopes", 14 | "SpecificFlowScopeBuilder", 15 | "GCSEndpointScopeBuilder", 16 | "GCSCollectionScopeBuilder", 17 | "GroupsScopes", 18 | "NexusScopes", 19 | "SearchScopes", 20 | "TimersScopes", 21 | "TransferScopes", 22 | ) 23 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/auth.py: -------------------------------------------------------------------------------- 1 | from ..builder import ScopeBuilder 2 | 3 | 4 | class _AuthScopesBuilder(ScopeBuilder): 5 | _classattr_scope_names = ["openid", "email", "profile"] 6 | 7 | openid: str = "openid" 8 | email: str = "email" 9 | profile: str = "profile" 10 | 11 | 12 | AuthScopes = _AuthScopesBuilder( 13 | "auth.globus.org", 14 | known_scopes=[ 15 | "manage_projects", 16 | "view_authentications", 17 | "view_clients", 18 | "view_clients_and_scopes", 19 | "view_consents", 20 | "view_identities", 21 | "view_identity_set", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/groups.py: -------------------------------------------------------------------------------- 1 | from ..builder import ScopeBuilder 2 | 3 | GroupsScopes = ScopeBuilder( 4 | "groups.api.globus.org", 5 | known_scopes=[ 6 | "all", 7 | "view_my_groups_and_memberships", 8 | ], 9 | ) 10 | 11 | 12 | NexusScopes = ScopeBuilder( 13 | "nexus.api.globus.org", 14 | known_scopes=[ 15 | "groups", 16 | ], 17 | ) 18 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/search.py: -------------------------------------------------------------------------------- 1 | from ..builder import ScopeBuilder 2 | 3 | SearchScopes = ScopeBuilder( 4 | "search.api.globus.org", 5 | known_scopes=[ 6 | "all", 7 | "globus_connect_server", 8 | "ingest", 9 | "search", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/timers.py: -------------------------------------------------------------------------------- 1 | from ..builder import ScopeBuilder 2 | 3 | TimersScopes = ScopeBuilder( 4 | "524230d7-ea86-4a52-8312-86065a9e0417", 5 | known_url_scopes=[ 6 | "timer", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/data/transfer.py: -------------------------------------------------------------------------------- 1 | from ..builder import ScopeBuilder 2 | 3 | TransferScopes = ScopeBuilder( 4 | "transfer.api.globus.org", 5 | known_scopes=[ 6 | "all", 7 | "gcp_install", 8 | ], 9 | ) 10 | -------------------------------------------------------------------------------- /src/globus_sdk/scopes/errors.py: -------------------------------------------------------------------------------- 1 | class ScopeParseError(ValueError): 2 | """The error raised if scope parsing fails.""" 3 | 4 | 5 | class ScopeCycleError(ScopeParseError): 6 | """The error raised if scope parsing discovers a cycle.""" 7 | -------------------------------------------------------------------------------- /src/globus_sdk/services/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/src/globus_sdk/services/__init__.py -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/client/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_login_client import AuthLoginClient 2 | from .confidential_client import ConfidentialAppAuthClient 3 | from .native_client import NativeAppAuthClient 4 | from .service_client import AuthClient 5 | 6 | __all__ = ( 7 | "AuthClient", 8 | "AuthLoginClient", 9 | "NativeAppAuthClient", 10 | "ConfidentialAppAuthClient", 11 | ) 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/flow_managers/__init__.py: -------------------------------------------------------------------------------- 1 | from .authorization_code import GlobusAuthorizationCodeFlowManager 2 | from .base import GlobusOAuthFlowManager 3 | from .native_app import GlobusNativeAppFlowManager 4 | 5 | __all__ = ( 6 | "GlobusAuthorizationCodeFlowManager", 7 | "GlobusOAuthFlowManager", 8 | "GlobusNativeAppFlowManager", 9 | ) 10 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/clients.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetClientsResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Clients API 7 | 8 | Provides iteration on the "clients" array in the response. 9 | """ 10 | 11 | default_iter_key = "clients" 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/consents.py: -------------------------------------------------------------------------------- 1 | from globus_sdk import IterableResponse 2 | from globus_sdk.scopes.consents import ConsentForest 3 | 4 | 5 | class GetConsentsResponse(IterableResponse): 6 | """ 7 | Response class specific to the Get Consents API 8 | 9 | Provides iteration on the "consents" array in the response. 10 | """ 11 | 12 | default_iter_key = "consents" 13 | 14 | def to_forest(self) -> ConsentForest: 15 | """ 16 | Creates a ConsentForest from the consents in this response. 17 | 18 | ConsentForest is a convenience class to make interacting with the 19 | tree of consents simpler. 20 | """ 21 | return ConsentForest(self) 22 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/credentials.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetClientCredentialsResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Credentials API 7 | 8 | Provides iteration on the "credentials" array in the response. 9 | """ 10 | 11 | default_iter_key = "credentials" 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/identities.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetIdentitiesResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Identities API 7 | 8 | Provides iteration on the "identities" array in the response. 9 | """ 10 | 11 | default_iter_key = "identities" 12 | 13 | 14 | class GetIdentityProvidersResponse(IterableResponse): 15 | """ 16 | Response class specific to the Get Identity Providers API 17 | 18 | Provides iteration on the "identity_providers" array in the response. 19 | """ 20 | 21 | default_iter_key = "identity_providers" 22 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/policies.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetPoliciesResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Policies API 7 | 8 | Provides iteration on the "policies" array in the response. 9 | """ 10 | 11 | default_iter_key = "policies" 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/projects.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetProjectsResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Projects API 7 | 8 | Provides iteration on the "projects" array in the response. 9 | """ 10 | 11 | default_iter_key = "projects" 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/auth/response/scopes.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class GetScopesResponse(IterableResponse): 5 | """ 6 | Response class specific to the Get Scopes API 7 | 8 | Provides iteration on the "scopes" array in the response. 9 | """ 10 | 11 | default_iter_key = "scopes" 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/compute/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import ComputeClient, ComputeClientV2, ComputeClientV3 2 | from .data import ComputeFunctionDocument, ComputeFunctionMetadata 3 | from .errors import ComputeAPIError 4 | 5 | __all__ = ( 6 | "ComputeAPIError", 7 | "ComputeClient", 8 | "ComputeClientV2", 9 | "ComputeClientV3", 10 | "ComputeFunctionDocument", 11 | "ComputeFunctionMetadata", 12 | ) 13 | -------------------------------------------------------------------------------- /src/globus_sdk/services/compute/errors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from globus_sdk.exc import GlobusAPIError 4 | 5 | 6 | class ComputeAPIError(GlobusAPIError): 7 | pass 8 | -------------------------------------------------------------------------------- /src/globus_sdk/services/flows/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import FlowsClient, SpecificFlowClient 2 | from .data import RunActivityNotificationPolicy 3 | from .errors import FlowsAPIError 4 | from .response import IterableFlowsResponse 5 | 6 | __all__ = ( 7 | "FlowsAPIError", 8 | "FlowsClient", 9 | "IterableFlowsResponse", 10 | "SpecificFlowClient", 11 | "RunActivityNotificationPolicy", 12 | ) 13 | -------------------------------------------------------------------------------- /src/globus_sdk/services/flows/data.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import logging 4 | import typing as t 5 | 6 | from globus_sdk.utils import MISSING, MissingType, PayloadWrapper 7 | 8 | log = logging.getLogger(__name__) 9 | 10 | 11 | class RunActivityNotificationPolicy(PayloadWrapper): 12 | """ 13 | A notification policy for a run, determining when emails will be sent. 14 | 15 | :param status: A list of statuses which will trigger notifications. When 16 | the run's status changes, it is evaluated against this list. If the new 17 | status matches the policy, an email is sent. 18 | """ 19 | 20 | def __init__( 21 | self, 22 | status: ( 23 | list[t.Literal["INACTIVE", "SUCCEEDED", "FAILED"]] | MissingType 24 | ) = MISSING, 25 | ) -> None: 26 | super().__init__() 27 | self["status"] = status 28 | -------------------------------------------------------------------------------- /src/globus_sdk/services/flows/response.py: -------------------------------------------------------------------------------- 1 | from globus_sdk import response 2 | 3 | 4 | class IterableFlowsResponse(response.IterableResponse): 5 | """ 6 | An iterable response containing a "flows" array. 7 | """ 8 | 9 | default_iter_key = "flows" 10 | 11 | 12 | class IterableRunsResponse(response.IterableResponse): 13 | """ 14 | An iterable response containing a "runs" array. 15 | """ 16 | 17 | default_iter_key = "runs" 18 | 19 | 20 | class IterableRunLogsResponse(response.IterableResponse): 21 | """ 22 | An iterable response containing an "entries" array. 23 | """ 24 | 25 | default_iter_key = "entries" 26 | -------------------------------------------------------------------------------- /src/globus_sdk/services/groups/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import GroupsClient 2 | from .data import ( 3 | BatchMembershipActions, 4 | GroupMemberVisibility, 5 | GroupPolicies, 6 | GroupRequiredSignupFields, 7 | GroupRole, 8 | GroupVisibility, 9 | ) 10 | from .errors import GroupsAPIError 11 | from .manager import GroupsManager 12 | 13 | __all__ = ( 14 | "GroupsClient", 15 | "GroupsAPIError", 16 | "GroupsManager", 17 | "BatchMembershipActions", 18 | "GroupMemberVisibility", 19 | "GroupRequiredSignupFields", 20 | "GroupRole", 21 | "GroupVisibility", 22 | "GroupPolicies", 23 | ) 24 | -------------------------------------------------------------------------------- /src/globus_sdk/services/groups/errors.py: -------------------------------------------------------------------------------- 1 | from globus_sdk import exc 2 | 3 | 4 | class GroupsAPIError(exc.GlobusAPIError): 5 | """Error class for the Globus Groups Service.""" 6 | -------------------------------------------------------------------------------- /src/globus_sdk/services/search/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import SearchClient 2 | from .data import SearchQuery, SearchQueryV1, SearchScrollQuery 3 | from .errors import SearchAPIError 4 | 5 | __all__ = ( 6 | "SearchClient", 7 | "SearchQuery", 8 | "SearchQueryV1", 9 | "SearchScrollQuery", 10 | "SearchAPIError", 11 | ) 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/search/errors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing as t 4 | 5 | import requests 6 | 7 | from globus_sdk import exc 8 | 9 | 10 | class SearchAPIError(exc.GlobusAPIError): 11 | """ 12 | Error class for the Search API client. In addition to the 13 | inherited instance variables, provides ``error_data``. 14 | 15 | :ivar error_data: Additional object returned in the error response. May be 16 | a dict, list, or None. 17 | """ 18 | 19 | def __init__(self, r: requests.Response) -> None: 20 | self.error_data: dict[str, t.Any] | None = None 21 | super().__init__(r) 22 | 23 | def _post_parse_hook(self) -> bool: 24 | self.error_data = self._dict_data.get("error_data") 25 | return True 26 | -------------------------------------------------------------------------------- /src/globus_sdk/services/search/response.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class IndexListResponse(IterableResponse): 5 | """ 6 | Iterable response class for /v1/index_list 7 | """ 8 | 9 | default_iter_key = "index_list" 10 | -------------------------------------------------------------------------------- /src/globus_sdk/services/timers/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import TimersClient 2 | from .data import OnceTimerSchedule, RecurringTimerSchedule, TimerJob, TransferTimer 3 | from .errors import TimersAPIError 4 | 5 | __all__ = ( 6 | "TimersAPIError", 7 | "TimersClient", 8 | "OnceTimerSchedule", 9 | "RecurringTimerSchedule", 10 | "TimerJob", 11 | "TransferTimer", 12 | ) 13 | -------------------------------------------------------------------------------- /src/globus_sdk/services/transfer/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import TransferClient 2 | from .data import DeleteData, TransferData 3 | from .errors import TransferAPIError 4 | from .response import ActivationRequirementsResponse, IterableTransferResponse 5 | 6 | __all__ = ( 7 | "TransferClient", 8 | "TransferData", 9 | "DeleteData", 10 | "TransferAPIError", 11 | "ActivationRequirementsResponse", 12 | "IterableTransferResponse", 13 | ) 14 | -------------------------------------------------------------------------------- /src/globus_sdk/services/transfer/data/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Data helper classes for constructing Transfer API documents. All classes should 3 | be PayloadWrapper types, so they can be passed seamlessly to 4 | :class:`TransferClient ` methods without 5 | conversion. 6 | """ 7 | 8 | from .delete_data import DeleteData 9 | from .transfer_data import TransferData 10 | 11 | __all__ = ("TransferData", "DeleteData") 12 | -------------------------------------------------------------------------------- /src/globus_sdk/services/transfer/errors.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from globus_sdk import exc 4 | 5 | 6 | class TransferAPIError(exc.GlobusAPIError): 7 | """ 8 | Error class for the Transfer API client. 9 | """ 10 | -------------------------------------------------------------------------------- /src/globus_sdk/services/transfer/response/__init__.py: -------------------------------------------------------------------------------- 1 | from .activation import ActivationRequirementsResponse 2 | from .iterable import IterableTransferResponse 3 | 4 | __all__ = ("IterableTransferResponse", "ActivationRequirementsResponse") 5 | -------------------------------------------------------------------------------- /src/globus_sdk/services/transfer/response/iterable.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.response import IterableResponse 2 | 3 | 4 | class IterableTransferResponse(IterableResponse): 5 | """ 6 | Response class for non-paged list oriented resources. Allows top level 7 | fields to be accessed normally via standard item access, and also 8 | provides a convenient way to iterate over the sub-item list in a specified 9 | key: 10 | 11 | >>> print("Path:", r["path"]) 12 | >>> # Equivalent to: for item in r["DATA"] 13 | >>> for item in r: 14 | >>> print(item["name"], item["type"]) 15 | """ 16 | 17 | default_iter_key = "DATA" 18 | -------------------------------------------------------------------------------- /src/globus_sdk/tokenstorage/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import FileAdapter, StorageAdapter 2 | from .file_adapters import SimpleJSONFileAdapter 3 | from .memory_adapter import MemoryAdapter 4 | from .sqlite_adapter import SQLiteAdapter 5 | 6 | __all__ = ( 7 | "StorageAdapter", 8 | "FileAdapter", 9 | "SimpleJSONFileAdapter", 10 | "SQLiteAdapter", 11 | "MemoryAdapter", 12 | ) 13 | -------------------------------------------------------------------------------- /src/globus_sdk/tokenstorage/v1/memory_adapter.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing as t 4 | 5 | import globus_sdk 6 | 7 | from .base import StorageAdapter 8 | 9 | 10 | class MemoryAdapter(StorageAdapter): 11 | """ 12 | A token storage adapter which stores tokens in process memory. 13 | 14 | Tokens are lost when the process exits. 15 | """ 16 | 17 | def __init__(self) -> None: 18 | self._tokens: dict[str, dict[str, t.Any]] = {} 19 | 20 | def store(self, token_response: globus_sdk.OAuthTokenResponse) -> None: 21 | self._tokens.update(token_response.by_resource_server) 22 | 23 | def get_token_data(self, resource_server: str) -> dict[str, t.Any] | None: 24 | return self._tokens.get(resource_server) 25 | -------------------------------------------------------------------------------- /src/globus_sdk/tokenstorage/v2/validating_token_storage/context.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import dataclasses 4 | 5 | 6 | @dataclasses.dataclass 7 | class TokenValidationContext: 8 | """ 9 | A data object of information available to 10 | :class:`TokenDataValidators ` during validation. 11 | 12 | :ivar str | None prior_identity_id: The identity ID associated with the 13 | :class:`ValidatingTokenStorage` before the operation began, if there was one. 14 | :ivar str | None token_data_identity_id: The identity ID extracted from the token 15 | data being validated. 16 | """ 17 | 18 | prior_identity_id: str | None 19 | token_data_identity_id: str | None 20 | -------------------------------------------------------------------------------- /src/globus_sdk/transport/__init__.py: -------------------------------------------------------------------------------- 1 | from ._clientinfo import GlobusClientInfo 2 | from .encoders import FormRequestEncoder, JSONRequestEncoder, RequestEncoder 3 | from .requests import RequestsTransport 4 | from .retry import ( 5 | RetryCheck, 6 | RetryCheckFlags, 7 | RetryCheckResult, 8 | RetryCheckRunner, 9 | RetryContext, 10 | set_retry_check_flags, 11 | ) 12 | 13 | __all__ = ( 14 | "RequestsTransport", 15 | "RetryCheck", 16 | "RetryCheckFlags", 17 | "RetryCheckResult", 18 | "RetryCheckRunner", 19 | "set_retry_check_flags", 20 | "RetryContext", 21 | "RequestEncoder", 22 | "JSONRequestEncoder", 23 | "FormRequestEncoder", 24 | "GlobusClientInfo", 25 | ) 26 | -------------------------------------------------------------------------------- /src/globus_sdk/version.py: -------------------------------------------------------------------------------- 1 | # single source of truth for package version, 2 | # see https://packaging.python.org/en/latest/single_source_version/ 3 | __version__ = "3.57.0" 4 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | = Test Categories 2 | 3 | - unit 4 | Simple tests that touch a single component or method and verify that it is 5 | functioning correctly *in isolation* from the rest of the SDK. 6 | 7 | - functional 8 | a.k.a. "integration" tests, which ensure that a full, user-like interaction 9 | with the SDK works as expected. 10 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/__init__.py -------------------------------------------------------------------------------- /tests/common/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Common use helpers and utilities for all tests to leverage. 3 | Not so disorganized as a "utils" module and not so refined as a public package. 4 | """ 5 | 6 | from .consents import ConsentTest, ScopeRepr, make_consent_forest 7 | from .constants import GO_EP1_ID, GO_EP2_ID 8 | from .globus_responses import register_api_route, register_api_route_fixture_file 9 | from .response_mock import PickleableMockResponse 10 | 11 | __all__ = [ 12 | "ConsentTest", 13 | "GO_EP1_ID", 14 | "GO_EP2_ID", 15 | "make_consent_forest", 16 | "PickleableMockResponse", 17 | "register_api_route", 18 | "register_api_route_fixture_file", 19 | "ScopeRepr", 20 | ] 21 | -------------------------------------------------------------------------------- /tests/common/constants.py: -------------------------------------------------------------------------------- 1 | GO_EP1_ID = "aa752cea-8222-5bc8-acd9-555b090c0ccb" 2 | GO_EP2_ID = "313ce13e-b597-5858-ae13-29e46fea26e6" 3 | -------------------------------------------------------------------------------- /tests/functional/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/__init__.py -------------------------------------------------------------------------------- /tests/functional/base_client/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def client(): 8 | class CustomClient(globus_sdk.BaseClient): 9 | service_name = "foo" 10 | 11 | return CustomClient() 12 | -------------------------------------------------------------------------------- /tests/functional/local_endpoint/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/local_endpoint/__init__.py -------------------------------------------------------------------------------- /tests/functional/login_flows/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/login_flows/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/auth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/auth/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/auth/base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/auth/base/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/auth/base/test_oauth2_refresh_token.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_oauth2_refresh_token(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/auth/base/test_oauth2_validate_token.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | from globus_sdk._testing import RegisteredResponse, load_response 5 | 6 | 7 | def test_oauth2_validate_token_emits_deprecation_warning(): 8 | nc = globus_sdk.NativeAppAuthClient("dummy_client_id") 9 | load_response( 10 | RegisteredResponse( 11 | service="auth", 12 | path="/v2/oauth2/token/validate", 13 | method="POST", 14 | json={"foo": "bar"}, 15 | ) 16 | ) 17 | with pytest.warns(globus_sdk.RemovedInV4Warning): 18 | nc.oauth2_validate_token("dummy_token") 19 | -------------------------------------------------------------------------------- /tests/functional/services/auth/confidential_client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/auth/confidential_client/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/auth/confidential_client/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def auth_client(no_retry_transport): 8 | class CustomAuthClient(globus_sdk.ConfidentialAppAuthClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomAuthClient("dummy_client_id", "dummy_client_secret") 12 | -------------------------------------------------------------------------------- /tests/functional/services/auth/confidential_client/test_oauth2_start_flow.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_oauth2_start_flow(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/auth/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def login_client(no_retry_transport): 8 | class CustomAuthClient(globus_sdk.AuthLoginClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomAuthClient() 12 | 13 | 14 | @pytest.fixture 15 | def service_client(no_retry_transport): 16 | class CustomAuthClient(globus_sdk.AuthClient): 17 | transport_class = no_retry_transport 18 | 19 | return CustomAuthClient() 20 | -------------------------------------------------------------------------------- /tests/functional/services/auth/native_client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/auth/native_client/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/auth/native_client/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def auth_client(no_retry_transport): 8 | class CustomAuthClient(globus_sdk.NativeAppAuthClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomAuthClient("dummy_client_id") 12 | -------------------------------------------------------------------------------- /tests/functional/services/auth/native_client/test_create_native_app_instance.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import pytest 4 | 5 | from globus_sdk._testing import load_response 6 | 7 | 8 | @pytest.mark.parametrize( 9 | "case_name", 10 | ( 11 | "template_id_str", 12 | "template_id_uuid", 13 | "name", 14 | ), 15 | ) 16 | def test_create_native_app_instance( 17 | auth_client, 18 | case_name: str, 19 | ): 20 | meta = load_response( 21 | auth_client.create_native_app_instance, case=case_name 22 | ).metadata 23 | 24 | res = auth_client.create_native_app_instance(**meta["args"]) 25 | for k, v in meta["response"].items(): 26 | assert res["client"][k] == v 27 | -------------------------------------------------------------------------------- /tests/functional/services/auth/native_client/test_oauth2_refresh_token.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_oauth2_refresh_token(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/auth/native_client/test_oauth2_start_flow.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_oauth2_start_flow(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_create_scope.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import pytest 4 | 5 | from globus_sdk._testing import load_response 6 | 7 | 8 | @pytest.mark.parametrize( 9 | "case_name", 10 | ( 11 | "client_id_str", 12 | "client_id_uuid", 13 | "name", 14 | "description", 15 | "scope_suffix", 16 | "no_required_domains", 17 | "required_domains", 18 | "no_dependent_scopes", 19 | "dependent_scopes", 20 | "advertised", 21 | "not_advertised", 22 | "allows_refresh_token", 23 | "disallows_refresh_token", 24 | ), 25 | ) 26 | def test_create_scope( 27 | service_client, 28 | case_name: str, 29 | ): 30 | meta = load_response(service_client.create_scope, case=case_name).metadata 31 | 32 | res = service_client.create_scope(**meta["args"]) 33 | for k, v in meta["response"].items(): 34 | assert res["scope"][k] == v 35 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_delete_client.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_delete_client( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.delete_client).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.delete_client(client_id=meta["client_id"]) 22 | else: 23 | res = service_client.delete_client(client_id=uuid.UUID(meta["client_id"])) 24 | 25 | assert res["client"]["id"] == meta["client_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_delete_client_credential.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_delete_credential( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.delete_client_credential).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.delete_client_credential( 22 | client_id=meta["client_id"], 23 | credential_id=meta["credential_id"], 24 | ) 25 | else: 26 | res = service_client.delete_client_credential( 27 | client_id=uuid.UUID(meta["client_id"]), 28 | credential_id=uuid.UUID(meta["credential_id"]), 29 | ) 30 | 31 | assert res["credential"]["id"] == meta["credential_id"] 32 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_delete_policy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_delete_policy( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.delete_policy).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.delete_policy(meta["policy_id"]) 22 | else: 23 | res = service_client.delete_policy(uuid.UUID(meta["policy_id"])) 24 | 25 | assert res["policy"]["id"] == meta["policy_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_delete_project.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_delete_project(service_client): 5 | meta = load_response(service_client.delete_project).metadata 6 | 7 | project_id = meta["id"] 8 | res = service_client.delete_project(project_id) 9 | 10 | assert res["project"]["id"] == meta["id"] 11 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_delete_scope.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_delete_scope( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.delete_scope).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.delete_scope(meta["scope_id"]) 22 | else: 23 | res = service_client.delete_scope(uuid.UUID(meta["scope_id"])) 24 | 25 | assert res["scope"]["id"] == meta["scope_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_client_credentials.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_get_client_credentials( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.get_client_credentials).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.get_client_credentials(meta["client_id"]) 22 | else: 23 | res = service_client.get_client_credentials(uuid.UUID(meta["client_id"])) 24 | 25 | assert {cred["id"] for cred in res["credentials"]} == {meta["credential_id"]} 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_clients.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_get_clients(service_client): 5 | meta = load_response(service_client.get_clients).metadata 6 | res = service_client.get_clients() 7 | 8 | assert {client["id"] for client in res["clients"]} == set(meta["client_ids"]) 9 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_consents.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_get_consents(service_client): 5 | meta = load_response(service_client.get_consents).metadata 6 | res = service_client.get_consents(meta["identity_id"]) 7 | 8 | forest = res.to_forest() 9 | assert len(forest.nodes) == 2 10 | assert len(forest.trees) == 1 11 | tree = forest.trees[0] 12 | assert forest.trees[0].max_depth == 2 13 | assert tree.root.scope_name.endswith("transfer.api.globus.org:all") 14 | children = [tree.get_node(child_id) for child_id in tree.edges[tree.root.id]] 15 | assert len(children) == 1 16 | assert children[0].scope_name.endswith("data_access") 17 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_policies.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_get_policies(service_client): 5 | meta = load_response(service_client.get_policies).metadata 6 | res = service_client.get_policies() 7 | 8 | assert {policy["id"] for policy in res["policies"]} == set(meta["policy_ids"]) 9 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_policy.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_get_policy( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.get_policy).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.get_policy(meta["policy_id"]) 22 | else: 23 | res = service_client.get_policy(uuid.UUID(meta["policy_id"])) 24 | 25 | assert res["policy"]["id"] == meta["policy_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_project.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_get_project( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.get_project).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.get_project(meta["project_id"]) 22 | else: 23 | res = service_client.get_project(uuid.UUID(meta["project_id"])) 24 | 25 | assert res["project"]["id"] == meta["project_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_projects.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_get_projects(service_client): 5 | meta = load_response(service_client.get_projects).metadata 6 | res = service_client.get_projects() 7 | 8 | assert [x["id"] for x in res] == meta["project_ids"] 9 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_get_scope.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import uuid 4 | 5 | import pytest 6 | 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "uuid_type", 12 | (str, uuid.UUID), 13 | ) 14 | def test_get_scope( 15 | service_client, 16 | uuid_type: type[str] | type[uuid.UUID], 17 | ): 18 | meta = load_response(service_client.get_scope).metadata 19 | 20 | if uuid_type is str: 21 | res = service_client.get_scope(scope_id=meta["scope_id"]) 22 | else: 23 | res = service_client.get_scope(scope_id=uuid.UUID(meta["scope_id"])) 24 | 25 | assert res["scope"]["id"] == meta["scope_id"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/auth/service_client/test_update_scope.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import pytest 4 | 5 | from globus_sdk._testing import load_response 6 | 7 | 8 | @pytest.mark.parametrize( 9 | "case_name", 10 | ( 11 | "name", 12 | "description", 13 | "scope_suffix", 14 | "no_required_domains", 15 | "required_domains", 16 | "no_dependent_scopes", 17 | "dependent_scopes", 18 | "advertised", 19 | "not_advertised", 20 | "allows_refresh_token", 21 | "disallows_refresh_token", 22 | ), 23 | ) 24 | def test_update_scope( 25 | service_client, 26 | case_name: str, 27 | ): 28 | meta = load_response(service_client.update_scope, case=case_name).metadata 29 | 30 | res = service_client.update_scope(**meta["args"]) 31 | for k, v in meta["response"].items(): 32 | assert res["scope"][k] == v 33 | -------------------------------------------------------------------------------- /tests/functional/services/compute/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def compute_client_v2(no_retry_transport): 8 | class CustomComputeClientV2(globus_sdk.ComputeClientV2): 9 | transport_class = no_retry_transport 10 | 11 | return CustomComputeClientV2() 12 | 13 | 14 | @pytest.fixture 15 | def compute_client_v3(no_retry_transport): 16 | class CustomComputeClientV3(globus_sdk.ComputeClientV3): 17 | transport_class = no_retry_transport 18 | 19 | return CustomComputeClientV3() 20 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/compute/v2/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_delete_endpoint.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_delete_endpoint(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.delete_endpoint).metadata 7 | res = compute_client_v2.delete_endpoint(endpoint_id=meta["endpoint_id"]) 8 | assert res.http_status == 200 9 | assert res.data == {"result": 302} 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_delete_function.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_delete_function(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.delete_function).metadata 7 | res = compute_client_v2.delete_function(function_id=meta["function_id"]) 8 | assert res.http_status == 200 9 | assert res.data == {"result": 302} 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_endpoint.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_endpoint(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_endpoint).metadata 7 | res = compute_client_v2.get_endpoint(endpoint_id=meta["endpoint_id"]) 8 | assert res.http_status == 200 9 | assert res.data["uuid"] == meta["endpoint_id"] 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_endpoint_status.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_endpoint_status(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_endpoint_status).metadata 7 | res = compute_client_v2.get_endpoint_status(endpoint_id=meta["endpoint_id"]) 8 | assert res.http_status == 200 9 | assert res.data["status"] == "online" 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_endpoints.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_endpoints(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_endpoints).metadata 7 | 8 | res = compute_client_v2.get_endpoints() 9 | 10 | assert res.http_status == 200 11 | assert res.data[0]["uuid"] == meta["endpoint_id"] 12 | assert res.data[1]["uuid"] == meta["endpoint_id_2"] 13 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_function.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_function(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_function).metadata 7 | res = compute_client_v2.get_function(function_id=meta["function_id"]) 8 | assert res.http_status == 200 9 | assert res.data["function_uuid"] == meta["function_id"] 10 | assert res.data["function_name"] == meta["function_name"] 11 | assert res.data["function_code"] == meta["function_code"] 12 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_result_amqp_url.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_result_amqp_url(compute_client_v2: globus_sdk.ComputeClientV2): 6 | load_response(compute_client_v2.get_result_amqp_url) 7 | res = compute_client_v2.get_result_amqp_url() 8 | assert res.http_status == 200 9 | assert "connection_url" in res.data 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_task_batch.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | import uuid 3 | 4 | import pytest 5 | 6 | import globus_sdk 7 | from globus_sdk._testing import load_response 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "transform", 12 | ( 13 | pytest.param(lambda x: x, id="string"), 14 | pytest.param(lambda x: [x], id="list"), 15 | pytest.param(lambda x: {x}, id="set"), 16 | pytest.param(lambda x: uuid.UUID(x), id="uuid"), 17 | pytest.param(lambda x: [uuid.UUID(x)], id="uuid_list"), 18 | ), 19 | ) 20 | def test_get_task_batch( 21 | compute_client_v2: globus_sdk.ComputeClientV2, transform: t.Callable 22 | ): 23 | meta = load_response(compute_client_v2.get_task_batch).metadata 24 | task_ids = transform(meta["task_id"]) 25 | res = compute_client_v2.get_task_batch(task_ids=task_ids) 26 | 27 | assert res.http_status == 200 28 | assert meta["task_id"] in res.data["results"] 29 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_task_group.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_task_group(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_task_group).metadata 7 | res = compute_client_v2.get_task_group(task_group_id=meta["task_group_id"]) 8 | assert res.http_status == 200 9 | assert meta["task_group_id"] == res.data["taskgroup_id"] 10 | assert meta["task_id"] == res.data["tasks"][0]["id"] 11 | assert meta["task_id_2"] == res.data["tasks"][1]["id"] 12 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_task_info.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_task(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_task).metadata 7 | res = compute_client_v2.get_task(task_id=meta["task_id"]) 8 | assert res.http_status == 200 9 | assert res.data["task_id"] == meta["task_id"] 10 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_get_version.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_version(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.get_version).metadata 7 | res = compute_client_v2.get_version() 8 | assert res.http_status == 200 9 | assert res.data == meta["api_version"] 10 | 11 | 12 | def test_get_version_all(compute_client_v2: globus_sdk.ComputeClientV2): 13 | meta = load_response(compute_client_v2.get_version, case="all").metadata 14 | res = compute_client_v2.get_version(service="all") 15 | assert res.http_status == 200 16 | assert res.data["api"] == meta["api_version"] 17 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_lock_endpoint.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_lock_endpoint(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.lock_endpoint).metadata 7 | 8 | res = compute_client_v2.lock_endpoint(endpoint_id=meta["endpoint_id"]) 9 | 10 | assert res.http_status == 200 11 | assert res.data["endpoint_id"] == meta["endpoint_id"] 12 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_register_function.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_register_function(compute_client_v2: globus_sdk.ComputeClientV2): 6 | meta = load_response(compute_client_v2.register_function).metadata 7 | registration_doc = { 8 | "function_name": meta["function_name"], 9 | "function_code": meta["function_code"], 10 | } 11 | res = compute_client_v2.register_function(function_data=registration_doc) 12 | assert res.http_status == 200 13 | assert res.data["function_uuid"] == meta["function_id"] 14 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v2/test_submit.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | import globus_sdk 4 | from globus_sdk._testing import load_response 5 | 6 | 7 | def test_submit(compute_client_v2: globus_sdk.ComputeClientV2): 8 | meta = load_response(compute_client_v2.submit).metadata 9 | ep_id, func_id = uuid.uuid1(), uuid.uuid1() 10 | submit_doc = { 11 | "task_group_id": meta["task_group_id"], 12 | "create_websocket_queue": False, 13 | "tasks": [ 14 | [func_id, ep_id, "36\n00\ngASVDAAAAAAAAACMBlJvZG5leZSFlC4=\n12 ..."], 15 | [func_id, ep_id, "36\n00\ngASVCwAAAAAAAACMBUJvYmJ5lIWULg==\n12 ..."], 16 | ], 17 | } 18 | 19 | res = compute_client_v2.submit(data=submit_doc) 20 | 21 | assert res.http_status == 200 22 | assert res.data["task_group_id"] == meta["task_group_id"] 23 | results = res.data["results"] 24 | assert results[0]["task_uuid"] == meta["task_id"] 25 | assert results[1]["task_uuid"] == meta["task_id_2"] 26 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v3/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/compute/v3/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/compute/v3/test_get_endpoint_allowlist.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_get_endpoint_allowlist(compute_client_v3: globus_sdk.ComputeClientV3): 6 | meta = load_response(compute_client_v3.get_endpoint_allowlist).metadata 7 | 8 | res = compute_client_v3.get_endpoint_allowlist(endpoint_id=meta["endpoint_id"]) 9 | 10 | assert res.http_status == 200 11 | assert res.data["endpoint_id"] == meta["endpoint_id"] 12 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v3/test_lock_endpoint.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_lock_endpoint(compute_client_v3: globus_sdk.ComputeClientV3): 6 | meta = load_response(compute_client_v3.lock_endpoint).metadata 7 | 8 | res = compute_client_v3.lock_endpoint(endpoint_id=meta["endpoint_id"]) 9 | 10 | assert res.http_status == 200 11 | assert res.data["endpoint_id"] == meta["endpoint_id"] 12 | -------------------------------------------------------------------------------- /tests/functional/services/compute/v3/test_register_function.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk._testing import load_response 3 | 4 | 5 | def test_register_function(compute_client_v3: globus_sdk.ComputeClientV3): 6 | meta = load_response(compute_client_v3.register_function).metadata 7 | registration_doc = { 8 | "function_name": meta["function_name"], 9 | "function_code": meta["function_code"], 10 | } 11 | res = compute_client_v3.register_function(data=registration_doc) 12 | assert res.http_status == 200 13 | assert res.data["function_uuid"] == meta["function_id"] 14 | -------------------------------------------------------------------------------- /tests/functional/services/flows/conftest.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | 3 | import pytest 4 | 5 | import globus_sdk 6 | 7 | 8 | @pytest.fixture 9 | def flows_client(no_retry_transport): 10 | class CustomFlowsClient(globus_sdk.FlowsClient): 11 | transport_class = no_retry_transport 12 | 13 | return CustomFlowsClient() 14 | 15 | 16 | @pytest.fixture 17 | def specific_flow_client_class( 18 | no_retry_transport, 19 | ) -> t.Type[globus_sdk.SpecificFlowClient]: 20 | class CustomSpecificFlowClient(globus_sdk.SpecificFlowClient): 21 | transport_class = no_retry_transport 22 | 23 | return CustomSpecificFlowClient 24 | -------------------------------------------------------------------------------- /tests/functional/services/flows/test_resume_run.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | 3 | from globus_sdk import SpecificFlowClient 4 | from globus_sdk._testing import load_response 5 | 6 | 7 | def test_resume_run(specific_flow_client_class: t.Type[SpecificFlowClient]): 8 | metadata = load_response(SpecificFlowClient.resume_run).metadata 9 | 10 | flow_client = specific_flow_client_class(flow_id=metadata["flow_id"]) 11 | 12 | resp = flow_client.resume_run(metadata["run_id"]) 13 | assert resp.http_status == 200 14 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from globus_sdk import GCSClient 4 | 5 | 6 | @pytest.fixture 7 | def client(no_retry_transport): 8 | class CustomGCSClient(GCSClient): 9 | transport_class = no_retry_transport 10 | 11 | # default fqdn for GCS client testing 12 | return CustomGCSClient("abc.xyz.data.globus.org") 13 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/collection_list.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/gcs/fixture_data/collection_list.json -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/empty_success.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "data": [], 5 | "detail": "success", 6 | "http_response_code": 200 7 | } 8 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/get_collection/bad_version.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "detail": "success", 5 | "http_response_code": 200, 6 | "data": [ 7 | { 8 | "DATA_TYPE": "collection99.145.10", 9 | "foo": 1 10 | }, 11 | { 12 | "DATA_TYPE": "collection", 13 | "foo": 2 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/get_collection/includes_other.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "detail": "success", 5 | "http_response_code": 200, 6 | "data": [ 7 | { 8 | "DATA_TYPE": "woof#1.0.0", 9 | "animal": "dog" 10 | }, 11 | { 12 | "DATA_TYPE": "collection#1.0.0", 13 | "public": true, 14 | "id": "{collection_id}", 15 | "display_name": "Happy Fun Collection Name", 16 | "identity_id": "e926d510-cb98-11e5-a6ac-0b0216052512", 17 | "collection_type": "mapped", 18 | "storage_gateway_id": "{storage_gateway_id}", 19 | "connector_id": "145812c8-decc-41f1-83cf-bb2a85a2a70b" 20 | }, 21 | { 22 | "DATA_TYPE": "meow#1.0.0", 23 | "animal": "cat" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/get_collection/invalid_datatype_type.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "detail": "success", 5 | "http_response_code": 200, 6 | "data": [ 7 | {}, 8 | { 9 | "DATA_TYPE": 0, 10 | "public": true, 11 | "id": "{collection_id}", 12 | "display_name": "Happy Fun Collection Name" 13 | }, 14 | { 15 | "DATA_TYPE": [ 16 | "foo#1.0", 17 | "bar#2.0" 18 | ], 19 | "public": true, 20 | "id": "{collection_id}", 21 | "display_name": "Happy Fun Collection Name" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/get_collection/normal.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "detail": "success", 5 | "http_response_code": 200, 6 | "data": [ 7 | { 8 | "DATA_TYPE": "collection#1.0.0", 9 | "public": true, 10 | "id": "{collection_id}", 11 | "display_name": "Happy Fun Collection Name", 12 | "identity_id": "e926d510-cb98-11e5-a6ac-0b0216052512", 13 | "collection_type": "mapped", 14 | "storage_gateway_id": "{storage_gateway_id}", 15 | "connector_id": "145812c8-decc-41f1-83cf-bb2a85a2a70b" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/get_collection/unexpectedly_flat.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "collection#1.0.0", 3 | "public": true, 4 | "id": "{collection_id}", 5 | "display_name": "Happy Fun Collection Name", 6 | "identity_id": "e926d510-cb98-11e5-a6ac-0b0216052512", 7 | "collection_type": "mapped", 8 | "storage_gateway_id": "{storage_gateway_id}", 9 | "connector_id": "145812c8-decc-41f1-83cf-bb2a85a2a70b" 10 | } 11 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/role_document.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "data": [ 5 | { 6 | "DATA_TYPE": "role#1.0.0", 7 | "id": "{role_id_1}", 8 | "collection": null, 9 | "principal": "urn:globus:auth:identity:{user_id_1}", 10 | "role": "owner" 11 | } 12 | ], 13 | "http_response_code": 200, 14 | "detail": "success", 15 | "has_next_page": false 16 | } 17 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/role_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "data": [ 5 | { 6 | "DATA_TYPE": "role#1.0.0", 7 | "id": "{role_id_1}", 8 | "collection": null, 9 | "principal": "urn:globus:auth:identity:{user_id_1}", 10 | "role": "owner" 11 | }, 12 | { 13 | "DATA_TYPE": "role#1.0.0", 14 | "id": "{role_id_2}", 15 | "collection": "{collection_id_1}", 16 | "principal": "urn:globus:groups:id:{group_id_1}", 17 | "role": "administrator" 18 | } 19 | 20 | ], 21 | "http_response_code": 200, 22 | "detail": {}, 23 | "has_next_page": false, 24 | "marker": "" 25 | } 26 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/fixture_data/user_credential_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "DATA_TYPE": "result#1.0.0", 3 | "code": "success", 4 | "data": [ 5 | { 6 | "DATA_TYPE": "user_credential#1.0.0", 7 | "connector_id": "145812c8-decc-41f1-83cf-bb2a85a2a70b", 8 | "display_name": "aaschaer", 9 | "id": "58f2d95a-11ce-512e-b90a-a523ed6c37d4", 10 | "identity_id": "6e661986-4d49-4b88-982f-6873f842ca6e", 11 | "invalid": false, 12 | "policies": { 13 | "DATA_TYPE": "posix_user_credential_policies#1.0.0" 14 | }, 15 | "provisioned": false, 16 | "storage_gateway_id": "0af12dc0-eb8c-43d9-bf90-50bc5b69879b", 17 | "username": "aaschaer" 18 | } 19 | ], 20 | "detail": "success", 21 | "has_next_page": false, 22 | "http_response_code": 200 23 | } 24 | -------------------------------------------------------------------------------- /tests/functional/services/gcs/test_get_gcs_info.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import get_last_request, load_response 2 | from globus_sdk.authorizers import AccessTokenAuthorizer 3 | 4 | 5 | def test_get_gcs_info(client): 6 | meta = load_response(client.get_gcs_info).metadata 7 | endpoint_client_id = meta["endpoint_client_id"] 8 | 9 | # set an authorizer 10 | client.authorizer = AccessTokenAuthorizer("access_token") 11 | 12 | res = client.get_gcs_info() 13 | assert res["endpoint_id"] == endpoint_client_id 14 | assert res["client_id"] == endpoint_client_id 15 | 16 | # confirm request was unauthenticated despite client having an authorizer 17 | req = get_last_request() 18 | assert "Authorization" not in req.headers 19 | -------------------------------------------------------------------------------- /tests/functional/services/groups/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def groups_client(no_retry_transport): 8 | class CustomGroupsClient(globus_sdk.GroupsClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomGroupsClient() 12 | 13 | 14 | @pytest.fixture 15 | def groups_manager(groups_client): 16 | return globus_sdk.GroupsManager(groups_client) 17 | -------------------------------------------------------------------------------- /tests/functional/services/groups/fixture_data/add_member.json: -------------------------------------------------------------------------------- 1 | { 2 | "add": [ 3 | { 4 | "group_id": "d3974728-6458-11e4-b72d-123139141556", 5 | "identity_id": "ae332d86-d274-11e5-b885-b31714a110e9", 6 | "username": "sirosen@globusid.org", 7 | "role": "admin", 8 | "status": "active" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/functional/services/groups/fixture_data/approve_pending.json: -------------------------------------------------------------------------------- 1 | { 2 | "approve": [ 3 | { 4 | "group_id": "d3974728-6458-11e4-b72d-123139141556", 5 | "identity_id": "ae332d86-d274-11e5-b885-b31714a110e9", 6 | "username": "sirosen@globusid.org", 7 | "role": "member", 8 | "status": "active" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tests/functional/services/groups/fixture_data/get_group_policies.json: -------------------------------------------------------------------------------- 1 | { 2 | "is_high_assurance": false, 3 | "authentication_assurance_timeout": 28800, 4 | "group_visibility": "private", 5 | "group_members_visibility": "managers", 6 | "join_requests": false, 7 | "signup_fields": [] 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/services/groups/fixture_data/updated_group.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Claptrap's Rough Riders", 3 | "description": "Stairs strongly discouraged.", 4 | "parent_id": null, 5 | "id": "d3974728-6458-11e4-b72d-123139141556", 6 | "group_type": "regular", 7 | "enforce_session": false, 8 | "session_limit": 28800, 9 | "session_timeouts": {}, 10 | "my_memberships": [ 11 | { 12 | "group_id": "d3974728-6458-11e4-b72d-123139141556", 13 | "identity_id": "ae332d86-d274-11e5-b885-b31714a110e9", 14 | "username": "sirosen@globusid.org", 15 | "role": "admin", 16 | "status": "active" 17 | } 18 | ], 19 | "policies": { 20 | "group_visibility": "private", 21 | "group_members_visibility": "managers" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_accept_invite.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_accept_invite(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_decline_invite.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_decline_invite(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_invite_member.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_invite_member(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_join.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_join(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_leave.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_leave(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_reject_join_request.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_reject_join_request(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_remove_member.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_remove_member(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/manager/test_request_join.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_request_join(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_delete_group.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_delete_group(groups_client): 5 | meta = load_response(groups_client.delete_group).metadata 6 | 7 | res = groups_client.delete_group(group_id=meta["group_id"]) 8 | assert res.http_status == 200 9 | assert "Claptrap" in res["name"] 10 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_get_group_policies.py: -------------------------------------------------------------------------------- 1 | from tests.common import register_api_route_fixture_file 2 | 3 | 4 | def test_get_group_policies(groups_client): 5 | register_api_route_fixture_file( 6 | "groups", 7 | "/v2/groups/d3974728-6458-11e4-b72d-123139141556/policies", 8 | "get_group_policies.json", 9 | ) 10 | resp = groups_client.get_group_policies("d3974728-6458-11e4-b72d-123139141556") 11 | assert resp.http_status == 200 12 | assert resp.data == { 13 | "is_high_assurance": False, 14 | "authentication_assurance_timeout": 28800, 15 | "group_visibility": "private", 16 | "group_members_visibility": "managers", 17 | "join_requests": False, 18 | "signup_fields": [], 19 | } 20 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_get_identity_preferences.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_identity_preferences(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_get_membership_fields.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_membership_fields(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_get_my_groups.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | from globus_sdk.response import ArrayResponse 3 | 4 | 5 | def test_get_my_groups(groups_client): 6 | meta = load_response(groups_client.get_my_groups).metadata 7 | 8 | res = groups_client.get_my_groups() 9 | assert res.http_status == 200 10 | 11 | assert isinstance(res, ArrayResponse) 12 | assert isinstance(res.data, list) 13 | assert set(meta["group_names"]) == {g["name"] for g in res} 14 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_set_identity_preferences.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_set_identity_preferences(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_set_membership_fields.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_set_membership_fields(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/groups/test_update_group.py: -------------------------------------------------------------------------------- 1 | from tests.common import register_api_route_fixture_file 2 | 3 | 4 | def test_update_group(groups_client): 5 | register_api_route_fixture_file( 6 | "groups", 7 | "/v2/groups/592e0566-5201-4207-b5e1-7cd6c516e9a0", 8 | "updated_group.json", 9 | method="PUT", 10 | ) 11 | 12 | data = { 13 | "name": "Claptrap's Rough Riders", 14 | "description": "Stairs strongly discouraged.", 15 | } 16 | res = groups_client.update_group( 17 | group_id="592e0566-5201-4207-b5e1-7cd6c516e9a0", data=data 18 | ) 19 | assert res.http_status == 200 20 | assert "Claptrap" in res.data["name"] 21 | assert "Stairs strongly discouraged." in res.data["description"] 22 | -------------------------------------------------------------------------------- /tests/functional/services/search/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def client(no_retry_transport): 8 | class CustomSearchClient(globus_sdk.SearchClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomSearchClient() 12 | -------------------------------------------------------------------------------- /tests/functional/services/search/fixture_data/scroll_result_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "gmeta": [ 3 | { 4 | "@datatype": "GMetaResult", 5 | "@version": "2019-08-27", 6 | "entries": [ 7 | { 8 | "content": { 9 | "foo": "bar" 10 | }, 11 | "entry_id": null, 12 | "matched_principal_sets": [] 13 | } 14 | ], 15 | "subject": "foo-bar" 16 | } 17 | ], 18 | "count": 1, 19 | "total": 2, 20 | "has_next_page": true, 21 | "marker": "3d34900e3e4211ebb0a806b2af333354" 22 | } 23 | -------------------------------------------------------------------------------- /tests/functional/services/search/fixture_data/scroll_result_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "gmeta": [ 3 | { 4 | "@datatype": "GMetaResult", 5 | "@version": "2019-08-27", 6 | "entries": [ 7 | { 8 | "content": { 9 | "foo": "baz" 10 | }, 11 | "entry_id": null, 12 | "matched_principal_sets": [] 13 | } 14 | ], 15 | "subject": "foo-baz" 16 | } 17 | ], 18 | "count": 1, 19 | "total": 2, 20 | "has_next_page": false, 21 | "marker": null 22 | } 23 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_create_entry.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_create_entry(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_create_index.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | from globus_sdk._testing import load_response 5 | 6 | 7 | def test_create_index(client): 8 | meta = load_response(client.create_index).metadata 9 | 10 | res = client.create_index("Foo Title", "bar description") 11 | assert res.http_status == 200 12 | assert res["id"] == meta["index_id"] 13 | 14 | 15 | def test_create_index_limit_exceeded(client): 16 | load_response(client.create_index, case="trial_limit") 17 | 18 | with pytest.raises(globus_sdk.SearchAPIError) as excinfo: 19 | client.create_index("Foo Title", "bar description") 20 | 21 | err = excinfo.value 22 | 23 | assert err.http_status == 409 24 | assert err.code == "Conflict.LimitExceeded" 25 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_delete_by_query.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_by_query(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_delete_entry.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_entry(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_delete_index.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | from globus_sdk._testing import load_response 5 | 6 | 7 | def test_delete_index(client): 8 | meta = load_response(client.delete_index).metadata 9 | 10 | res = client.delete_index(meta["index_id"]) 11 | assert res.http_status == 200 12 | assert res["acknowledged"] is True 13 | 14 | 15 | def test_delete_index_delete_already_pending(client): 16 | meta = load_response(client.delete_index, case="delete_pending").metadata 17 | 18 | with pytest.raises(globus_sdk.SearchAPIError) as excinfo: 19 | client.delete_index(meta["index_id"]) 20 | 21 | err = excinfo.value 22 | 23 | assert err.http_status == 409 24 | assert err.code == "Conflict.IncompatibleIndexStatus" 25 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_delete_subject.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_subject(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_get_entry.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_entry(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_get_index.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_index(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_get_subject.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_subject(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_get_task.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_task(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_get_task_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_task_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_index_list.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_search_index_list(client): 5 | meta = load_response(client.index_list).metadata 6 | index_ids = meta["index_ids"] 7 | 8 | res = client.index_list() 9 | assert res.http_status == 200 10 | 11 | index_list = res["index_list"] 12 | assert isinstance(index_list, list) 13 | assert len(index_list) == len(index_ids) 14 | assert [i["id"] for i in index_list] == index_ids 15 | 16 | 17 | def test_search_index_list_is_iterable(client): 18 | meta = load_response(client.index_list).metadata 19 | index_ids = meta["index_ids"] 20 | 21 | res = client.index_list() 22 | assert res.http_status == 200 23 | 24 | index_list = list(res) 25 | assert len(index_list) == len(index_ids) 26 | assert [i["id"] for i in index_list] == index_ids 27 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_ingest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_ingest(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_reopen_index.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | from globus_sdk._testing import load_response 5 | 6 | 7 | def test_reopen_index(client): 8 | meta = load_response(client.reopen_index).metadata 9 | 10 | res = client.reopen_index(meta["index_id"]) 11 | assert res.http_status == 200 12 | assert res["acknowledged"] is True 13 | 14 | 15 | def test_reopen_index_already_open(client): 16 | meta = load_response(client.reopen_index, case="already_open").metadata 17 | 18 | with pytest.raises(globus_sdk.SearchAPIError) as excinfo: 19 | client.reopen_index(meta["index_id"]) 20 | 21 | err = excinfo.value 22 | 23 | assert err.http_status == 409 24 | assert err.code == "Conflict.IncompatibleIndexStatus" 25 | -------------------------------------------------------------------------------- /tests/functional/services/search/test_update_entry.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_update_entry(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/timers/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def client(): 8 | return globus_sdk.TimersClient() 9 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/functional/services/transfer/__init__.py -------------------------------------------------------------------------------- /tests/functional/services/transfer/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | @pytest.fixture 7 | def client(no_retry_transport): 8 | class CustomTransferClient(globus_sdk.TransferClient): 9 | transport_class = no_retry_transport 10 | 11 | return CustomTransferClient() 12 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_acl_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_acl_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_cancel_status.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_cancel_status(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_cancel_tasks.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_cancel_tasks(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_create_pause_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_create_pause_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_delete_pause_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_delete_pause_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_get_endpoint.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_get_endpoint(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_get_pause_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_get_pause_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_get_task.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_get_task(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_hosted_endpoint_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_hosted_endpoint_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_monitored_endpoints.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_monitored_endpoints(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_pause_rule_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_pause_rule_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_pause_tasks.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_pause_tasks(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_resume_tasks.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_resume_tasks(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_task_pause_info.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_task_pause_info(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_task_skipped_errors.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_task_skipped_errors(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_task_successful_transfers.py: -------------------------------------------------------------------------------- 1 | from globus_sdk._testing import load_response 2 | 3 | 4 | def test_endpoint_manager_task_successful_transfers(client): 5 | meta = load_response(client.endpoint_manager_task_successful_transfers).metadata 6 | 7 | response = client.endpoint_manager_task_successful_transfers(meta["task_id"]) 8 | 9 | assert response.http_status == 200 10 | assert response["DATA_TYPE"] == "successful_transfers" 11 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/endpoint_manager/test_endpoint_manager_update_pause_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_manager_update_pause_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/fixture_data/activation_already_activated_stub.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "AlreadyActivated" 3 | } 4 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/fixture_data/activation_stub.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "AutoActivated.CachedCredential" 3 | } 4 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_add_endpoint_acl_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_add_endpoint_acl_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_add_endpoint_role.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_add_endpoint_role(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_add_endpoint_server.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_add_endpoint_server(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_bookmark_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_bookmark_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_cancel_task.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_cancel_task(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_create_bookmark.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_create_bookmark(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_create_shared_endpoint.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_create_shared_endpoint(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_delete_bookmark.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_bookmark(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_delete_endpoint.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_endpoint(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_delete_endpoint_acl_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_endpoint_acl_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_delete_endpoint_role.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_endpoint_role(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_delete_endpoint_server.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_delete_endpoint_server(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_endpoint_acl_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_acl_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_endpoint_activate.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_activate(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_endpoint_deactivate.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_deactivate(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_endpoint_get_activation_requirements.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_get_activation_requirements(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_endpoint_role_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_endpoint_role_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_get_bookmark.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_bookmark(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_get_endpoint_acl_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_endpoint_acl_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_get_endpoint_role.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_endpoint_role(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_get_endpoint_server.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_get_endpoint_server(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_my_effective_pause_rule_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_my_effective_pause_rule_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_my_shared_endpoint_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_my_shared_endpoint_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_operation_stat.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests for TransferClient.operation_stat 3 | """ 4 | 5 | import urllib.parse 6 | 7 | from globus_sdk._testing import get_last_request, load_response 8 | 9 | 10 | def test_operation_stat(client): 11 | meta = load_response(client.operation_stat).metadata 12 | endpoint_id = meta["endpoint_id"] 13 | path = "/home/share/godata/file1.txt" 14 | res = client.operation_stat(endpoint_id, path) 15 | 16 | assert res["name"] == "file1.txt" 17 | assert res["type"] == "file" 18 | assert res["size"] == 4 19 | 20 | req = get_last_request() 21 | parsed_qs = urllib.parse.parse_qs(urllib.parse.urlparse(req.url).query) 22 | assert parsed_qs == {"path": [path]} 23 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_operation_symlink.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | import pytest 4 | 5 | from globus_sdk import exc 6 | from globus_sdk._testing import RegisteredResponse 7 | 8 | 9 | @pytest.fixture 10 | def symlink_endpoint_id(): 11 | return str(uuid.uuid1()) 12 | 13 | 14 | @pytest.fixture(autouse=True) 15 | def _setup_symlink_response(symlink_endpoint_id): 16 | RegisteredResponse( 17 | service="transfer", 18 | method="POST", 19 | path=f"/operation/endpoint/{symlink_endpoint_id}/symlink", 20 | json={}, 21 | ).add() 22 | 23 | 24 | def test_operation_symlink_warns(client, symlink_endpoint_id): 25 | with pytest.warns( 26 | exc.RemovedInV4Warning, 27 | match="operation_symlink is not currently supported by any collections", 28 | ): 29 | client.operation_symlink(symlink_endpoint_id, "some_link_target", "/some/path") 30 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_task_event_list.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_task_event_list(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_task_pause_info.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_task_pause_info(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_task_successful_transfers.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_task_successful_transfers(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_update_bookmark.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_update_bookmark(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_update_endpoint_acl_rule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_update_endpoint_acl_rule(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_update_endpoint_server.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_update_endpoint_server(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/functional/services/transfer/test_update_task.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.mark.xfail 5 | def test_update_task(): 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/README.rst: -------------------------------------------------------------------------------- 1 | Tests Using ``mypy --warn-unused-ignores`` 2 | ========================================== 3 | 4 | These tests confirm that types are correct using ``mypy 5 | --warn-unused-ignores``. 6 | 7 | This strategy is suggested as a lightweight test in the 8 | `Python Typing Quality Documentation 9 | `_. 10 | 11 | These tests are run by ``tox -e mypy`` from the repo root. 12 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/app_scope_requirements.py: -------------------------------------------------------------------------------- 1 | from globus_sdk import UserApp 2 | 3 | # declare scope data in the form of a subtype of the ScopeCollectionType (`list[str]`) 4 | # indexed in a dict, this is meant to be a subtype of the requirements data accepted 5 | # by `GlobusApp.add_scope_requirements` 6 | # 7 | # this is a regression test for that being annotated as `dict[str, ScopeCollectionType]` 8 | # which will reject the input type because `dict` is a mutable container, and therefore 9 | # invariant 10 | scopes: dict[str, list[str]] = {"foo": ["bar"]} 11 | my_app = UserApp("...", client_id="...") 12 | my_app.add_scope_requirements(scopes) 13 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/auth_client_create_policy.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | 3 | ac = globus_sdk.AuthClient() 4 | 5 | # create new policy with keyword-only args, as supported 6 | ac.create_policy( 7 | project_id="foo", 8 | display_name="My Policy", 9 | description="This is a policy", 10 | ) 11 | 12 | # create using positional args (deprecated/unsupported) 13 | ac.create_policy( # type: ignore[misc] 14 | "foo", 15 | True, # type: ignore[arg-type] 16 | 101, # type: ignore[arg-type] 17 | "My Policy", # type: ignore[arg-type] 18 | "This is a policy", # type: ignore[arg-type] 19 | ) 20 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/auth_client_initialization.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | 3 | # ok usage 4 | ac = globus_sdk.AuthClient() 5 | nc = globus_sdk.NativeAppAuthClient("foo_client_id") 6 | cc = globus_sdk.ConfidentialAppAuthClient("foo_client_id", "foo_client_secret") 7 | 8 | # base class allows authorizer 9 | authorizer = globus_sdk.AccessTokenAuthorizer("dummytoken") 10 | ac = globus_sdk.AuthClient(authorizer=authorizer) 11 | 12 | # subclasses forbid authorizers 13 | nc = globus_sdk.NativeAppAuthClient( # type: ignore[call-arg] 14 | "foo_client_id", authorizer=authorizer 15 | ) 16 | cc = globus_sdk.ConfidentialAppAuthClient( # type: ignore[call-arg] 17 | "foo_client_id", "foo_client_secret", authorizer=authorizer 18 | ) 19 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/auth_client_jwk_methods.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | from globus_sdk.services.auth._common import SupportsJWKMethods 3 | 4 | # setup clients 5 | ac = globus_sdk.AuthClient() 6 | nc = globus_sdk.NativeAppAuthClient("foo_client_id") 7 | cc = globus_sdk.ConfidentialAppAuthClient("foo_client_id", "foo_client_secret") 8 | 9 | # check that each one supports the JWK methods 10 | x: SupportsJWKMethods 11 | x = ac 12 | x = nc 13 | x = cc 14 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/base_client_usage.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import globus_sdk 4 | 5 | # type is (str | None) 6 | s: str | None = globus_sdk.BaseClient.resource_server 7 | i: int = globus_sdk.BaseClient.resource_server # type: ignore [assignment] 8 | 9 | # holds on an instance as well 10 | c = globus_sdk.BaseClient() 11 | s = c.resource_server 12 | i = c.resource_server # type: ignore [assignment] 13 | 14 | # check that data:list warns, but other types are okay 15 | r = c.request("POST", "/foo", data="bar") 16 | r = c.request("POST", "/foo", data={}) 17 | r = c.request("POST", "/foo", data=[]) # type: ignore [arg-type] 18 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/custom_transport.py: -------------------------------------------------------------------------------- 1 | from globus_sdk.transport import RequestsTransport 2 | 3 | 4 | # customize the status code tuples 5 | # make sure mypy does not reject these changes for updating the tuple sizes 6 | class CustomRetryStatusTransport(RequestsTransport): 7 | RETRY_AFTER_STATUS_CODES = (503,) 8 | TRANSIENT_ERROR_STATUS_CODES = (500,) 9 | EXPIRED_AUTHORIZATION_STATUS_CODES = (401, 403) 10 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/get_identities.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from globus_sdk import AuthClient 4 | 5 | zero_id = uuid.UUID(int=0) 6 | 7 | # ok usages 8 | ac = AuthClient() 9 | ac.get_identities(ids="foo") 10 | ac.get_identities(ids=zero_id) 11 | ac.get_identities(ids=("foo", "bar")) 12 | ac.get_identities(ids=(zero_id,)) 13 | ac.get_identities(usernames="foo,bar") 14 | ac.get_identities(usernames=("foo", "bar")) 15 | ac.get_identities(usernames=("foo", "bar"), provision=True) 16 | ac.get_identities(usernames=("foo", "bar"), query_params={"provision": False}) 17 | 18 | # bad usage 19 | ac.get_identities(usernames=zero_id) # type: ignore[arg-type] 20 | ac.get_identities(usernames=(zero_id,)) # type: ignore[arg-type] 21 | 22 | 23 | # test the response object is iterable 24 | res = ac.get_identities(usernames="foo") 25 | for x in res: 26 | print(x) 27 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/identity_map.py: -------------------------------------------------------------------------------- 1 | # check IdentityMap usages 2 | import globus_sdk 3 | 4 | # create clients for later usage 5 | ac = globus_sdk.AuthClient() 6 | nc = globus_sdk.NativeAppAuthClient("foo_client_id") 7 | cc = globus_sdk.ConfidentialAppAuthClient("foo_client_id", "foo_client_secret") 8 | 9 | # check init allows CC, but not NC 10 | im = globus_sdk.IdentityMap(ac) 11 | im = globus_sdk.IdentityMap(cc) 12 | im = globus_sdk.IdentityMap(nc) # type: ignore[arg-type] 13 | 14 | # getitem and delitem work, but setitem and contains do not 15 | foo = im["foo"] 16 | del im["foo"] 17 | im["foo"] = "bar" # type: ignore[index] 18 | somebool = "foo" in im # type: ignore[operator] 19 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/lazy_importer.py: -------------------------------------------------------------------------------- 1 | # test typing interactions with __getattr__-based lazy imports 2 | import globus_sdk 3 | 4 | # ensure that a valid name is treated as valid 5 | globus_sdk.TransferClient 6 | # but an invalid name is not! 7 | globus_sdk.TRansferClient # type: ignore[attr-defined] 8 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/specific_flow_scopes.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | 3 | import globus_sdk 4 | 5 | # test that a SpecificFlowClient allows assignments of scope strings and resource_server 6 | # even though the class-level default is a specialized stub object 7 | flow_id = "foo" 8 | specific_flow_client = globus_sdk.SpecificFlowClient(flow_id) 9 | 10 | scopes_object = specific_flow_client.scopes 11 | t.assert_type(scopes_object, globus_sdk.scopes.ScopeBuilder) 12 | 13 | scope: str = scopes_object.user 14 | x: int = scopes_object.user # type: ignore[assignment] 15 | resource_server: str = specific_flow_client.scopes.resource_server 16 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/test_guards.py: -------------------------------------------------------------------------------- 1 | # test that the internal _guards module provides valid and well-formed type-guards 2 | import typing as t 3 | 4 | from globus_sdk import _guards 5 | 6 | 7 | def get_any() -> t.Any: 8 | return 1 9 | 10 | 11 | x = get_any() 12 | t.assert_type(x, t.Any) 13 | 14 | # test is_list_of 15 | if _guards.is_list_of(x, str): 16 | t.assert_type(x, list[str]) 17 | elif _guards.is_list_of(x, int): 18 | t.assert_type(x, list[int]) 19 | 20 | # test is_optional 21 | if _guards.is_optional(x, float): 22 | t.assert_type(x, float | None) 23 | elif _guards.is_optional(x, bytes): 24 | t.assert_type(x, bytes | None) 25 | 26 | 27 | # test is_optional_list_of 28 | if _guards.is_optional_list_of(x, type(None)): 29 | t.assert_type(x, list[None] | None) 30 | elif _guards.is_optional_list_of(x, dict): 31 | t.assert_type(x, list[dict[t.Any, t.Any]] | None) 32 | -------------------------------------------------------------------------------- /tests/non-pytest/mypy-ignore-tests/timer_client_aliasing.py: -------------------------------------------------------------------------------- 1 | import globus_sdk 2 | 3 | c = globus_sdk.TimersClient() 4 | c_legacy = globus_sdk.TimerClient() 5 | 6 | # both can call create_timer() 7 | c.create_timer({"foo": "bar"}) 8 | c_legacy.create_timer({"foo": "bar"}) 9 | 10 | # both reject create_timer() 11 | c.create_timer(object()) # type: ignore[arg-type] 12 | c_legacy.create_timer(object()) # type: ignore[arg-type] 13 | -------------------------------------------------------------------------------- /tests/non-pytest/poetry-lock-test/.gitignore: -------------------------------------------------------------------------------- 1 | poetry.lock 2 | -------------------------------------------------------------------------------- /tests/non-pytest/poetry-lock-test/README: -------------------------------------------------------------------------------- 1 | Ensure that `poetry install` of the SDK works correctly. 2 | 3 | This means that `poetry` can parse the version specifiers for all dependencies, 4 | including dev extras, correctly. 5 | 6 | Inspired by #474 7 | ( https://github.com/globus/globus-sdk-python/pull/474 ) 8 | 9 | This can be run via the tox package checks. Try `tox -e poetry-check` 10 | -------------------------------------------------------------------------------- /tests/non-pytest/poetry-lock-test/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "poetry-install-test" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Stephen Rosen "] 6 | 7 | [tool.poetry.dependencies] 8 | python = "^3.8" 9 | globus-sdk = { path = "../../.." } 10 | 11 | [tool.poetry.dev-dependencies] 12 | 13 | [build-system] 14 | requires = ["poetry-core>=1.0.0"] 15 | build-backend = "poetry.core.masonry.api" 16 | -------------------------------------------------------------------------------- /tests/stub-testmod.sh: -------------------------------------------------------------------------------- 1 | name="$1" 2 | cat > "test_$name.py" <", 0, object() 21 | ) 22 | assert len(nodes) == 1 23 | node = nodes[0] 24 | assert node["refuri"] == "https://docs.globus.org/api/baz/quxx" 25 | -------------------------------------------------------------------------------- /tests/unit/test_lazy_imports.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | def test_explicit_dir_func_works(): 7 | assert "TransferClient" in dir(globus_sdk) 8 | assert "__all__" in dir(globus_sdk) 9 | 10 | 11 | def test_force_eager_imports_can_run(): 12 | # this check will not do much, other than ensuring that this does not crash 13 | globus_sdk._force_eager_imports() 14 | 15 | 16 | def test_attribute_error_on_bad_name(): 17 | with pytest.raises(AttributeError) as excinfo: 18 | globus_sdk.DEIMOS_DOWN_REMOVE_ALL_PLANTS 19 | 20 | err = excinfo.value 21 | assert ( 22 | str(err) == "module globus_sdk has no attribute DEIMOS_DOWN_REMOVE_ALL_PLANTS" 23 | ) 24 | -------------------------------------------------------------------------------- /tests/unit/test_missing_type.py: -------------------------------------------------------------------------------- 1 | import copy 2 | import pickle 3 | 4 | import pytest 5 | 6 | from globus_sdk import utils 7 | 8 | 9 | def test_missing_type_cannot_be_instantiated(): 10 | with pytest.raises(TypeError, match="MissingType should not be instantiated"): 11 | utils.MissingType() 12 | 13 | 14 | def test_missing_sentinel_bools_as_false(): 15 | assert bool(utils.MISSING) is False 16 | 17 | 18 | def test_str_of_missing(): 19 | assert str(utils.MISSING) == "" 20 | 21 | 22 | def test_copy_of_missing_is_self(): 23 | assert copy.copy(utils.MISSING) is utils.MISSING 24 | assert copy.deepcopy(utils.MISSING) is utils.MISSING 25 | 26 | 27 | def test_pickle_of_missing_is_self(): 28 | assert pickle.loads(pickle.dumps(utils.MISSING)) is utils.MISSING 29 | -------------------------------------------------------------------------------- /tests/unit/test_timers_client.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import globus_sdk 4 | 5 | 6 | def test_create_job_rejects_transfer_timer(): 7 | client = globus_sdk.TimersClient() 8 | payload = globus_sdk.TransferTimer(schedule={"type": "once"}, body={}) 9 | 10 | with pytest.raises( 11 | globus_sdk.GlobusSDKUsageError, 12 | match=r"Cannot pass a TransferTimer to create_job\(\)\.", 13 | ): 14 | client.create_job(payload) 15 | 16 | 17 | def test_create_timer_rejects_timer_job(): 18 | client = globus_sdk.TimersClient() 19 | payload = globus_sdk.TimerJob("https://bogus", {}, "2021-01-01T00:00:00Z", 300) 20 | 21 | with pytest.raises( 22 | globus_sdk.GlobusSDKUsageError, 23 | match=r"Cannot pass a TimerJob to create_timer\(\)\.", 24 | ): 25 | client.create_timer(payload) 26 | -------------------------------------------------------------------------------- /tests/unit/transport/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/globus/globus-sdk-python/5fc4ef869fcbb43368c86f90ef621bb3503bafab/tests/unit/transport/__init__.py --------------------------------------------------------------------------------