capo-codecatalyst 0.3.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {capo_codecatalyst-0.3.0/src/capo_codecatalyst.egg-info → capo_codecatalyst-0.5.0}/PKG-INFO +2 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/pyproject.toml +2 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_auth/_sigv4.py +164 -19
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/create_access_token.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/create_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/create_project.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/create_source_repository.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/create_source_repository_branch.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_access_token.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_project.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_source_repository.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/delete_space.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_project.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_source_repository.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_source_repository_clone_urls.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_space.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_subscription.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_user_details.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_workflow.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/get_workflow_run.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_access_tokens.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_dev_environment_sessions.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_dev_environments.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_event_logs.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_projects.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_source_repositories.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_source_repository_branches.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_spaces.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_workflow_runs.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/list_workflows.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/start_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/start_dev_environment_session.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/start_workflow_run.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/stop_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/stop_dev_environment_session.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/update_dev_environment.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/update_project.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/update_space.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_operations/code_catalyst/verify_session.py +3 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_protocol/eventstream.py +15 -13
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_services/_pipeline.py +17 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0/src/capo_codecatalyst.egg-info}/PKG-INFO +2 -2
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/tests/test_sigv4.py +217 -16
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/LICENSE +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/README.md +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/setup.cfg +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/__init__.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_async.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_auth/_identity.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_auth/_providers.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_auth/_signers.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_auth/_zapros_handler.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_body.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_iter.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_pagination.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_protocol/__init__.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_protocol/errors.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_protocol/serialize.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_protocol/xml.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_resources/code_catalyst/access_token.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_resources/code_catalyst/space.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_rule_engine/__init__.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_rule_engine/_aws_partition.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_rule_engine/_endpoint_rule_set.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_rule_engine/_endpoint_runtime.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_services/_aws_config.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_services/async_code_catalyst.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/_services/code_catalyst.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/__init__.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/_base.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/access_denied_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/conflict_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/resource_not_found_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/service_quota_exceeded_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/throttling_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/errors/validation_exception.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/py.typed +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/_prelude/blob.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/_prelude/timestamp.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/access_token_id.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/access_token_name.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/access_token_secret.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/access_token_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/access_token_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/client_token.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/comparison_operator.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_access_token_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_access_token_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_project_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_project_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_source_repository_branch_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_source_repository_branch_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_source_repository_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/create_source_repository_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_access_token_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_access_token_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_project_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_project_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_source_repository_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_source_repository_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_space_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/delete_space_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_access_details.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_repository_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_repository_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_session_configuration.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_session_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_session_type.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_sessions_summary_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_status.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/dev_environment_summary_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/email_address.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/event_log_entries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/event_log_entry.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/event_payload.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/execute_command_session_configuration.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/execute_command_session_configuration_arguments.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/filter.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/filter_key.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/filters.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_project_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_project_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_source_repository_clone_urls_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_source_repository_clone_urls_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_source_repository_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_source_repository_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_space_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_space_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_subscription_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_subscription_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_user_details_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_user_details_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_workflow_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_workflow_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_workflow_run_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/get_workflow_run_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/ide.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/ide_configuration.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/ide_configuration_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/ides.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/inactivity_timeout_minutes.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/instance_type.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_access_tokens_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_access_tokens_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_dev_environment_sessions_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_dev_environment_sessions_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_dev_environments_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_dev_environments_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_event_logs_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_event_logs_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_projects_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_projects_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repositories_item.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repositories_items.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repositories_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repositories_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repository_branches_item.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repository_branches_items.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repository_branches_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_source_repository_branches_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_spaces_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_spaces_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_workflow_runs_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_workflow_runs_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_workflows_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/list_workflows_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/name_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/operation_type.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/persistent_storage.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/persistent_storage_configuration.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_description.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_display_name.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_information.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_list_filter.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_list_filters.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/project_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/region_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/repositories_input.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/repository_input.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/sensitive_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/source_repository_branch_ref_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/source_repository_branch_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/source_repository_description_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/source_repository_id_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/source_repository_name_string.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/space_description.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/space_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/space_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_dev_environment_session_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_dev_environment_session_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_workflow_run_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/start_workflow_run_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/status_reason.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/stop_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/stop_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/stop_dev_environment_session_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/stop_dev_environment_session_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/string_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/timestamp.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_dev_environment_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_dev_environment_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_project_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_project_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_space_request.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/update_space_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/user_identity.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/user_type.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/uuid.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/verify_session_response.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_definition.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_definition_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_mode.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_sort_criteria.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_sort_criteria_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_status.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_status_reason.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_status_reasons.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_run_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_sort_criteria.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_sort_criteria_list.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_status.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_summaries.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst/types/workflow_summary.py +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst.egg-info/SOURCES.txt +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst.egg-info/dependency_links.txt +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst.egg-info/requires.txt +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/src/capo_codecatalyst.egg-info/top_level.txt +0 -0
- {capo_codecatalyst-0.3.0 → capo_codecatalyst-0.5.0}/tests/test_body.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capo-codecatalyst
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Python SDK for Codecatalyst.
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Python SDK for AWS Codecatalyst.
|
|
5
5
|
Classifier: Development Status :: 4 - Beta
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""AWS Signature Version 4 — single-chunk signing.
|
|
1
|
+
"""AWS Signature Version 4 — single-chunk and event-stream signing.
|
|
2
2
|
|
|
3
3
|
Reference:
|
|
4
4
|
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html
|
|
@@ -15,7 +15,8 @@ import functools
|
|
|
15
15
|
import hashlib
|
|
16
16
|
import hmac
|
|
17
17
|
import re
|
|
18
|
-
from
|
|
18
|
+
from collections.abc import AsyncIterator, Iterator
|
|
19
|
+
from typing import Any, Literal, TypedDict, cast
|
|
19
20
|
from urllib.parse import quote, unquote
|
|
20
21
|
|
|
21
22
|
import zapros
|
|
@@ -23,6 +24,9 @@ from pywhatwgurl import URLSearchParams
|
|
|
23
24
|
from zapros import Headers, Request
|
|
24
25
|
from zapros._utils import get_host_header_value
|
|
25
26
|
|
|
27
|
+
from .._iter import AnyIterator
|
|
28
|
+
from .._protocol.eventstream import HeaderValue, Message, encode_headers
|
|
29
|
+
|
|
26
30
|
|
|
27
31
|
def build_sigv4_auth_scheme(
|
|
28
32
|
signing_name: str, region: str | None, endpoint_scheme: dict[str, Any] | None = None
|
|
@@ -65,6 +69,10 @@ class SigV4AuthContext(TypedDict):
|
|
|
65
69
|
|
|
66
70
|
|
|
67
71
|
_SIGV4_ALGORITHM = "AWS4-HMAC-SHA256"
|
|
72
|
+
# Per-event algorithm and request payload marker of a signed event stream.
|
|
73
|
+
_EVENT_ALGORITHM = "AWS4-HMAC-SHA256-PAYLOAD"
|
|
74
|
+
_EVENT_STREAM_PAYLOAD = "STREAMING-AWS4-HMAC-SHA256-EVENTS"
|
|
75
|
+
_AMZ_DATE_FORMAT = "%Y%m%dT%H%M%SZ"
|
|
68
76
|
_EMPTY_PAYLOAD_SHA256 = hashlib.sha256(b"").hexdigest()
|
|
69
77
|
|
|
70
78
|
# Headers excluded from the signed-headers set. Mirrors botocore's denylist:
|
|
@@ -95,9 +103,11 @@ _UNSIGNED_HEADERS = frozenset(
|
|
|
95
103
|
|
|
96
104
|
_MULTI_SPACE = re.compile(r" +")
|
|
97
105
|
|
|
98
|
-
# Services that require the payload hash to travel in ``x-amz-content-sha256
|
|
99
|
-
#
|
|
100
|
-
|
|
106
|
+
# Services that require the payload hash to travel in ``x-amz-content-sha256``
|
|
107
|
+
# on every request, and that accept ``UNSIGNED-PAYLOAD`` for any operation.
|
|
108
|
+
# Other services sign the hash into the canonical request without sending it,
|
|
109
|
+
# and only see the header when the payload is left unsigned.
|
|
110
|
+
S3_SIGNING_NAMES = frozenset({"s3", "s3express", "s3-outposts", "s3-object-lambda"})
|
|
101
111
|
|
|
102
112
|
|
|
103
113
|
def _uri_encode(value: str) -> str:
|
|
@@ -231,12 +241,20 @@ def _canonical_query_from_pairs(pairs: list[tuple[str, str]]) -> str:
|
|
|
231
241
|
def sign_sigv4(
|
|
232
242
|
request: Request,
|
|
233
243
|
ctx: SigV4AuthContext,
|
|
234
|
-
|
|
244
|
+
*,
|
|
245
|
+
unsigned_payload: bool = False,
|
|
246
|
+
event_stream: bool = False,
|
|
235
247
|
) -> Request:
|
|
236
248
|
"""Return a new ``Request`` carrying SigV4 single-chunk auth headers.
|
|
237
249
|
|
|
238
|
-
|
|
239
|
-
|
|
250
|
+
The payload hash covers ``request.body``, which must be ``bytes`` or
|
|
251
|
+
``None``. ``unsigned_payload`` signs ``UNSIGNED-PAYLOAD`` instead and
|
|
252
|
+
forwards any body unchanged (streaming S3 requests and operations carrying
|
|
253
|
+
``aws.auth#unsignedPayload``). ``event_stream`` signs a request event
|
|
254
|
+
stream: the ``STREAMING-AWS4-HMAC-SHA256-EVENTS`` marker stands in for the
|
|
255
|
+
payload hash and the body — an iterator of encoded event messages — is
|
|
256
|
+
wrapped in an :class:`EventStreamIterator` that signs every event with a
|
|
257
|
+
signature chained from this request's.
|
|
240
258
|
"""
|
|
241
259
|
service = ctx["signing_name"]
|
|
242
260
|
region = ctx["signing_region"]
|
|
@@ -250,21 +268,31 @@ def sign_sigv4(
|
|
|
250
268
|
date_stamp = amz_date[:8]
|
|
251
269
|
else:
|
|
252
270
|
now = _amz_now()
|
|
253
|
-
amz_date = now.strftime(
|
|
271
|
+
amz_date = now.strftime(_AMZ_DATE_FORMAT)
|
|
254
272
|
date_stamp = now.strftime("%Y%m%d")
|
|
255
273
|
headers["X-Amz-Date"] = amz_date
|
|
256
274
|
|
|
257
|
-
# Payload hash. For S3-family services, x-amz-content-sha256 is mandatory
|
|
258
|
-
#
|
|
275
|
+
# Payload hash. For S3-family services, x-amz-content-sha256 is mandatory;
|
|
276
|
+
# for every service it is the only way to announce an unsigned payload or
|
|
277
|
+
# an event stream.
|
|
278
|
+
# Either way it must be set BEFORE computing the canonical request (it
|
|
279
|
+
# gets signed).
|
|
259
280
|
payload_hash = headers.get("X-Amz-Content-SHA256")
|
|
260
281
|
if payload_hash is None:
|
|
261
|
-
if
|
|
282
|
+
if event_stream:
|
|
283
|
+
payload_hash = _EVENT_STREAM_PAYLOAD
|
|
284
|
+
elif unsigned_payload:
|
|
262
285
|
payload_hash = "UNSIGNED-PAYLOAD"
|
|
286
|
+
elif request.body is None:
|
|
287
|
+
payload_hash = _EMPTY_PAYLOAD_SHA256
|
|
288
|
+
elif isinstance(request.body, bytes):
|
|
289
|
+
payload_hash = hashlib.sha256(request.body).hexdigest()
|
|
263
290
|
else:
|
|
264
|
-
|
|
265
|
-
|
|
291
|
+
raise TypeError(
|
|
292
|
+
"sign_sigv4 hashes a bytes body only; pass unsigned_payload=True "
|
|
293
|
+
"to send a streamed body without a payload hash"
|
|
266
294
|
)
|
|
267
|
-
if service in
|
|
295
|
+
if service in S3_SIGNING_NAMES or unsigned_payload or event_stream:
|
|
268
296
|
headers["X-Amz-Content-SHA256"] = payload_hash
|
|
269
297
|
|
|
270
298
|
# Session token (STS / assumed-role credentials).
|
|
@@ -308,18 +336,135 @@ def sign_sigv4(
|
|
|
308
336
|
f"Signature={signature}"
|
|
309
337
|
)
|
|
310
338
|
|
|
311
|
-
|
|
312
|
-
if
|
|
339
|
+
body = request.body
|
|
340
|
+
if event_stream:
|
|
341
|
+
if not isinstance(body, (Iterator, AsyncIterator)):
|
|
342
|
+
raise TypeError(
|
|
343
|
+
"event_stream requires an iterator of encoded events as the body"
|
|
344
|
+
)
|
|
345
|
+
body = EventStreamIterator(
|
|
346
|
+
cast("Iterator[bytes] | AsyncIterator[bytes]", body), ctx, signature
|
|
347
|
+
)
|
|
348
|
+
if body is not None:
|
|
313
349
|
return Request(
|
|
314
350
|
request.url,
|
|
315
351
|
request.method,
|
|
316
352
|
headers,
|
|
317
|
-
body=
|
|
353
|
+
body=body,
|
|
318
354
|
context=request.context,
|
|
319
355
|
)
|
|
320
356
|
return Request(request.url, request.method, headers, context=request.context)
|
|
321
357
|
|
|
322
358
|
|
|
359
|
+
def _sign_event(
|
|
360
|
+
ctx: SigV4AuthContext, prior_signature: str, payload: bytes
|
|
361
|
+
) -> tuple[bytes, str]:
|
|
362
|
+
"""Wrap one encoded event in a signed outer message.
|
|
363
|
+
|
|
364
|
+
Returns ``(frame, signature)``; the hex signature seeds the next event.
|
|
365
|
+
The string to sign chains every frame to its predecessor — the first one
|
|
366
|
+
to the request's ``Authorization`` signature — so the service can verify
|
|
367
|
+
the stream incrementally::
|
|
368
|
+
|
|
369
|
+
AWS4-HMAC-SHA256-PAYLOAD
|
|
370
|
+
<date, YYYYMMDDTHHMMSSZ>
|
|
371
|
+
<credential scope>
|
|
372
|
+
<prior signature, hex>
|
|
373
|
+
<hex sha256 of the encoded ``:date`` header>
|
|
374
|
+
<hex sha256 of the payload>
|
|
375
|
+
|
|
376
|
+
The AWS SDKs (and the service) use the ``-PAYLOAD`` algorithm name; the
|
|
377
|
+
Transcribe developer guide's pseudocode omits the suffix.
|
|
378
|
+
"""
|
|
379
|
+
service = ctx["signing_name"]
|
|
380
|
+
region = ctx["signing_region"]
|
|
381
|
+
now = _amz_now()
|
|
382
|
+
amz_date = now.strftime(_AMZ_DATE_FORMAT)
|
|
383
|
+
date_stamp = amz_date[:8]
|
|
384
|
+
credential_scope = f"{date_stamp}/{region}/{service}/aws4_request"
|
|
385
|
+
date_header: dict[str, HeaderValue] = {":date": now}
|
|
386
|
+
string_to_sign = "\n".join(
|
|
387
|
+
(
|
|
388
|
+
_EVENT_ALGORITHM,
|
|
389
|
+
amz_date,
|
|
390
|
+
credential_scope,
|
|
391
|
+
prior_signature,
|
|
392
|
+
hashlib.sha256(encode_headers(date_header)).hexdigest(),
|
|
393
|
+
hashlib.sha256(payload).hexdigest(),
|
|
394
|
+
)
|
|
395
|
+
)
|
|
396
|
+
signing_key = _derive_signing_key(
|
|
397
|
+
ctx["secret_access_key"], date_stamp, region, service
|
|
398
|
+
)
|
|
399
|
+
signature = hmac.new(
|
|
400
|
+
signing_key, string_to_sign.encode("utf-8"), hashlib.sha256
|
|
401
|
+
).hexdigest()
|
|
402
|
+
frame = Message(
|
|
403
|
+
{**date_header, ":chunk-signature": bytes.fromhex(signature)}, payload
|
|
404
|
+
).encode()
|
|
405
|
+
return frame, signature
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class EventStreamIterator(AnyIterator[bytes]):
|
|
409
|
+
"""Sign a request event stream, one frame per event.
|
|
410
|
+
|
|
411
|
+
Wraps an iterator of encoded event messages (as produced by the generated
|
|
412
|
+
``serialize_event_*`` functions). Each event becomes the payload of an
|
|
413
|
+
outer message carrying ``:date`` and ``:chunk-signature`` headers, the
|
|
414
|
+
signature chained from the previous frame's and seeded by the request's
|
|
415
|
+
``Authorization`` signature. Once the events are exhausted, one empty
|
|
416
|
+
signed frame is yielded to mark the end of the stream.
|
|
417
|
+
|
|
418
|
+
Like :class:`~capo._body.Body`, it is both a sync and an async iterator:
|
|
419
|
+
iterate it the way the wrapped source is iterable (``next`` over a sync
|
|
420
|
+
source, ``async for`` over an async one).
|
|
421
|
+
|
|
422
|
+
Reference:
|
|
423
|
+
https://docs.aws.amazon.com/transcribe/latest/dg/streaming-setting-up.html
|
|
424
|
+
"""
|
|
425
|
+
|
|
426
|
+
def __init__(
|
|
427
|
+
self,
|
|
428
|
+
events: Iterator[bytes] | AsyncIterator[bytes],
|
|
429
|
+
ctx: SigV4AuthContext,
|
|
430
|
+
seed_signature: str,
|
|
431
|
+
) -> None:
|
|
432
|
+
self._events = events
|
|
433
|
+
self._ctx = ctx
|
|
434
|
+
self._prior_signature = seed_signature
|
|
435
|
+
self._ended = False
|
|
436
|
+
|
|
437
|
+
def _frame(self, payload: bytes) -> bytes:
|
|
438
|
+
frame, self._prior_signature = _sign_event(
|
|
439
|
+
self._ctx, self._prior_signature, payload
|
|
440
|
+
)
|
|
441
|
+
return frame
|
|
442
|
+
|
|
443
|
+
def __next__(self) -> bytes:
|
|
444
|
+
if self._ended:
|
|
445
|
+
raise StopIteration
|
|
446
|
+
if not isinstance(self._events, Iterator):
|
|
447
|
+
raise TypeError("this event stream wraps an async source; use `async for`")
|
|
448
|
+
try:
|
|
449
|
+
payload = next(cast(Iterator[bytes], self._events))
|
|
450
|
+
except StopIteration:
|
|
451
|
+
self._ended = True
|
|
452
|
+
payload = b""
|
|
453
|
+
return self._frame(payload)
|
|
454
|
+
|
|
455
|
+
async def __anext__(self) -> bytes:
|
|
456
|
+
if self._ended:
|
|
457
|
+
raise StopAsyncIteration
|
|
458
|
+
if not isinstance(self._events, AsyncIterator):
|
|
459
|
+
raise TypeError("this event stream wraps a sync source; use `for`")
|
|
460
|
+
try:
|
|
461
|
+
payload = await cast(AsyncIterator[bytes], self._events).__anext__()
|
|
462
|
+
except StopAsyncIteration:
|
|
463
|
+
self._ended = True
|
|
464
|
+
payload = b""
|
|
465
|
+
return self._frame(payload)
|
|
466
|
+
|
|
467
|
+
|
|
323
468
|
def presign_sigv4(
|
|
324
469
|
request: Request,
|
|
325
470
|
ctx: SigV4AuthContext,
|
|
@@ -346,7 +491,7 @@ def presign_sigv4(
|
|
|
346
491
|
service = ctx["signing_name"]
|
|
347
492
|
region = ctx["signing_region"]
|
|
348
493
|
|
|
349
|
-
amz_date = sign_time.strftime(
|
|
494
|
+
amz_date = sign_time.strftime(_AMZ_DATE_FORMAT)
|
|
350
495
|
date_stamp = sign_time.strftime("%Y%m%d")
|
|
351
496
|
credential_scope = f"{date_stamp}/{region}/{service}/aws4_request"
|
|
352
497
|
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -128,7 +129,7 @@ def create_access_token(
|
|
|
128
129
|
try:
|
|
129
130
|
if response.status >= 300:
|
|
130
131
|
response.read()
|
|
131
|
-
|
|
132
|
+
raise_error(response, handle_error)
|
|
132
133
|
return handle_response(response), response
|
|
133
134
|
except BaseException:
|
|
134
135
|
response.close()
|
|
@@ -146,7 +147,7 @@ async def async_create_access_token(
|
|
|
146
147
|
try:
|
|
147
148
|
if response.status >= 300:
|
|
148
149
|
await response.aread()
|
|
149
|
-
|
|
150
|
+
raise_error(response, handle_error)
|
|
150
151
|
return await async_handle_response(response), response
|
|
151
152
|
except BaseException:
|
|
152
153
|
await response.aclose()
|
|
@@ -28,6 +28,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
28
28
|
from capo_codecatalyst._services._pipeline import (
|
|
29
29
|
AsyncOperationOptions,
|
|
30
30
|
OperationOptions,
|
|
31
|
+
raise_error,
|
|
31
32
|
)
|
|
32
33
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
33
34
|
|
|
@@ -140,7 +141,7 @@ def create_dev_environment(
|
|
|
140
141
|
try:
|
|
141
142
|
if response.status >= 300:
|
|
142
143
|
response.read()
|
|
143
|
-
|
|
144
|
+
raise_error(response, handle_error)
|
|
144
145
|
return handle_response(response), response
|
|
145
146
|
except BaseException:
|
|
146
147
|
response.close()
|
|
@@ -158,7 +159,7 @@ async def async_create_dev_environment(
|
|
|
158
159
|
try:
|
|
159
160
|
if response.status >= 300:
|
|
160
161
|
await response.aread()
|
|
161
|
-
|
|
162
|
+
raise_error(response, handle_error)
|
|
162
163
|
return await async_handle_response(response), response
|
|
163
164
|
except BaseException:
|
|
164
165
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -133,7 +134,7 @@ def create_project(
|
|
|
133
134
|
try:
|
|
134
135
|
if response.status >= 300:
|
|
135
136
|
response.read()
|
|
136
|
-
|
|
137
|
+
raise_error(response, handle_error)
|
|
137
138
|
return handle_response(response), response
|
|
138
139
|
except BaseException:
|
|
139
140
|
response.close()
|
|
@@ -151,7 +152,7 @@ async def async_create_project(
|
|
|
151
152
|
try:
|
|
152
153
|
if response.status >= 300:
|
|
153
154
|
await response.aread()
|
|
154
|
-
|
|
155
|
+
raise_error(response, handle_error)
|
|
155
156
|
return await async_handle_response(response), response
|
|
156
157
|
except BaseException:
|
|
157
158
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -134,7 +135,7 @@ def create_source_repository(
|
|
|
134
135
|
try:
|
|
135
136
|
if response.status >= 300:
|
|
136
137
|
response.read()
|
|
137
|
-
|
|
138
|
+
raise_error(response, handle_error)
|
|
138
139
|
return handle_response(response), response
|
|
139
140
|
except BaseException:
|
|
140
141
|
response.close()
|
|
@@ -152,7 +153,7 @@ async def async_create_source_repository(
|
|
|
152
153
|
try:
|
|
153
154
|
if response.status >= 300:
|
|
154
155
|
await response.aread()
|
|
155
|
-
|
|
156
|
+
raise_error(response, handle_error)
|
|
156
157
|
return await async_handle_response(response), response
|
|
157
158
|
except BaseException:
|
|
158
159
|
await response.aclose()
|
|
@@ -26,6 +26,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
26
26
|
from capo_codecatalyst._services._pipeline import (
|
|
27
27
|
AsyncOperationOptions,
|
|
28
28
|
OperationOptions,
|
|
29
|
+
raise_error,
|
|
29
30
|
)
|
|
30
31
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
31
32
|
|
|
@@ -140,7 +141,7 @@ def create_source_repository_branch(
|
|
|
140
141
|
try:
|
|
141
142
|
if response.status >= 300:
|
|
142
143
|
response.read()
|
|
143
|
-
|
|
144
|
+
raise_error(response, handle_error)
|
|
144
145
|
return handle_response(response), response
|
|
145
146
|
except BaseException:
|
|
146
147
|
response.close()
|
|
@@ -158,7 +159,7 @@ async def async_create_source_repository_branch(
|
|
|
158
159
|
try:
|
|
159
160
|
if response.status >= 300:
|
|
160
161
|
await response.aread()
|
|
161
|
-
|
|
162
|
+
raise_error(response, handle_error)
|
|
162
163
|
return await async_handle_response(response), response
|
|
163
164
|
except BaseException:
|
|
164
165
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -121,7 +122,7 @@ def delete_access_token(
|
|
|
121
122
|
try:
|
|
122
123
|
if response.status >= 300:
|
|
123
124
|
response.read()
|
|
124
|
-
|
|
125
|
+
raise_error(response, handle_error)
|
|
125
126
|
return handle_response(response), response
|
|
126
127
|
except BaseException:
|
|
127
128
|
response.close()
|
|
@@ -139,7 +140,7 @@ async def async_delete_access_token(
|
|
|
139
140
|
try:
|
|
140
141
|
if response.status >= 300:
|
|
141
142
|
await response.aread()
|
|
142
|
-
|
|
143
|
+
raise_error(response, handle_error)
|
|
143
144
|
return await async_handle_response(response), response
|
|
144
145
|
except BaseException:
|
|
145
146
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -134,7 +135,7 @@ def delete_dev_environment(
|
|
|
134
135
|
try:
|
|
135
136
|
if response.status >= 300:
|
|
136
137
|
response.read()
|
|
137
|
-
|
|
138
|
+
raise_error(response, handle_error)
|
|
138
139
|
return handle_response(response), response
|
|
139
140
|
except BaseException:
|
|
140
141
|
response.close()
|
|
@@ -152,7 +153,7 @@ async def async_delete_dev_environment(
|
|
|
152
153
|
try:
|
|
153
154
|
if response.status >= 300:
|
|
154
155
|
await response.aread()
|
|
155
|
-
|
|
156
|
+
raise_error(response, handle_error)
|
|
156
157
|
return await async_handle_response(response), response
|
|
157
158
|
except BaseException:
|
|
158
159
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -130,7 +131,7 @@ def delete_project(
|
|
|
130
131
|
try:
|
|
131
132
|
if response.status >= 300:
|
|
132
133
|
response.read()
|
|
133
|
-
|
|
134
|
+
raise_error(response, handle_error)
|
|
134
135
|
return handle_response(response), response
|
|
135
136
|
except BaseException:
|
|
136
137
|
response.close()
|
|
@@ -148,7 +149,7 @@ async def async_delete_project(
|
|
|
148
149
|
try:
|
|
149
150
|
if response.status >= 300:
|
|
150
151
|
await response.aread()
|
|
151
|
-
|
|
152
|
+
raise_error(response, handle_error)
|
|
152
153
|
return await async_handle_response(response), response
|
|
153
154
|
except BaseException:
|
|
154
155
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -130,7 +131,7 @@ def delete_source_repository(
|
|
|
130
131
|
try:
|
|
131
132
|
if response.status >= 300:
|
|
132
133
|
response.read()
|
|
133
|
-
|
|
134
|
+
raise_error(response, handle_error)
|
|
134
135
|
return handle_response(response), response
|
|
135
136
|
except BaseException:
|
|
136
137
|
response.close()
|
|
@@ -148,7 +149,7 @@ async def async_delete_source_repository(
|
|
|
148
149
|
try:
|
|
149
150
|
if response.status >= 300:
|
|
150
151
|
await response.aread()
|
|
151
|
-
|
|
152
|
+
raise_error(response, handle_error)
|
|
152
153
|
return await async_handle_response(response), response
|
|
153
154
|
except BaseException:
|
|
154
155
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -128,7 +129,7 @@ def delete_space(
|
|
|
128
129
|
try:
|
|
129
130
|
if response.status >= 300:
|
|
130
131
|
response.read()
|
|
131
|
-
|
|
132
|
+
raise_error(response, handle_error)
|
|
132
133
|
return handle_response(response), response
|
|
133
134
|
except BaseException:
|
|
134
135
|
response.close()
|
|
@@ -145,7 +146,7 @@ async def async_delete_space(
|
|
|
145
146
|
try:
|
|
146
147
|
if response.status >= 300:
|
|
147
148
|
await response.aread()
|
|
148
|
-
|
|
149
|
+
raise_error(response, handle_error)
|
|
149
150
|
return await async_handle_response(response), response
|
|
150
151
|
except BaseException:
|
|
151
152
|
await response.aclose()
|
|
@@ -29,6 +29,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
29
29
|
from capo_codecatalyst._services._pipeline import (
|
|
30
30
|
AsyncOperationOptions,
|
|
31
31
|
OperationOptions,
|
|
32
|
+
raise_error,
|
|
32
33
|
)
|
|
33
34
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
34
35
|
|
|
@@ -134,7 +135,7 @@ def get_dev_environment(
|
|
|
134
135
|
try:
|
|
135
136
|
if response.status >= 300:
|
|
136
137
|
response.read()
|
|
137
|
-
|
|
138
|
+
raise_error(response, handle_error)
|
|
138
139
|
return handle_response(response), response
|
|
139
140
|
except BaseException:
|
|
140
141
|
response.close()
|
|
@@ -152,7 +153,7 @@ async def async_get_dev_environment(
|
|
|
152
153
|
try:
|
|
153
154
|
if response.status >= 300:
|
|
154
155
|
await response.aread()
|
|
155
|
-
|
|
156
|
+
raise_error(response, handle_error)
|
|
156
157
|
return await async_handle_response(response), response
|
|
157
158
|
except BaseException:
|
|
158
159
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -129,7 +130,7 @@ def get_project(
|
|
|
129
130
|
try:
|
|
130
131
|
if response.status >= 300:
|
|
131
132
|
response.read()
|
|
132
|
-
|
|
133
|
+
raise_error(response, handle_error)
|
|
133
134
|
return handle_response(response), response
|
|
134
135
|
except BaseException:
|
|
135
136
|
response.close()
|
|
@@ -146,7 +147,7 @@ async def async_get_project(
|
|
|
146
147
|
try:
|
|
147
148
|
if response.status >= 300:
|
|
148
149
|
await response.aread()
|
|
149
|
-
|
|
150
|
+
raise_error(response, handle_error)
|
|
150
151
|
return await async_handle_response(response), response
|
|
151
152
|
except BaseException:
|
|
152
153
|
await response.aclose()
|
|
@@ -26,6 +26,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
26
26
|
from capo_codecatalyst._services._pipeline import (
|
|
27
27
|
AsyncOperationOptions,
|
|
28
28
|
OperationOptions,
|
|
29
|
+
raise_error,
|
|
29
30
|
)
|
|
30
31
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
31
32
|
|
|
@@ -131,7 +132,7 @@ def get_source_repository(
|
|
|
131
132
|
try:
|
|
132
133
|
if response.status >= 300:
|
|
133
134
|
response.read()
|
|
134
|
-
|
|
135
|
+
raise_error(response, handle_error)
|
|
135
136
|
return handle_response(response), response
|
|
136
137
|
except BaseException:
|
|
137
138
|
response.close()
|
|
@@ -149,7 +150,7 @@ async def async_get_source_repository(
|
|
|
149
150
|
try:
|
|
150
151
|
if response.status >= 300:
|
|
151
152
|
await response.aread()
|
|
152
|
-
|
|
153
|
+
raise_error(response, handle_error)
|
|
153
154
|
return await async_handle_response(response), response
|
|
154
155
|
except BaseException:
|
|
155
156
|
await response.aclose()
|
|
@@ -25,6 +25,7 @@ from capo_codecatalyst._rule_engine._endpoint_rule_set import EndpointParams, re
|
|
|
25
25
|
from capo_codecatalyst._services._pipeline import (
|
|
26
26
|
AsyncOperationOptions,
|
|
27
27
|
OperationOptions,
|
|
28
|
+
raise_error,
|
|
28
29
|
)
|
|
29
30
|
from capo_codecatalyst.errors import UnknownServiceError
|
|
30
31
|
|
|
@@ -132,7 +133,7 @@ def get_source_repository_clone_urls(
|
|
|
132
133
|
try:
|
|
133
134
|
if response.status >= 300:
|
|
134
135
|
response.read()
|
|
135
|
-
|
|
136
|
+
raise_error(response, handle_error)
|
|
136
137
|
return handle_response(response), response
|
|
137
138
|
except BaseException:
|
|
138
139
|
response.close()
|
|
@@ -150,7 +151,7 @@ async def async_get_source_repository_clone_urls(
|
|
|
150
151
|
try:
|
|
151
152
|
if response.status >= 300:
|
|
152
153
|
await response.aread()
|
|
153
|
-
|
|
154
|
+
raise_error(response, handle_error)
|
|
154
155
|
return await async_handle_response(response), response
|
|
155
156
|
except BaseException:
|
|
156
157
|
await response.aclose()
|