From 97fdf3891fe0295e3ecab0e0a83f0ff0ab24d9ce Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 19 Nov 2024 09:10:53 +0100 Subject: [PATCH 01/16] Native sync working --- pubnub/request_handlers/requests_handler.py | 23 ++++++++++--------- setup.py | 1 + .../native_sync/test_file_upload.py | 6 +++-- .../integrational/native_sync/test_publish.py | 6 ++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/pubnub/request_handlers/requests_handler.py b/pubnub/request_handlers/requests_handler.py index 1b29068d..5c1fff13 100644 --- a/pubnub/request_handlers/requests_handler.py +++ b/pubnub/request_handlers/requests_handler.py @@ -1,6 +1,7 @@ import logging import threading import requests +import httpx import json # noqa # pylint: disable=W0611 import urllib @@ -30,12 +31,13 @@ class RequestsRequestHandler(BaseRequestHandler): ENDPOINT_THREAD_COUNTER: int = 0 def __init__(self, pubnub): - self.session = Session() + self.session = httpx.Client() + # self.session = Session() - self.session.mount('http://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) - self.session.mount('https://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) - self.session.mount('http://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) - self.session.mount('https://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) + # self.session.mount('http://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) + # self.session.mount('https://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) + # self.session.mount('http://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) + # self.session.mount('https://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) self.pubnub = pubnub @@ -154,8 +156,7 @@ def _build_envelope(self, p_options, e_options): exception=e)) if res is not None: - url = urllib.parse.urlparse(res.url) - query = urllib.parse.parse_qs(url.query) + query = urllib.parse.parse_qs(res.url.query) uuid = None auth_key = None @@ -167,14 +168,14 @@ def _build_envelope(self, p_options, e_options): response_info = ResponseInfo( status_code=res.status_code, - tls_enabled='https' == url.scheme, - origin=url.hostname, + tls_enabled='https' == res.url.scheme, + origin=res.url.host, uuid=uuid, auth_key=auth_key, client_request=res.request ) - if not res.ok: + if res.status_code not in [200, 204, 307]: if res.status_code == 403: status_category = PNStatusCategory.PNAccessDeniedCategory @@ -241,7 +242,7 @@ def _invoke_request(self, p_options, e_options, base_origin): "url": url, "params": e_options.query_string, "timeout": (e_options.connect_timeout, e_options.request_timeout), - "allow_redirects": e_options.allow_redirects + "follow_redirects": e_options.allow_redirects } if e_options.is_post() or e_options.is_patch(): diff --git a/setup.py b/setup.py index decc04cd..6c86c082 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ install_requires=[ 'pycryptodomex>=3.3', 'requests>=2.4', + 'httpx>=0.18', 'cbor2', 'aiohttp' ], diff --git a/tests/integrational/native_sync/test_file_upload.py b/tests/integrational/native_sync/test_file_upload.py index aba1484c..19f8fedf 100644 --- a/tests/integrational/native_sync/test_file_upload.py +++ b/tests/integrational/native_sync/test_file_upload.py @@ -1,5 +1,6 @@ from urllib.parse import parse_qs, urlparse import pytest +import urllib from Cryptodome.Cipher import AES from unittest.mock import patch @@ -153,7 +154,7 @@ def test_get_file_url_has_auth_key_in_url_and_signature(file_upload_test_data): .file_id("random_file_id") \ .file_name("random_file_name").sync() - assert "auth=test_auth_key" in file_url_envelope.status.client_request.url + assert "auth=test_auth_key" in str(file_url_envelope.status.client_request.url) @pn_vcr.use_cassette( @@ -220,7 +221,8 @@ def test_publish_file_message_with_overriding_time_token(): .ttl(222).sync() assert isinstance(envelope.result, PNPublishFileMessageResult) - assert "ptto" in envelope.status.client_request.url + + assert "ptto" in urllib.parse.parse_qs(envelope.status.client_request.url.query.decode()) @pn_vcr.use_cassette( diff --git a/tests/integrational/native_sync/test_publish.py b/tests/integrational/native_sync/test_publish.py index ea85353d..9eac37cc 100644 --- a/tests/integrational/native_sync/test_publish.py +++ b/tests/integrational/native_sync/test_publish.py @@ -1,6 +1,6 @@ import logging import unittest -from urllib.parse import parse_qs, urlparse +import urllib import pubnub from pubnub.exceptions import PubNubException @@ -328,8 +328,8 @@ def test_publish_with_ptto_and_replicate(self): .sync() assert isinstance(env.result, PNPublishResult) - assert "ptto" in env.status.client_request.url - assert "norep" in env.status.client_request.url + assert "ptto" in urllib.parse.parse_qs(env.status.client_request.url.query.decode()) + assert "norep" in urllib.parse.parse_qs(env.status.client_request.url.query.decode()) @pn_vcr.use_cassette( 'tests/integrational/fixtures/native_sync/publish/publish_with_single_quote_message.yaml', From 8e4e7117620297a6b34c068482e0b6de9100b245 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 3 Dec 2024 10:25:37 +0100 Subject: [PATCH 02/16] WIP --- .../file_operations/send_file_asyncio.py | 11 - pubnub/pubnub_asyncio.py | 42 +-- pubnub/request_handlers/requests_handler.py | 2 - .../integrational/asyncio/test_file_upload.py | 66 +++-- .../integrational/asyncio/test_invocations.py | 4 +- tests/integrational/asyncio/test_publish.py | 36 +-- .../asyncio/file_upload/delete_file.json | 186 +++++++++++++ .../file_upload/fetch_s3_upload_data.json | 49 ++++ .../asyncio/file_upload/get_file_url.json | 189 +++++++++++++ .../asyncio/file_upload/list_files.json | 46 ++++ .../publish_file_message_encrypted.json | 52 ++++ .../file_upload/send_and_download_file.json | 254 ++++++++++++++++++ .../asyncio/publish/do_not_store.json | 22 +- .../fixtures/asyncio/publish/invalid_key.json | 22 +- .../fixtures/asyncio/publish/meta_object.json | 22 +- .../asyncio/publish/mixed_via_get.json | 88 ++++-- .../publish/mixed_via_get_encrypted.json | 88 ++++-- .../asyncio/publish/mixed_via_post.json | 104 +++++-- .../publish/mixed_via_post_encrypted.json | 108 ++++++-- .../asyncio/publish/not_permitted.json | 22 +- .../asyncio/publish/object_via_get.json | 22 +- .../publish/object_via_get_encrypted.json | 22 +- .../asyncio/publish/object_via_post.json | 25 +- .../publish/object_via_post_encrypted.json | 25 +- .../where_now/multiple_channels.yaml | 117 -------- .../where_now/single_channel.yaml | 117 -------- .../native_threads/test_where_now.py | 20 +- tests/pytest.ini | 2 + 28 files changed, 1306 insertions(+), 457 deletions(-) create mode 100644 tests/integrational/fixtures/asyncio/file_upload/delete_file.json create mode 100644 tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.json create mode 100644 tests/integrational/fixtures/asyncio/file_upload/get_file_url.json create mode 100644 tests/integrational/fixtures/asyncio/file_upload/list_files.json create mode 100644 tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.json create mode 100644 tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json delete mode 100644 tests/integrational/fixtures/native_threads/where_now/multiple_channels.yaml delete mode 100644 tests/integrational/fixtures/native_threads/where_now/single_channel.yaml diff --git a/pubnub/endpoints/file_operations/send_file_asyncio.py b/pubnub/endpoints/file_operations/send_file_asyncio.py index 5934cf21..5ecf7db0 100644 --- a/pubnub/endpoints/file_operations/send_file_asyncio.py +++ b/pubnub/endpoints/file_operations/send_file_asyncio.py @@ -1,20 +1,9 @@ -import aiohttp - from pubnub.endpoints.file_operations.send_file import SendFileNative from pubnub.endpoints.file_operations.publish_file_message import PublishFileMessage from pubnub.endpoints.file_operations.fetch_upload_details import FetchFileUploadS3Data class AsyncioSendFile(SendFileNative): - def build_file_upload_request(self): - file = self.encrypt_payload() - form_data = aiohttp.FormData() - for form_field in self._file_upload_envelope.result.data["form_fields"]: - form_data.add_field(form_field["key"], form_field["value"], content_type="multipart/form-data") - form_data.add_field("file", file, filename=self._file_name, content_type="application/octet-stream") - - return form_data - def options(self): request_options = super(SendFileNative, self).options() request_options.data = request_options.files diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index 0d44e818..f51c0acd 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -1,7 +1,7 @@ import logging import json import asyncio -import aiohttp +import httpx import math import time import urllib @@ -45,7 +45,10 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None): self._connector = None self._session = None - self._connector = aiohttp.TCPConnector(verify_ssl=True, loop=self.event_loop) + self._connector = httpx.AsyncHTTPTransport() + + if not hasattr(self._connector, 'close'): + self._connector.close = self._connector.aclose if not subscription_manager: subscription_manager = EventEngineSubscriptionManager @@ -62,19 +65,17 @@ async def close_pending_tasks(self, tasks): await asyncio.sleep(0.1) async def create_session(self): - if not self._session: - self._session = aiohttp.ClientSession( - loop=self.event_loop, - timeout=aiohttp.ClientTimeout(connect=self.config.connect_timeout), - connector=self._connector - ) + self._session = httpx.AsyncClient( + timeout=httpx.Timeout(self.config.connect_timeout), + transport=self._connector + ) async def close_session(self): if self._session is not None: - await self._session.close() + await self._session.aclose() async def set_connector(self, cn): - await self._session.close() + await self._session.aclose() self._connector = cn await self.create_session() @@ -171,7 +172,7 @@ async def _request_helper(self, options_func, cancellation_event): else: url = utils.build_url(scheme="", origin="", path=options.path, params=options.query_string) - url = URL(url, encoded=True) + url = str(URL(url, encoded=True)) logger.debug("%s %s %s" % (options.method_string, url, options.data)) if options.request_headers: @@ -189,7 +190,7 @@ async def _request_helper(self, options_func, cancellation_event): url, headers=request_headers, data=options.data if options.data else None, - allow_redirects=options.allow_redirects + follow_redirects=options.allow_redirects ), options.request_timeout ) @@ -199,13 +200,14 @@ async def _request_helper(self, options_func, cancellation_event): logger.error("session.request exception: %s" % str(e)) raise + response_body = response.read() if not options.non_json_response: - body = await response.text() + body = response_body else: if isinstance(response.content, bytes): body = response.content # TODO: simplify this logic within the v5 release else: - body = await response.read() + body = response_body if cancellation_event is not None and cancellation_event.is_set(): return @@ -226,7 +228,7 @@ async def _request_helper(self, options_func, cancellation_event): auth_key = query['auth_key'][0] response_info = ResponseInfo( - status_code=response.status, + status_code=response.status_code, tls_enabled='https' == request_url.scheme, origin=request_url.hostname, uuid=uuid, @@ -265,17 +267,17 @@ async def _request_helper(self, options_func, cancellation_event): logger.debug(data) - if response.status not in (200, 307, 204): + if response.status_code not in (200, 307, 204): - if response.status >= 500: + if response.status_code >= 500: err = PNERR_SERVER_ERROR else: err = PNERR_CLIENT_ERROR - if response.status == 403: + if response.status_code == 403: status_category = PNStatusCategory.PNAccessDeniedCategory - if response.status == 400: + if response.status_code == 400: status_category = PNStatusCategory.PNBadRequestCategory raise create_exception( @@ -285,7 +287,7 @@ async def _request_helper(self, options_func, cancellation_event): exception=PubNubException( errormsg=data, pn_error=err, - status_code=response.status + status_code=response.status_code ) ) else: diff --git a/pubnub/request_handlers/requests_handler.py b/pubnub/request_handlers/requests_handler.py index 5c1fff13..a1ef6fd3 100644 --- a/pubnub/request_handlers/requests_handler.py +++ b/pubnub/request_handlers/requests_handler.py @@ -5,8 +5,6 @@ import json # noqa # pylint: disable=W0611 import urllib -from requests import Session -from requests.adapters import HTTPAdapter from pubnub import utils from pubnub.enums import PNStatusCategory diff --git a/tests/integrational/asyncio/test_file_upload.py b/tests/integrational/asyncio/test_file_upload.py index b4decfd4..738d1e8c 100644 --- a/tests/integrational/asyncio/test_file_upload.py +++ b/tests/integrational/asyncio/test_file_upload.py @@ -3,7 +3,7 @@ from unittest.mock import patch from pubnub.pubnub_asyncio import PubNubAsyncio from tests.integrational.vcr_helper import pn_vcr -from tests.helper import pnconf_file_copy, pnconf_enc_env_copy +from tests.helper import pnconf_env_copy, pnconf_enc_env_copy from pubnub.endpoints.file_operations.publish_file_message import PublishFileMessage from pubnub.models.consumer.file import ( PNSendFileResult, PNGetFilesResult, PNDownloadFileResult, @@ -33,12 +33,12 @@ async def send_file(pubnub, file_for_upload, cipher_key=None): @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/delete_file.yaml", + "tests/integrational/fixtures/asyncio/file_upload/delete_file.json", serializer="pn_json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'] ) -@pytest.mark.asyncio -async def test_delete_file(event_loop, file_for_upload): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_delete_file(file_for_upload): + pubnub = PubNubAsyncio(pnconf_env_copy()) pubnub.config.uuid = "files_asyncio_uuid" envelope = await send_file(pubnub, file_for_upload) @@ -53,28 +53,26 @@ async def test_delete_file(event_loop, file_for_upload): @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/list_files.yaml", + "tests/integrational/fixtures/asyncio/file_upload/list_files.json", serializer="pn_json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'] - - ) -@pytest.mark.asyncio -async def test_list_files(event_loop): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_list_files(): + pubnub = PubNubAsyncio(pnconf_env_copy()) envelope = await pubnub.list_files().channel(CHANNEL).future() assert isinstance(envelope.result, PNGetFilesResult) - assert envelope.result.count == 23 + assert envelope.result.count == 7 await pubnub.stop() @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.yaml", + "tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json", serializer="pn_json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'] ) -@pytest.mark.asyncio -async def test_send_and_download_file(event_loop, file_for_upload): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_send_and_download_file(file_for_upload): + pubnub = PubNubAsyncio(pnconf_env_copy()) envelope = await send_file(pubnub, file_for_upload) download_envelope = await pubnub.download_file().\ channel(CHANNEL).\ @@ -89,9 +87,9 @@ async def test_send_and_download_file(event_loop, file_for_upload): "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' ) -@pytest.mark.asyncio -async def test_send_and_download_file_encrypted_cipher_key(event_loop, file_for_upload, file_upload_test_data): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_send_and_download_file_encrypted_cipher_key(file_for_upload, file_upload_test_data): + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): envelope = await send_file(pubnub, file_for_upload, cipher_key="test") @@ -111,9 +109,9 @@ async def test_send_and_download_file_encrypted_cipher_key(event_loop, file_for_ "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' ) -@pytest.mark.asyncio -async def test_send_and_download_encrypted_file_crypto_module(event_loop, file_for_upload, file_upload_test_data): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_send_and_download_encrypted_file_crypto_module(file_for_upload, file_upload_test_data): + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) with patch("pubnub.crypto_core.PubNubLegacyCryptor.get_initialization_vector", return_value=b"knightsofni12345"): envelope = await send_file(pubnub, file_for_upload) @@ -129,12 +127,12 @@ async def test_send_and_download_encrypted_file_crypto_module(event_loop, file_f @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/get_file_url.yaml", + "tests/integrational/fixtures/asyncio/file_upload/get_file_url.json", serializer="pn_json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'] ) -@pytest.mark.asyncio -async def test_get_file_url(event_loop, file_for_upload): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_get_file_url(file_for_upload): + pubnub = PubNubAsyncio(pnconf_env_copy()) envelope = await send_file(pubnub, file_for_upload) file_url_envelope = await pubnub.get_file_url().\ channel(CHANNEL).\ @@ -146,12 +144,12 @@ async def test_get_file_url(event_loop, file_for_upload): @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.yaml", + "tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.json", serializer="pn_json", filter_query_parameters=['uuid', 'l_file', 'pnsdk'] ) -@pytest.mark.asyncio -async def test_fetch_file_upload_s3_data_with_result_invocation(event_loop, file_upload_test_data): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_fetch_file_upload_s3_data_with_result_invocation(file_upload_test_data): + pubnub = PubNubAsyncio(pnconf_env_copy()) result = await pubnub._fetch_file_upload_s3_data().\ channel(CHANNEL).\ file_name(file_upload_test_data["UPLOADED_FILENAME"]).result() @@ -161,12 +159,12 @@ async def test_fetch_file_upload_s3_data_with_result_invocation(event_loop, file @pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.yaml", + "tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.json", serializer="pn_json", filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) -@pytest.mark.asyncio -async def test_publish_file_message_with_encryption(event_loop, file_upload_test_data): - pubnub = PubNubAsyncio(pnconf_file_copy(), custom_event_loop=event_loop) +@pytest.mark.asyncio(loop_scope="module") +async def test_publish_file_message_with_encryption(file_upload_test_data): + pubnub = PubNubAsyncio(pnconf_env_copy()) envelope = await PublishFileMessage(pubnub).\ channel(CHANNEL).\ meta({}).\ diff --git a/tests/integrational/asyncio/test_invocations.py b/tests/integrational/asyncio/test_invocations.py index d62e07bb..db69a0f2 100644 --- a/tests/integrational/asyncio/test_invocations.py +++ b/tests/integrational/asyncio/test_invocations.py @@ -55,7 +55,7 @@ async def test_publish_future_raises_pubnub_error(event_loop): async def test_publish_future_raises_lower_level_error(event_loop): pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) - pubnub._connector.close() + pubnub._connector.aclose() with pytest.raises(RuntimeError) as exinfo: await pubnub.publish().message('hey').channel('blah').result() @@ -102,7 +102,7 @@ async def test_publish_envelope_raises(event_loop): async def test_publish_envelope_raises_lower_level_error(event_loop): pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) - pubnub._connector.close() + pubnub._connector.aclose() e = await pubnub.publish().message('hey').channel('blah').future() assert isinstance(e, PubNubAsyncioException) diff --git a/tests/integrational/asyncio/test_publish.py b/tests/integrational/asyncio/test_publish.py index c17e4eed..20867de9 100644 --- a/tests/integrational/asyncio/test_publish.py +++ b/tests/integrational/asyncio/test_publish.py @@ -18,8 +18,8 @@ @pytest.mark.asyncio -async def assert_success_await(pub): - envelope = await pub.future() +async def assert_success_await(pubnub): + envelope = await pubnub.future() assert isinstance(envelope, AsyncioEnvelope) assert isinstance(envelope.result, PNPublishResult) @@ -29,9 +29,9 @@ async def assert_success_await(pub): @pytest.mark.asyncio -async def assert_client_side_error(pub, expected_err_msg): +async def assert_client_side_error(pubnub, expected_err_msg): try: - await pub.future() + await pubnub.future() except PubNubException as e: assert expected_err_msg in str(e) @@ -48,7 +48,7 @@ async def assert_success_publish_post(pubnub, msg): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/mixed_via_get.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub'] + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'] ) @pytest.mark.asyncio async def test_publish_mixed_via_get(event_loop): @@ -65,7 +65,7 @@ async def test_publish_mixed_via_get(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/object_via_get.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['method', 'scheme', 'host', 'port', 'object_in_path', 'query'] ) @pytest.mark.asyncio @@ -78,7 +78,7 @@ async def test_publish_object_via_get(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/mixed_via_post.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub']) + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio async def test_publish_mixed_via_post(event_loop): pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) @@ -93,7 +93,7 @@ async def test_publish_mixed_via_post(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/object_via_post.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['method', 'scheme', 'host', 'port', 'path', 'query', 'object_in_body']) @pytest.mark.asyncio async def test_publish_object_via_post(event_loop): @@ -105,7 +105,7 @@ async def test_publish_object_via_post(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub']) + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio async def test_publish_mixed_via_get_encrypted(event_loop): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): @@ -121,7 +121,7 @@ async def test_publish_mixed_via_get_encrypted(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['host', 'method', 'query'] ) @pytest.mark.asyncio @@ -135,7 +135,7 @@ async def test_publish_object_via_get_encrypted(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['method', 'path', 'query', 'body'] ) @pytest.mark.asyncio @@ -154,7 +154,7 @@ async def test_publish_mixed_via_post_encrypted(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['method', 'path', 'query'] ) @pytest.mark.asyncio @@ -195,7 +195,7 @@ def method(): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/meta_object.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk'], + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['host', 'method', 'path', 'meta_object_in_query']) @pytest.mark.asyncio async def test_publish_with_meta(event_loop): @@ -207,7 +207,7 @@ async def test_publish_with_meta(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/do_not_store.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk']) + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio async def test_publish_do_not_store(event_loop): pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) @@ -217,16 +217,16 @@ async def test_publish_do_not_store(event_loop): @pytest.mark.asyncio -async def assert_server_side_error_yield(pub, expected_err_msg): +async def assert_server_side_error_yield(publish_builder, expected_err_msg): try: - await pub.future() + await publish_builder.future() except PubNubAsyncioException as e: assert expected_err_msg in str(e) @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/invalid_key.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'pnsdk']) + filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio async def test_error_invalid_key(event_loop): pnconf = pnconf_pam_env_copy() @@ -239,7 +239,7 @@ async def test_error_invalid_key(event_loop): @pn_vcr.use_cassette( 'tests/integrational/fixtures/asyncio/publish/not_permitted.json', serializer='pn_json', - filter_query_parameters=['uuid', 'seqn', 'signature', 'timestamp', 'pnsdk']) + filter_query_parameters=['uuid', 'seqn', 'signature', 'timestamp', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio async def test_not_permitted(event_loop): pnconf = pnconf_pam_env_copy() diff --git a/tests/integrational/fixtures/asyncio/file_upload/delete_file.json b/tests/integrational/fixtures/asyncio/file_upload/delete_file.json new file mode 100644 index 00000000..b989ab24 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/delete_file.json @@ -0,0 +1,186 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", + "body": "{\"name\": \"king_arthur.txt\"}", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:45:53 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"a9ef2775-2f7e-40af-bb93-ced5397ee99b\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-03T14:46:53Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/a9ef2775-2f7e-40af-bb93-ced5397ee99b/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241203/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241203T144653Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDNUMTQ6NDY6NTNaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYTllZjI3NzUtMmY3ZS00MGFmLWJiOTMtY2VkNTM5N2VlOTliL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjAzL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDNUMTQ0NjUzWiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"524e3dd80a75514edcd0a061fcf5ec690a227ec71354551f38dc5257c002e061\"}]}}" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": { + "pickle": "gASVmhEAAAAAAACMEGFpb2h0dHAuZm9ybWRhdGGUjAhGb3JtRGF0YZSTlCmBlH2UKIwHX3dyaXRlcpSMEWFpb2h0dHAubXVsdGlwYXJ0lIwPTXVsdGlwYXJ0V3JpdGVylJOUKYGUfZQojAlfYm91bmRhcnmUQyAyZjNmMWYxOTEyMjQ0Yjg5ODA4NjE2ZmI3MWYyNDQwM5SMCV9lbmNvZGluZ5ROjAlfZmlsZW5hbWWUTowIX2hlYWRlcnOUjBRtdWx0aWRpY3QuX211bHRpZGljdJSMC0NJTXVsdGlEaWN0lJOUXZRoEIwEaXN0cpSTlIwMQ29udGVudC1UeXBllIWUgZSMPm11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PTJmM2YxZjE5MTIyNDRiODk4MDg2MTZmYjcxZjI0NDAzlIaUYYWUUpSMBl92YWx1ZZROjAZfcGFydHOUXZQojA9haW9odHRwLnBheWxvYWSUjA1TdHJpbmdQYXlsb2FklJOUKYGUfZQoaA2MBXV0Zi04lGgOTmgPaBJdlChoGIwTbXVsdGlwYXJ0L2Zvcm0tZGF0YZSGlGgVjBNDb250ZW50LURpc3Bvc2l0aW9ulIWUgZSMGWZvcm0tZGF0YTsgbmFtZT0idGFnZ2luZyKUhpRlhZRSlGgdQ1k8VGFnZ2luZz48VGFnU2V0PjxUYWc+PEtleT5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X3Byb2Nlc3NlZJSIjA1fcXVvdGVfZmllbGRzlIiMCF9jaGFyc2V0lE51Yi4=" + }, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "Pte3FPY8OqKYA4lwQxDWTsGThFU2nZQBQ9zbkE5iLzOX2EjCBFTyM13z/Vc8sztzuR79uoweEZw=" + ], + "x-amz-request-id": [ + "HDEVBQ31WGXJD2CB" + ], + "Date": [ + "Tue, 03 Dec 2024 14:45:54 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Etag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fa9ef2775-2f7e-40af-bb93-ced5397ee99b%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22a9ef2775-2f7e-40af-bb93-ced5397ee99b%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:45:53 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17332371536854859\"]" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/a9ef2775-2f7e-40af-bb93-ced5397ee99b/king_arthur.txt", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:45:54 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "14" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.json b/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.json new file mode 100644 index 00000000..618808b5 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", + "body": "{\"name\": \"king_arthur.txt\"}", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:51:04 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"1358d70c-5b14-4072-99e9-9573ff5c4681\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-03T14:52:04Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/1358d70c-5b14-4072-99e9-9573ff5c4681/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241203/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241203T145204Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDNUMTQ6NTI6MDRaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvMTM1OGQ3MGMtNWIxNC00MDcyLTk5ZTktOTU3M2ZmNWM0NjgxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjAzL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDNUMTQ1MjA0WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"14a4f501e17311e26bd5b7f4fb97714f5231f83f401fb45a00e5397ce1c3e57c\"}]}}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/file_upload/get_file_url.json b/tests/integrational/fixtures/asyncio/file_upload/get_file_url.json new file mode 100644 index 00000000..697bd838 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/get_file_url.json @@ -0,0 +1,189 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", + "body": "{\"name\": \"king_arthur.txt\"}", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:50:36 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"3c67f8bc-70fa-4b91-97a5-c28bbeb77dbd\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-03T14:51:36Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/3c67f8bc-70fa-4b91-97a5-c28bbeb77dbd/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241203/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241203T145136Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDNUMTQ6NTE6MzZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvM2M2N2Y4YmMtNzBmYS00YjkxLTk3YTUtYzI4YmJlYjc3ZGJkL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjAzL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDNUMTQ1MTM2WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"653e0da972629891e42e40e2de16ba8ef33b94489537a2b6d108d82ed77b7c7d\"}]}}" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": { + "pickle": "gASVmhEAAAAAAACMEGFpb2h0dHAuZm9ybWRhdGGUjAhGb3JtRGF0YZSTlCmBlH2UKIwHX3dyaXRlcpSMEWFpb2h0dHAubXVsdGlwYXJ0lIw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YVdGc0lqb2dJa0ZMU1VGWk4wRlZOa2RSUkZZMVRFTlFWa1ZZTHpJd01qUXhNakF6TDNWekxXVmhjM1F0TVM5ek15OWhkM00wWDNKbGNYVmxjM1FpZlN3S0NRbDdJbmd0WVcxNkxYTmxZM1Z5YVhSNUxYUnZhMlZ1SWpvZ0lpSjlMQW9KQ1hzaWVDMWhiWG90WVd4bmIzSnBkR2h0SWpvZ0lrRlhVelF0U0UxQlF5MVRTRUV5TlRZaWZTd0tDUWw3SW5ndFlXMTZMV1JoZEdVaU9pQWlNakF5TkRFeU1ETlVNVFExTVRNMldpSWdmUW9KWFFwOUNnPT2Uh5RolF2UaJaMD1gtQW16LVNpZ25hdHVyZZSGlGGFlFKUfZRoGGgnc4xANjUzZTBkYTk3MjYyOTg5MWU0MmU0MGUyZGUxNmJhOGVmMzNiOTQ0ODk1MzdhMmI2ZDEwOGQ4MmVkNzdiN2M3ZJSHlGiUXZQoaJaMBGZpbGWUhpSMCGZpbGVuYW1llIwPa2luZ19hcnRodXIudHh0lIaUZYWUUpR9lGgYaIhzaI6HlGWMDV9pc19tdWx0aXBhcnSUiIwNX2lzX3Byb2Nlc3NlZJSIjA1fcXVvdGVfZmllbGRzlIiMCF9jaGFyc2V0lE51Yi4=" + }, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "KGCTE8OoT/Bh0K1uFlqh6eP/s8sOVG+kpTLHt4jPOdc39D0bKZvVqmaWJ48fDzZsM1sUK0+xO9d3nNaFQIMUlA==" + ], + "x-amz-request-id": [ + "2SMG64VQNQ8Y3X9G" + ], + "Date": [ + "Tue, 03 Dec 2024 14:50:37 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Etag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F3c67f8bc-70fa-4b91-97a5-c28bbeb77dbd%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%223c67f8bc-70fa-4b91-97a5-c28bbeb77dbd%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:50:36 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17332374369988275\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/3c67f8bc-70fa-4b91-97a5-c28bbeb77dbd/king_arthur.txt", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:50:37 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=803, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/3c67f8bc-70fa-4b91-97a5-c28bbeb77dbd/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241203T140000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=f2ec81292786e4176c575d107ea17fbb8b1965b157fa65a23b47e81d9924c0fe" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/file_upload/list_files.json b/tests/integrational/fixtures/asyncio/file_upload/list_files.json new file mode 100644 index 00000000..4b96c037 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/list_files.json @@ -0,0 +1,46 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:47:49 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "843" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":[{\"name\":\"king_arthur.txt\",\"id\":\"04727e47-cbf1-40b3-a009-35c6403f2f06\",\"size\":19,\"created\":\"2024-12-03T14:27:26Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"3ce7a21a-94b7-4b28-b946-4db05f42b81e\",\"size\":19,\"created\":\"2024-12-03T14:28:21Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"41e6f604-ff3d-4610-96af-9e14d96e13d5\",\"size\":19,\"created\":\"2024-12-03T14:30:21Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"73bfb032-5e05-458f-a7d7-5a9421156f18\",\"size\":19,\"created\":\"2024-12-03T14:29:07Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"d7d50b43-eb67-4baa-9c03-4ed69b893309\",\"size\":48,\"created\":\"2024-12-03T14:30:23Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"e1ea8031-b3c8-45fd-a3e3-bdbaceff7176\",\"size\":48,\"created\":\"2024-12-03T14:30:22Z\"},{\"name\":\"king_arthur.txt\",\"id\":\"f5ef27d5-5109-4229-aca1-221624aa920b\",\"size\":19,\"created\":\"2024-12-03T09:28:52Z\"}],\"next\":null,\"count\":7}" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.json b/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.json new file mode 100644 index 00000000..1b872ec5 --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.json @@ -0,0 +1,52 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?meta=%7B%7D&store=1&ttl=222", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:51:29 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17332374895624143\"]" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json new file mode 100644 index 00000000..6fa6063f --- /dev/null +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json @@ -0,0 +1,254 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", + "body": "{\"name\": \"king_arthur.txt\"}", + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "Content-type": [ + "application/json" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:48:28 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"55efe26a-3aa3-4f15-bb49-394630953b75\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-03T14:49:28Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241203/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241203T144928Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDNUMTQ6NDk6MjhaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNTVlZmUyNmEtM2FhMy00ZjE1LWJiNDktMzk0NjMwOTUzYjc1L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjAzL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDNUMTQ0OTI4WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"d096204393f950ef72f2ac8f2716c6bc21520511b15b34335be5be6c363fcf9a\"}]}}" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": { + "pickle": "gASVmhEAAAAAAACMEGFpb2h0dHAuZm9ybWRhdGGUjAhGb3JtRGF0YZSTlCmBlH2UKIwHX3dyaXRlcpSMEWFpb2h0dHAubXVsdGlwYXJ0lIwPTXVsdGlwYXJ0V3JpdGVylJOUKYGUfZQojAlfYm91bmRhcnmUQyBkYzhiNzIxMzM5Y2U0ODNhODhlMTQ0MDc5NTczN2ZjNJSMCV9lbmNvZGluZ5ROjAlfZmlsZW5hbWWUTowIX2hlYWRlcnOUjBRtdWx0aWRpY3QuX211bHRpZGljdJSMC0NJTXVsdGlEaWN0lJOUXZRoEIwEaXN0cpSTlIwMQ29udGVudC1UeXBllIWUgZSMPm11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PWRjOGI3MjEzMzljZTQ4M2E4OGUxNDQwNzk1NzM3ZmM0lIaUYYWUUpSMBl92YWx1ZZROjAZfcGFydHOUXZQojA9haW9odHRwLnBheWxvYWSUjA1TdHJpbmdQYXlsb2FklJOUKYGUfZQoaA2MBXV0Zi04lGgOTmgPaBJdlChoGIwTbXVsdGlwYXJ0L2Zvcm0tZGF0YZSGlGgVjBNDb250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JaMBGZpbGWUhpSMCGZpbGVuYW1llIwPa2luZ19hcnRodXIudHh0lIaUZYWUUpR9lGgYaIhzaI6HlGWMDV9pc19tdWx0aXBhcnSUiIwNX2lzX3Byb2Nlc3NlZJSIjA1fcXVvdGVfZmllbGRzlIiMCF9jaGFyc2V0lE51Yi4=" + }, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "fzh7ifvK42Ie7Qv8f2cChOodj0p9454TXkCUKcuIxZiBXALvvy0neLniX47eNJUyLRTzJp0asr8=" + ], + "x-amz-request-id": [ + "4EJZKE3DYEB9HPDZ" + ], + "Date": [ + "Tue, 03 Dec 2024 14:48:29 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Etag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F55efe26a-3aa3-4f15-bb49-394630953b75%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%2255efe26a-3aa3-4f15-bb49-394630953b75%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:48:28 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17332373086977226\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { + "Date": [ + "Tue, 03 Dec 2024 14:48:28 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=932, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241203T140000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=464ddee6259c7537247771648bfe53921327d9030b0fc70fc013d8967bedf4bd" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241203T140000Z&X-Amz-Expires=3900&X-Amz-Signature=464ddee6259c7537247771648bfe53921327d9030b0fc70fc013d8967bedf4bd&X-Amz-SignedHeaders=host", + "body": null, + "headers": { + "User-Agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/plain; charset=utf-8" + ], + "Content-Length": [ + "19" + ], + "Connection": [ + "keep-alive" + ], + "Date": [ + "Tue, 03 Dec 2024 14:48:30 GMT" + ], + "Last-Modified": [ + "Tue, 03 Dec 2024 14:48:29 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "Etag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Accept-Ranges": [ + "bytes" + ], + "Server": [ + "AmazonS3" + ], + "X-Cache": [ + "Miss from cloudfront" + ], + "Via": [ + "1.1 376388af58845ad0897ba599cce4d92e.cloudfront.net (CloudFront)" + ], + "X-Amz-Cf-Pop": [ + "HAM50-C1" + ], + "X-Amz-Cf-Id": [ + "N1qaPHKyjBiA8tY5y7c5pJwplvxUQG2mvHPB0TT9Br1YyMP_rCCzLg==" + ] + }, + "body": { + "string": "Knights who say Ni!" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/asyncio/publish/do_not_store.json b/tests/integrational/fixtures/asyncio/publish/do_not_store.json index d25bdbea..9b1c4eec 100644 --- a/tests/integrational/fixtures/asyncio/publish/do_not_store.json +++ b/tests/integrational/fixtures/asyncio/publish/do_not_store.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?store=0", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?store=0", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:19 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815792197704\"]" + "string": "[1,\"Sent\",\"17327814518791750\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/invalid_key.json b/tests/integrational/fixtures/asyncio/publish/invalid_key.json index 50207a81..9a2369f1 100644 --- a/tests/integrational/fixtures/asyncio/publish/invalid_key.json +++ b/tests/integrational/fixtures/asyncio/publish/invalid_key.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?signature=v2.2GP5vSoYombvpD8JhGyyodcwFVe7K5SiBoYVHnK5mOg×tamp=1730881579", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22?signature=v2.4M6YAw0h3h9DlHYeay10TKjyslKmg0LtlasLj9Y18Wg×tamp=1732781451", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:19 GMT" + "Thu, 28 Nov 2024 08:10:52 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815793493634\"]" + "string": "[1,\"Sent\",\"17327814520248690\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/meta_object.json b/tests/integrational/fixtures/asyncio/publish/meta_object.json index c130674d..605dc6bd 100644 --- a/tests/integrational/fixtures/asyncio/publish/meta_object.json +++ b/tests/integrational/fixtures/asyncio/publish/meta_object.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:19 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815790735971\"]" + "string": "[1,\"Sent\",\"17327814517559683\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json index 91172242..c5e17fae 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/5", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hi%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,17 +56,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815775025317\"]" + "string": "[1,\"Sent\",\"17327814505205290\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/5", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -66,7 +90,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -91,17 +115,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815775031244\"]" + "string": "[1,\"Sent\",\"17327814505210879\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hi%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -113,7 +149,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -138,17 +174,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815775030621\"]" + "string": "[1,\"Sent\",\"17327814505217874\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/true", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/true", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -160,7 +208,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -185,7 +233,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815775046564\"]" + "string": "[1,\"Sent\",\"17327814505243996\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json index 6c0c0421..d3514360 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,17 +56,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815780560899\"]" + "string": "[1,\"Sent\",\"17327814511050381\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -66,7 +90,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -91,17 +115,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815780620270\"]" + "string": "[1,\"Sent\",\"17327814511072139\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -113,7 +149,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -138,17 +174,29 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815781237669\"]" + "string": "[1,\"Sent\",\"17327814511141823\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -160,7 +208,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -185,7 +233,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815782561468\"]" + "string": "[1,\"Sent\",\"17327814511152366\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json index 7628f20d..81c76c51 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json @@ -4,14 +4,29 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", "body": "5", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "1" ] } }, @@ -22,7 +37,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -47,21 +62,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815777895010\"]" + "string": "[1,\"Sent\",\"17327814508078560\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "[\"hi\", \"hi2\", \"hi3\"]", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "true", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "4" ] } }, @@ -72,7 +102,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -97,21 +127,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815777896816\"]" + "string": "[1,\"Sent\",\"17327814508116328\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "true", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "[\"hi\", \"hi2\", \"hi3\"]", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "20" ] } }, @@ -122,7 +167,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -147,21 +192,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815777903670\"]" + "string": "[1,\"Sent\",\"17327814508163459\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", "body": "\"hi\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "4" ] } }, @@ -172,7 +232,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -197,7 +257,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815777906104\"]" + "string": "[1,\"Sent\",\"17327814508167027\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json index c33d9194..8d858163 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json @@ -4,14 +4,29 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG\"", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU=\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "46" ] } }, @@ -22,7 +37,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -47,21 +62,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815785493215\"]" + "string": "[1,\"Sent\",\"17327814514281042\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU=\"", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0=\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "46" ] } }, @@ -72,7 +102,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -97,21 +127,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815785535925\"]" + "string": "[1,\"Sent\",\"17327814514290630\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA=\"", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "66" ] } }, @@ -122,7 +167,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -147,21 +192,36 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815785539657\"]" + "string": "[1,\"Sent\",\"17327814514297687\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0=\"", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA=\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "46" ] } }, @@ -172,7 +232,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -197,7 +257,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815787486416\"]" + "string": "[1,\"Sent\",\"17327814514313760\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/not_permitted.json b/tests/integrational/fixtures/asyncio/publish/not_permitted.json index 45a937cd..e0d593cc 100644 --- a/tests/integrational/fixtures/asyncio/publish/not_permitted.json +++ b/tests/integrational/fixtures/asyncio/publish/not_permitted.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:19 GMT" + "Thu, 28 Nov 2024 08:10:52 GMT" ], "Content-Type": [ "text/javascript; charset=UTF-8" @@ -53,7 +65,7 @@ ] }, "body": { - "string": "{\"message\": \"Forbidden\", \"payload\": {\"channels\": [\"asyncio-int-publish\"]}, \"error\": true, \"service\": \"Access Manager\", \"status\": 403}\n" + "binary": "H4sIAAAAAAAAAx2NsQoCQQxEe79iSe2BoJWdjZ1fIBa5bPACa/ZIdoXjuH83ZznDzHsrfNgd3wzXBPdqo+TMCscEMy6lYo5+BZpQlYtHeAL6oiR1EG3D3MciPsFriwebVYtJs84Rne0r9AffiMKSHqhhsp3uDVvfeZfTeTv8AOusHVGGAAAA" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get.json b/tests/integrational/fixtures/asyncio/publish/object_via_get.json index afea815b..d2bac3b9 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%7B%22name%22%3A%20%22Alex%22%2C%20%22online%22%3A%20true%7D", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%7B%22name%22%3A%20%22Alex%22%2C%20%22online%22%3A%20true%7D", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815776476487\"]" + "string": "[1,\"Sent\",\"17327814506635096\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json index b7b3de8d..ee731202 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json @@ -4,10 +4,22 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22", - "body": null, + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22", + "body": "", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ] } @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815783947099\"]" + "string": "[1,\"Sent\",\"17327814512572544\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post.json b/tests/integrational/fixtures/asyncio/publish/object_via_post.json index f5400c02..1140fe66 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post.json @@ -4,14 +4,29 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", "body": "{\"name\": \"Alex\", \"online\": true}", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "32" ] } }, @@ -22,7 +37,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:17 GMT" + "Thu, 28 Nov 2024 08:10:50 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -47,7 +62,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815779241046\"]" + "string": "[1,\"Sent\",\"17327814509661189\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json index b55852b9..fbbcd302 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json @@ -4,14 +4,29 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", "body": "\"a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR+zhR3WaTKTArF54xtAoq4J7zUtg==\"", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.0.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "90" ] } }, @@ -22,7 +37,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 08:26:18 GMT" + "Thu, 28 Nov 2024 08:10:51 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -47,7 +62,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308815788886238\"]" + "string": "[1,\"Sent\",\"17327814515859746\"]" } } } diff --git a/tests/integrational/fixtures/native_threads/where_now/multiple_channels.yaml b/tests/integrational/fixtures/native_threads/where_now/multiple_channels.yaml deleted file mode 100644 index 8c41745e..00000000 --- a/tests/integrational/fixtures/native_threads/where_now/multiple_channels.yaml +++ /dev/null @@ -1,117 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/subscribe/sub-c-mock-key/state-native-sync-ch-1,state-native-sync-ch-2/0?uuid=state-native-sync-uuid - response: - body: - string: '{"t":{"t":"16608278698485679","r":43},"m":[]}' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '45' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:04:29 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/presence/sub-key/sub-c-mock-key/uuid/state-native-sync-uuid?uuid=state-native-sync-uuid - response: - body: - string: '{"status": 200, "message": "OK", "payload": {"channels": ["state-native-sync-ch-2", - "state-native-sync-ch-1"]}, "service": "Presence"}' - headers: - Accept-Ranges: - - bytes - Access-Control-Allow-Methods: - - OPTIONS, GET, POST - Access-Control-Allow-Origin: - - '*' - Age: - - '0' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:04:40 GMT - Server: - - Pubnub Presence - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/presence/sub-key/sub-c-mock-key/channel/state-native-sync-ch-1,state-native-sync-ch-2/leave?uuid=state-native-sync-uuid - response: - body: - string: '{"status": 200, "message": "OK", "action": "leave", "service": "Presence"}' - headers: - Accept-Ranges: - - bytes - Access-Control-Allow-Methods: - - OPTIONS, GET, POST - Access-Control-Allow-Origin: - - '*' - Age: - - '0' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '74' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:04:40 GMT - Server: - - Pubnub Presence - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_threads/where_now/single_channel.yaml b/tests/integrational/fixtures/native_threads/where_now/single_channel.yaml deleted file mode 100644 index 8b0a4196..00000000 --- a/tests/integrational/fixtures/native_threads/where_now/single_channel.yaml +++ /dev/null @@ -1,117 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/subscribe/sub-c-mock-key/wherenow-asyncio-channel/0?uuid=wherenow-asyncio-uuid - response: - body: - string: '{"t":{"t":"16608276639105030","r":43},"m":[]}' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '45' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:01:04 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/presence/sub-key/sub-c-mock-key/uuid/wherenow-asyncio-uuid?uuid=wherenow-asyncio-uuid - response: - body: - string: '{"status": 200, "message": "OK", "payload": {"channels": ["wherenow-asyncio-channel"]}, - "service": "Presence"}' - headers: - Accept-Ranges: - - bytes - Access-Control-Allow-Methods: - - OPTIONS, GET, POST - Access-Control-Allow-Origin: - - '*' - Age: - - '0' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '110' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:01:14 GMT - Server: - - Pubnub Presence - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/6.5.1 - method: GET - uri: https://ps.pndsn.com/v2/presence/sub-key/sub-c-mock-key/channel/wherenow-asyncio-channel/leave?uuid=wherenow-asyncio-uuid - response: - body: - string: '{"status": 200, "message": "OK", "action": "leave", "service": "Presence"}' - headers: - Accept-Ranges: - - bytes - Access-Control-Allow-Methods: - - OPTIONS, GET, POST - Access-Control-Allow-Origin: - - '*' - Age: - - '0' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '74' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 18 Aug 2022 13:01:14 GMT - Server: - - Pubnub Presence - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/native_threads/test_where_now.py b/tests/integrational/native_threads/test_where_now.py index 9c3b5048..b4bbb72a 100644 --- a/tests/integrational/native_threads/test_where_now.py +++ b/tests/integrational/native_threads/test_where_now.py @@ -2,10 +2,10 @@ import logging import pubnub import threading +import time from pubnub.pubnub import PubNub, SubscribeListener, NonSubscribeListener -from tests.integrational.vcr_helper import pn_vcr -from tests.helper import mocked_config_copy +from tests.helper import pnconf_env_copy pubnub.set_stream_logger('pubnub', logging.DEBUG) @@ -19,12 +19,10 @@ def callback(self, response, status): self.status = status self.event.set() - @pn_vcr.use_cassette('tests/integrational/fixtures/native_threads/where_now/single_channel.yaml', - filter_query_parameters=['seqn', 'pnsdk', 'tr', 'tt'], - allow_playback_repeats=True) + # for subscribe we don't use VCR due to it's limitations with longpolling def test_single_channel(self): print('test_single_channel') - pubnub = PubNub(mocked_config_copy()) + pubnub = PubNub(pnconf_env_copy(enable_subscribe=True)) ch = "wherenow-asyncio-channel" uuid = "wherenow-asyncio-uuid" pubnub.config.uuid = uuid @@ -35,6 +33,8 @@ def test_single_channel(self): pubnub.subscribe().channels(ch).execute() subscribe_listener.wait_for_connect() + # the delay is needed for the server side to propagate presence + time.sleep(1) pubnub.where_now() \ .uuid(uuid) \ .pn_async(where_now_listener.callback) @@ -53,11 +53,9 @@ def test_single_channel(self): pubnub.stop() - @pn_vcr.use_cassette('tests/integrational/fixtures/native_threads/where_now/multiple_channels.yaml', - filter_query_parameters=['seqn', 'pnsdk', 'tr', 'tt'], - allow_playback_repeats=True) + # for subscribe we don't use VCR due to it's limitations with longpolling def test_multiple_channels(self): - pubnub = PubNub(mocked_config_copy()) + pubnub = PubNub(pnconf_env_copy(enable_subscribe=True)) ch1 = "state-native-sync-ch-1" ch2 = "state-native-sync-ch-2" pubnub.config.uuid = "state-native-sync-uuid" @@ -70,6 +68,8 @@ def test_multiple_channels(self): subscribe_listener.wait_for_connect() + # the delay is needed for the server side to propagate presence + time.sleep(1) pubnub.where_now() \ .uuid(uuid) \ .pn_async(where_now_listener.callback) diff --git a/tests/pytest.ini b/tests/pytest.ini index 9e27e99c..3d66fe5b 100644 --- a/tests/pytest.ini +++ b/tests/pytest.ini @@ -1,3 +1,5 @@ [pytest] filterwarnings = ignore:Mutable config will be deprecated in the future.:DeprecationWarning + +asyncio_default_fixture_loop_scope = module \ No newline at end of file From 636acaff7f30e1ead2806ca5363626f7ed6b69ae Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 5 Dec 2024 20:38:56 +0100 Subject: [PATCH 03/16] Should work --- pubnub/pubnub_asyncio.py | 16 +- requirements-dev.txt | 3 +- .../integrational/asyncio/test_invocations.py | 4 +- .../asyncio/file_upload/delete_file.yaml | 511 ---------------- .../file_upload/fetch_s3_upload_data.yaml | 32 - .../asyncio/file_upload/get_file_url.yaml | 512 ---------------- .../asyncio/file_upload/list_files.yaml | 31 - .../publish_file_message_encrypted.yaml | 31 - .../file_upload/send_and_download_file.yaml | 549 ------------------ .../asyncio/publish/do_not_store.json | 8 +- .../fixtures/asyncio/publish/fire_get.json | 22 +- .../fixtures/asyncio/publish/invalid_key.json | 8 +- .../fixtures/asyncio/publish/meta_object.json | 8 +- .../asyncio/publish/mixed_via_get.json | 32 +- .../publish/mixed_via_get_encrypted.json | 32 +- .../asyncio/publish/mixed_via_post.json | 42 +- .../publish/mixed_via_post_encrypted.json | 42 +- .../asyncio/publish/not_permitted.json | 6 +- .../asyncio/publish/object_via_get.json | 8 +- .../publish/object_via_get_encrypted.json | 8 +- .../asyncio/publish/object_via_post.json | 8 +- .../publish/object_via_post_encrypted.json | 8 +- .../integrational/native_sync/test_publish.py | 5 +- 23 files changed, 140 insertions(+), 1786 deletions(-) delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/delete_file.yaml delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.yaml delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/get_file_url.yaml delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/list_files.yaml delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.yaml delete mode 100644 tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.yaml diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index f51c0acd..62d7d494 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -8,6 +8,7 @@ from asyncio import Event, Queue, Semaphore from yarl import URL +from httpx import AsyncHTTPTransport from pubnub.event_engine.containers import PresenceStateContainer from pubnub.event_engine.models import events, states @@ -33,6 +34,14 @@ logger = logging.getLogger("pubnub") +class PubNubAsyncHTTPTransport(AsyncHTTPTransport): + is_closed: bool = False + + def close(self): + self.is_closed = True + super().aclose() + + class PubNubAsyncio(PubNubCore): """ PubNub Python SDK for asyncio framework @@ -45,10 +54,7 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None): self._connector = None self._session = None - self._connector = httpx.AsyncHTTPTransport() - - if not hasattr(self._connector, 'close'): - self._connector.close = self._connector.aclose + self._connector = PubNubAsyncHTTPTransport() if not subscription_manager: subscription_manager = EventEngineSubscriptionManager @@ -150,6 +156,8 @@ async def _request_helper(self, options_func, cancellation_event): :param cancellation_event: :return: """ + if self._connector and self._connector.is_closed: + raise RuntimeError('Session is closed') if cancellation_event is not None: assert isinstance(cancellation_event, Event) diff --git a/requirements-dev.txt b/requirements-dev.txt index ee2fe324..b22c9a38 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,8 +4,7 @@ pycryptodomex flake8 pytest pytest-asyncio -aiohttp -requests +httpx cbor2 behave vcrpy diff --git a/tests/integrational/asyncio/test_invocations.py b/tests/integrational/asyncio/test_invocations.py index db69a0f2..d62e07bb 100644 --- a/tests/integrational/asyncio/test_invocations.py +++ b/tests/integrational/asyncio/test_invocations.py @@ -55,7 +55,7 @@ async def test_publish_future_raises_pubnub_error(event_loop): async def test_publish_future_raises_lower_level_error(event_loop): pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) - pubnub._connector.aclose() + pubnub._connector.close() with pytest.raises(RuntimeError) as exinfo: await pubnub.publish().message('hey').channel('blah').result() @@ -102,7 +102,7 @@ async def test_publish_envelope_raises(event_loop): async def test_publish_envelope_raises_lower_level_error(event_loop): pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) - pubnub._connector.aclose() + pubnub._connector.close() e = await pubnub.publish().message('hey').channel('blah').future() assert isinstance(e, PubNubAsyncioException) diff --git a/tests/integrational/fixtures/asyncio/file_upload/delete_file.yaml b/tests/integrational/fixtures/asyncio/file_upload/delete_file.yaml deleted file mode 100644 index 32748226..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/delete_file.yaml +++ /dev/null @@ -1,511 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - response: - body: - string: '{"status":200,"data":{"id":"e85323dd-b082-485e-a75b-37aaee3e2070","name":"king_arthur.txt"},"file_upload_request":{"url":"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/","method":"POST","expiration_date":"2020-11-25T12:42:47Z","form_fields":[{"key":"tagging","value":"\u003cTagging\u003e\u003cTagSet\u003e\u003cTag\u003e\u003cKey\u003eObjectTTLInDays\u003c/Key\u003e\u003cValue\u003e1\u003c/Value\u003e\u003c/Tag\u003e\u003c/TagSet\u003e\u003c/Tagging\u003e"},{"key":"key","value":"sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/e85323dd-b082-485e-a75b-37aaee3e2070/king_arthur.txt"},{"key":"Content-Type","value":"text/plain; - charset=utf-8"},{"key":"X-Amz-Credential","value":"AKIAY7AU6GQD5KWBS3FG/20201125/eu-central-1/s3/aws4_request"},{"key":"X-Amz-Security-Token","value":""},{"key":"X-Amz-Algorithm","value":"AWS4-HMAC-SHA256"},{"key":"X-Amz-Date","value":"20201125T124247Z"},{"key":"Policy","value":"CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjVUMTI6NDI6NDdaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvZTg1MzIzZGQtYjA4Mi00ODVlLWE3NWItMzdhYWVlM2UyMDcwL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI1L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjVUMTI0MjQ3WiIgfQoJXQp9Cg=="},{"key":"X-Amz-Signature","value":"dab33a8e9f06ca5ca7022eeef41ed974869096322f28d31e3dbbb445b898a527"}]}}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Encoding: gzip - Content-Type: application/json - Date: Wed, 25 Nov 2020 12:41:47 GMT - Transfer-Encoding: chunked - Vary: Accept-Encoding - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=files_asyncio_uuid - - '' -- request: - body: !!python/object:aiohttp.formdata.FormData - _charset: null - _fields: - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - tagging - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - ObjectTTLInDays1 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - key - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/e85323dd-b082-485e-a75b-37aaee3e2070/king_arthur.txt - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Content-Type - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - text/plain; charset=utf-8 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Credential - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AKIAY7AU6GQD5KWBS3FG/20201125/eu-central-1/s3/aws4_request - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Security-Token - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - '' - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Algorithm - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AWS4-HMAC-SHA256 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Date - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - 20201125T124247Z - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Policy - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjVUMTI6NDI6NDdaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvZTg1MzIzZGQtYjA4Mi00ODVlLWE3NWItMzdhYWVlM2UyMDcwL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI1L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjVUMTI0MjQ3WiIgfQoJXQp9Cg== - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Signature - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - dab33a8e9f06ca5ca7022eeef41ed974869096322f28d31e3dbbb445b898a527 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - file - - !!python/tuple - - filename - - king_arthur.txt - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : application/octet-stream - - !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - _is_multipart: true - _quote_fields: true - _writer: !!python/object:aiohttp.multipart.MultipartWriter - _boundary: !!binary | - NmI4MmNkOTVjMWRkNDBmNzljMTM1MDI4YzgzNGVjNGE= - _content_type: multipart/form-data; boundary="6b82cd95c1dd40f79c135028c834ec4a" - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data; boundary="6b82cd95c1dd40f79c135028c834ec4a" - _parts: - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="tagging" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '89' - _size: 89 - _value: !!binary | - PFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8 - L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4= - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9InRhZ2dpbmciDQpDT05URU5ULUxFTkdUSDogODkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="key" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '139' - _size: 139 - _value: !!binary | - c3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4 - d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvZTg1MzIzZGQtYjA4Mi00ODVlLWE3NWItMzdh - YWVlM2UyMDcwL2tpbmdfYXJ0aHVyLnR4dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9ImtleSINCkNPTlRFTlQtTEVOR1RIOiAxMzkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Content-Type" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '25' - _size: 25 - _value: !!binary | - dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IkNvbnRlbnQtVHlwZSINCkNPTlRFTlQtTEVOR1RIOiAyNQ0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Credential" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '58' - _size: 58 - _value: !!binary | - QUtJQVk3QVU2R1FENUtXQlMzRkcvMjAyMDExMjUvZXUtY2VudHJhbC0xL3MzL2F3czRfcmVxdWVz - dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUNyZWRlbnRpYWwiDQpDT05URU5ULUxFTkdUSDogNTgNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Security-Token" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '0' - _size: 0 - _value: !!binary "" - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNlY3VyaXR5LVRva2VuIg0KQ09OVEVOVC1MRU5HVEg6IDAN - Cg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Algorithm" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - QVdTNC1ITUFDLVNIQTI1Ng== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUFsZ29yaXRobSINCkNPTlRFTlQtTEVOR1RIOiAxNg0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Date" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - MjAyMDExMjVUMTI0MjQ3Wg== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LURhdGUiDQpDT05URU5ULUxFTkdUSDogMTYNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Policy" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '904' - _size: 904 - _value: !!binary | - Q25zS0NTSmxlSEJwY21GMGFXOXVJam9nSWpJd01qQXRNVEV0TWpWVU1USTZOREk2TkRkYUlpd0tD - U0pqYjI1a2FYUnBiMjV6SWpvZ1d3b0pDWHNpWW5WamEyVjBJam9nSW5CMVltNTFZaTF0Ym1WdGIz - TjVibVV0Wm1sc1pY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Q2c9PQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlBvbGljeSINCkNPTlRFTlQtTEVOR1RIOiA5MDQNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Signature" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '64' - _size: 64 - _value: !!binary | - ZGFiMzNhOGU5ZjA2Y2E1Y2E3MDIyZWVlZjQxZWQ5NzQ4NjkwOTYzMjJmMjhkMzFlM2RiYmI0NDVi - ODk4YTUyNw== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNpZ25hdHVyZSINCkNPTlRFTlQtTEVOR1RIOiA2NA0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.BytesPayload - _content_type: application/octet-stream - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - application/octet-stream - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="file"; filename="king_arthur.txt"; filename*=utf-8''king_arthur.txt - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '19' - _size: 19 - _value: !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNPTlRFTlQtRElTUE9TSVRJ - T046IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJraW5nX2FydGh1ci50eHQiOyBm - aWxlbmFtZSo9dXRmLTgnJ2tpbmdfYXJ0aHVyLnR4dA0KQ09OVEVOVC1MRU5HVEg6IDE5DQoNCg== - - '' - - '' - _value: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: Wed, 25 Nov 2020 12:41:48 GMT - ETag: '"3676cdb7a927db43c846070c4e7606c7"' - Location: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fe85323dd-b082-485e-a75b-37aaee3e2070%2Fking_arthur.txt - Server: AmazonS3 - x-amz-expiration: expiry-date="Fri, 27 Nov 2020 00:00:00 GMT", rule-id="Archive - file 1 day after creation" - x-amz-id-2: NC2+aieHq2kClmdnt37tgjFISi4rhO44dUFew8D6AKKuaOVSX+7RDvSyrMgTehvYQ9O3+eQHlWY= - x-amz-request-id: 53CABDEECA691146 - x-amz-server-side-encryption: AES256 - status: - code: 204 - message: No Content - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com - - / - - '' - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22e85323dd-b082-485e-a75b-37aaee3e2070%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?l_file=0.22842562198638916&meta=null&store=1&ttl=222 - response: - body: - string: '[1,"Sent","16063081076885278"]' - headers: - Access-Control-Allow-Methods: GET - Access-Control-Allow-Origin: '*' - Cache-Control: no-cache - Connection: keep-alive - Content-Length: '30' - Content-Type: text/javascript; charset="UTF-8" - Date: Wed, 25 Nov 2020 12:41:47 GMT - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22e85323dd-b082-485e-a75b-37aaee3e2070%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D - - meta=null&ttl=222&store=1&pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=files_asyncio_uuid&l_file=0.22842562198638916 - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: DELETE - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/e85323dd-b082-485e-a75b-37aaee3e2070/king_arthur.txt?l_file=0.16370232899983725 - response: - body: - string: '{"status":200}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Length: '14' - Content-Type: application/json - Date: Wed, 25 Nov 2020 12:41:47 GMT - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/e85323dd-b082-485e-a75b-37aaee3e2070/king_arthur.txt - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=files_asyncio_uuid&l_file=0.16370232899983725 - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.yaml b/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.yaml deleted file mode 100644 index 1ff9887e..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/fetch_s3_upload_data.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - User-Agent: - - PubNub-Python-Asyncio/4.5.4 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url?pnsdk=PubNub-Python-Asyncio%2F4.5.4&uuid=291d63f9-3b21-48b9-8088-8a21fb1ba39a - response: - body: - string: '{"status":200,"data":{"id":"7191ce86-eb00-46d5-be04-fd273f0ad721","name":"king_arthur.txt"},"file_upload_request":{"url":"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/","method":"POST","expiration_date":"2020-10-21T15:32:33Z","form_fields":[{"key":"tagging","value":"\u003cTagging\u003e\u003cTagSet\u003e\u003cTag\u003e\u003cKey\u003eObjectTTLInDays\u003c/Key\u003e\u003cValue\u003e1\u003c/Value\u003e\u003c/Tag\u003e\u003c/TagSet\u003e\u003c/Tagging\u003e"},{"key":"key","value":"sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/7191ce86-eb00-46d5-be04-fd273f0ad721/king_arthur.txt"},{"key":"Content-Type","value":"text/plain; - charset=utf-8"},{"key":"X-Amz-Credential","value":"AKIAY7AU6GQD5KWBS3FG/20201021/eu-central-1/s3/aws4_request"},{"key":"X-Amz-Security-Token","value":""},{"key":"X-Amz-Algorithm","value":"AWS4-HMAC-SHA256"},{"key":"X-Amz-Date","value":"20201021T153233Z"},{"key":"Policy","value":"CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTAtMjFUMTU6MzI6MzNaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNzE5MWNlODYtZWIwMC00NmQ1LWJlMDQtZmQyNzNmMGFkNzIxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMDIxL2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDEwMjFUMTUzMjMzWiIgfQoJXQp9Cg=="},{"key":"X-Amz-Signature","value":"409079715b1bb3062f2c243c6cabe75175b24c758c8c723154bd2aa89f500e75"}]}}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Encoding: gzip - Content-Type: application/json - Date: Wed, 21 Oct 2020 15:31:33 GMT - Transfer-Encoding: chunked - Vary: Accept-Encoding - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - - pnsdk=PubNub-Python-Asyncio%2F4.5.4&uuid=291d63f9-3b21-48b9-8088-8a21fb1ba39a - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/file_upload/get_file_url.yaml b/tests/integrational/fixtures/asyncio/file_upload/get_file_url.yaml deleted file mode 100644 index 374c484f..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/get_file_url.yaml +++ /dev/null @@ -1,512 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - response: - body: - string: '{"status":200,"data":{"id":"42d7e28e-a724-4416-9328-b9fa13201041","name":"king_arthur.txt"},"file_upload_request":{"url":"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/","method":"POST","expiration_date":"2020-11-24T19:39:37Z","form_fields":[{"key":"tagging","value":"\u003cTagging\u003e\u003cTagSet\u003e\u003cTag\u003e\u003cKey\u003eObjectTTLInDays\u003c/Key\u003e\u003cValue\u003e1\u003c/Value\u003e\u003c/Tag\u003e\u003c/TagSet\u003e\u003c/Tagging\u003e"},{"key":"key","value":"sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/42d7e28e-a724-4416-9328-b9fa13201041/king_arthur.txt"},{"key":"Content-Type","value":"text/plain; - charset=utf-8"},{"key":"X-Amz-Credential","value":"AKIAY7AU6GQD5KWBS3FG/20201124/eu-central-1/s3/aws4_request"},{"key":"X-Amz-Security-Token","value":""},{"key":"X-Amz-Algorithm","value":"AWS4-HMAC-SHA256"},{"key":"X-Amz-Date","value":"20201124T193937Z"},{"key":"Policy","value":"CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjRUMTk6Mzk6MzdaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNDJkN2UyOGUtYTcyNC00NDE2LTkzMjgtYjlmYTEzMjAxMDQxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjRUMTkzOTM3WiIgfQoJXQp9Cg=="},{"key":"X-Amz-Signature","value":"0354f6687225f98712b599f42f56c4b4780cbb63d47f469b7d2edf2326b6844a"}]}}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Encoding: gzip - Content-Type: application/json - Date: Tue, 24 Nov 2020 19:38:37 GMT - Transfer-Encoding: chunked - Vary: Accept-Encoding - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=f1b39735-2ad2-463c-9576-b65fac9d776b - - '' -- request: - body: !!python/object:aiohttp.formdata.FormData - _charset: null - _fields: - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - tagging - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - ObjectTTLInDays1 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - key - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/42d7e28e-a724-4416-9328-b9fa13201041/king_arthur.txt - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Content-Type - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - text/plain; charset=utf-8 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Credential - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AKIAY7AU6GQD5KWBS3FG/20201124/eu-central-1/s3/aws4_request - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Security-Token - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - '' - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Algorithm - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AWS4-HMAC-SHA256 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Date - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - 20201124T193937Z - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Policy - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjRUMTk6Mzk6MzdaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNDJkN2UyOGUtYTcyNC00NDE2LTkzMjgtYjlmYTEzMjAxMDQxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjRUMTkzOTM3WiIgfQoJXQp9Cg== - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Signature - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - 0354f6687225f98712b599f42f56c4b4780cbb63d47f469b7d2edf2326b6844a - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - file - - !!python/tuple - - filename - - king_arthur.txt - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : application/octet-stream - - !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - _is_multipart: true - _quote_fields: true - _writer: !!python/object:aiohttp.multipart.MultipartWriter - _boundary: !!binary | - MTk0MDM1ZWYxNTQ2NGQ1NWEyNWUzZTZiODk2MGEyMzU= - _content_type: multipart/form-data; boundary="194035ef15464d55a25e3e6b8960a235" - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data; boundary="194035ef15464d55a25e3e6b8960a235" - _parts: - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="tagging" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '89' - _size: 89 - _value: !!binary | - PFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8 - L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4= - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9InRhZ2dpbmciDQpDT05URU5ULUxFTkdUSDogODkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="key" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '139' - _size: 139 - _value: !!binary | - c3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4 - d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNDJkN2UyOGUtYTcyNC00NDE2LTkzMjgtYjlm - YTEzMjAxMDQxL2tpbmdfYXJ0aHVyLnR4dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9ImtleSINCkNPTlRFTlQtTEVOR1RIOiAxMzkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Content-Type" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '25' - _size: 25 - _value: !!binary | - dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IkNvbnRlbnQtVHlwZSINCkNPTlRFTlQtTEVOR1RIOiAyNQ0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Credential" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '58' - _size: 58 - _value: !!binary | - QUtJQVk3QVU2R1FENUtXQlMzRkcvMjAyMDExMjQvZXUtY2VudHJhbC0xL3MzL2F3czRfcmVxdWVz - dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUNyZWRlbnRpYWwiDQpDT05URU5ULUxFTkdUSDogNTgNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Security-Token" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '0' - _size: 0 - _value: !!binary "" - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNlY3VyaXR5LVRva2VuIg0KQ09OVEVOVC1MRU5HVEg6IDAN - Cg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Algorithm" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - QVdTNC1ITUFDLVNIQTI1Ng== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUFsZ29yaXRobSINCkNPTlRFTlQtTEVOR1RIOiAxNg0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Date" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - MjAyMDExMjRUMTkzOTM3Wg== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LURhdGUiDQpDT05URU5ULUxFTkdUSDogMTYNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Policy" - - !!python/tuple - - !!python/object/new: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Q1FsN0luZ3RZVzE2TFhObFkzVnlhWFI1TFhSdmEyVnVJam9nSWlKOUxBb0pDWHNpZUMxaGJY - b3RZV3huYjNKcGRHaHRJam9nSWtGWFV6UXRTRTFCUXkxVFNFRXlOVFlpZlN3S0NRbDdJbmd0WVcx - NkxXUmhkR1VpT2lBaU1qQXlNREV4TWpSVU1Ua3pPVE0zV2lJZ2ZRb0pYUXA5Q2c9PQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlBvbGljeSINCkNPTlRFTlQtTEVOR1RIOiA5MDQNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Signature" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '64' - _size: 64 - _value: !!binary | - MDM1NGY2Njg3MjI1Zjk4NzEyYjU5OWY0MmY1NmM0YjQ3ODBjYmI2M2Q0N2Y0NjliN2QyZWRmMjMy - NmI2ODQ0YQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNpZ25hdHVyZSINCkNPTlRFTlQtTEVOR1RIOiA2NA0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.BytesPayload - _content_type: application/octet-stream - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - application/octet-stream - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="file"; filename="king_arthur.txt"; filename*=utf-8''king_arthur.txt - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '19' - _size: 19 - _value: !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNPTlRFTlQtRElTUE9TSVRJ - T046IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJraW5nX2FydGh1ci50eHQiOyBm - aWxlbmFtZSo9dXRmLTgnJ2tpbmdfYXJ0aHVyLnR4dA0KQ09OVEVOVC1MRU5HVEg6IDE5DQoNCg== - - '' - - '' - _value: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: Tue, 24 Nov 2020 19:38:38 GMT - ETag: '"3676cdb7a927db43c846070c4e7606c7"' - Location: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F42d7e28e-a724-4416-9328-b9fa13201041%2Fking_arthur.txt - Server: AmazonS3 - x-amz-expiration: expiry-date="Thu, 26 Nov 2020 00:00:00 GMT", rule-id="Archive - file 1 day after creation" - x-amz-id-2: Phvsyy15eFvzfe3SpH6Xy/zLlmNsCKfEwgaojqHToMnUWf1READ4CzFH270s9lcyZ5A+LydSoWo= - x-amz-request-id: 7D7D74E38CD52A03 - x-amz-server-side-encryption: AES256 - status: - code: 204 - message: No Content - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com - - / - - '' - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%2242d7e28e-a724-4416-9328-b9fa13201041%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?l_file=0.24198853969573975&meta=null&store=1&ttl=222 - response: - body: - string: '[1,"Sent","16062467174849849"]' - headers: - Access-Control-Allow-Methods: GET - Access-Control-Allow-Origin: '*' - Cache-Control: no-cache - Connection: keep-alive - Content-Length: '30' - Content-Type: text/javascript; charset="UTF-8" - Date: Tue, 24 Nov 2020 19:38:37 GMT - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%2242d7e28e-a724-4416-9328-b9fa13201041%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D - - meta=null&ttl=222&store=1&pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=f1b39735-2ad2-463c-9576-b65fac9d776b&l_file=0.24198853969573975 - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/42d7e28e-a724-4416-9328-b9fa13201041/king_arthur.txt?l_file=0.17324558893839517 - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: '*' - Cache-Control: public, max-age=1523, immutable - Connection: keep-alive - Content-Length: '0' - Date: Tue, 24 Nov 2020 19:38:37 GMT - Location: https://files-eu-central-1.pndsn.com/sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/42d7e28e-a724-4416-9328-b9fa13201041/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201124%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201124T190000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=32fe06a247ad954b82c0ba17710778480a32db9faabb5ff3fd0449f4db372a6e - status: - code: 307 - message: Temporary Redirect - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/42d7e28e-a724-4416-9328-b9fa13201041/king_arthur.txt - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=f1b39735-2ad2-463c-9576-b65fac9d776b&l_file=0.17324558893839517 - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/file_upload/list_files.yaml b/tests/integrational/fixtures/asyncio/file_upload/list_files.yaml deleted file mode 100644 index 2af014f5..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/list_files.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.5.4 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/files - response: - body: - string: '{"status":200,"data":[{"name":"king_arthur.txt","id":"05fe1901-dfea-4ccf-abd6-423deda262aa","size":19,"created":"2020-10-21T15:27:06Z"},{"name":"king_arthur.txt","id":"2a7d29c8-e8f4-4c2b-a24d-4b5f165d366e","size":19,"created":"2020-10-21T15:20:48Z"},{"name":"king_arthur.txt","id":"2f9c0888-375b-4599-a086-0f47837eee87","size":19,"created":"2020-10-21T15:31:34Z"},{"name":"king_arthur.txt","id":"320a8c88-a412-43a4-957e-fec73a4a781f","size":19,"created":"2020-10-21T15:31:13Z"},{"name":"king_arthur.txt","id":"7ce8d4ad-92b7-430a-ab8a-ba6b3489049f","size":19,"created":"2020-10-21T16:59:30Z"},{"name":"king_arthur.txt","id":"803716aa-7624-4a80-bf58-142c6b665eea","size":19,"created":"2020-10-21T17:04:01Z"},{"name":"king_arthur.txt","id":"8051678d-ed6c-45b6-9e93-6aa261c6b4b8","size":48,"created":"2020-10-21T17:02:45Z"},{"name":"king_arthur.txt","id":"826b36c4-638c-43d6-ba68-9911494599ec","size":19,"created":"2020-10-21T15:27:04Z"},{"name":"king_arthur.txt","id":"865fee42-6f14-4bcf-bd00-745a26cd1eda","size":48,"created":"2020-10-21T15:20:47Z"},{"name":"king_arthur.txt","id":"883119dc-b2d9-4b5a-9d46-2750f5619668","size":19,"created":"2020-10-21T17:00:43Z"},{"name":"king_arthur.txt","id":"945b11a9-156f-4506-a90f-ded77fcdcb44","size":48,"created":"2020-10-21T17:02:11Z"},{"name":"king_arthur.txt","id":"9dae0510-5c78-408d-b372-8f6401c9d127","size":19,"created":"2020-10-21T15:31:12Z"},{"name":"king_arthur.txt","id":"9efbccf0-91d7-4e86-a6db-6904c6aa955f","size":19,"created":"2020-10-21T15:27:13Z"},{"name":"king_arthur.txt","id":"a0dfd470-f114-4bfc-9f20-b1d4a1be940e","size":48,"created":"2020-10-21T15:27:05Z"},{"name":"king_arthur.txt","id":"a5dc8c14-a663-4f34-b7af-b5cb5f4a1694","size":19,"created":"2020-10-21T17:00:35Z"},{"name":"king_arthur.txt","id":"aa6b6b1a-0d40-4044-ad08-3535667ea9ef","size":19,"created":"2020-10-21T15:27:12Z"},{"name":"king_arthur.txt","id":"b0749af2-8ffc-4ac4-bc11-c81d50491d95","size":19,"created":"2020-10-21T17:01:45Z"},{"name":"king_arthur.txt","id":"c4476763-522b-4408-9743-ed5777151e8b","size":19,"created":"2020-10-21T15:20:46Z"},{"name":"king_arthur.txt","id":"c97c65ea-7f35-43cf-b3b9-a01117e38f63","size":19,"created":"2020-10-21T15:31:32Z"},{"name":"king_arthur.txt","id":"d3a8e2e5-d925-4b21-aa77-a036dd1c21dc","size":48,"created":"2020-10-21T15:31:33Z"},{"name":"king_arthur.txt","id":"efa78132-b224-4c77-8b7e-ce834381ce9a","size":19,"created":"2020-10-21T17:03:43Z"},{"name":"king_arthur.txt","id":"f6fd8772-0d7c-48e4-b161-dce210a947e8","size":19,"created":"2020-10-21T16:59:35Z"},{"name":"king_arthur.txt","id":"ffce293c-1ccc-43f8-9952-808505cc3803","size":19,"created":"2020-10-21T17:00:24Z"}],"next":null,"count":23}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Encoding: gzip - Content-Type: application/json - Date: Wed, 21 Oct 2020 17:05:38 GMT - Transfer-Encoding: chunked - Vary: Accept-Encoding - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/files - - pnsdk=PubNub-Python-Asyncio%2F4.5.4&uuid=43086006-0f8e-422b-8e88-43fea4afde7d - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.yaml b/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.yaml deleted file mode 100644 index f04d6bc0..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/publish_file_message_encrypted.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?meta=%7B%7D&store=1&ttl=222 - response: - body: - string: '[1,"Sent","16058168227970293"]' - headers: - Access-Control-Allow-Methods: GET - Access-Control-Allow-Origin: '*' - Cache-Control: no-cache - Connection: keep-alive - Content-Length: '30' - Content-Type: text/javascript; charset="UTF-8" - Date: Thu, 19 Nov 2020 20:13:42 GMT - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D - - meta=%7B%7D&ttl=222&store=1&pnsdk=PubNub-Python-Asyncio%2F4.6.1&uuid=9b1fa4b9-75b2-4001-98d7-bf25c45bcaf3 - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.yaml b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.yaml deleted file mode 100644 index 96225fc1..00000000 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.yaml +++ /dev/null @@ -1,549 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - response: - body: - string: '{"status":200,"data":{"id":"862168ec-0048-4578-9e6d-4c69361e9780","name":"king_arthur.txt"},"file_upload_request":{"url":"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/","method":"POST","expiration_date":"2020-11-25T13:26:54Z","form_fields":[{"key":"tagging","value":"\u003cTagging\u003e\u003cTagSet\u003e\u003cTag\u003e\u003cKey\u003eObjectTTLInDays\u003c/Key\u003e\u003cValue\u003e1\u003c/Value\u003e\u003c/Tag\u003e\u003c/TagSet\u003e\u003c/Tagging\u003e"},{"key":"key","value":"sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt"},{"key":"Content-Type","value":"text/plain; - charset=utf-8"},{"key":"X-Amz-Credential","value":"AKIAY7AU6GQD5KWBS3FG/20201125/eu-central-1/s3/aws4_request"},{"key":"X-Amz-Security-Token","value":""},{"key":"X-Amz-Algorithm","value":"AWS4-HMAC-SHA256"},{"key":"X-Amz-Date","value":"20201125T132654Z"},{"key":"Policy","value":"CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjVUMTM6MjY6NTRaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvODYyMTY4ZWMtMDA0OC00NTc4LTllNmQtNGM2OTM2MWU5NzgwL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI1L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjVUMTMyNjU0WiIgfQoJXQp9Cg=="},{"key":"X-Amz-Signature","value":"8c4bc66e328da99c3158877ad5abd093394b24bd22a693af8bd8f9f8438f3471"}]}}' - headers: - Access-Control-Allow-Origin: '*' - Connection: keep-alive - Content-Encoding: gzip - Content-Type: application/json - Date: Wed, 25 Nov 2020 13:25:54 GMT - Transfer-Encoding: chunked - Vary: Accept-Encoding - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/generate-upload-url - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=ee97d818-f36d-4524-908f-5738e917bd42 - - '' -- request: - body: !!python/object:aiohttp.formdata.FormData - _charset: null - _fields: - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - tagging - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - ObjectTTLInDays1 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - key - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Content-Type - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - text/plain; charset=utf-8 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Credential - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AKIAY7AU6GQD5KWBS3FG/20201125/eu-central-1/s3/aws4_request - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Security-Token - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - '' - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Algorithm - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - AWS4-HMAC-SHA256 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Date - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - 20201125T132654Z - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - Policy - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - CnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMjVUMTM6MjY6NTRaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvODYyMTY4ZWMtMDA0OC00NTc4LTllNmQtNGM2OTM2MWU5NzgwL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTI1L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMjVUMTMyNjU0WiIgfQoJXQp9Cg== - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - X-Amz-Signature - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : multipart/form-data - - 8c4bc66e328da99c3158877ad5abd093394b24bd22a693af8bd8f9f8438f3471 - - !!python/tuple - - !!python/object/apply:multidict._multidict.MultiDict - - - !!python/tuple - - name - - file - - !!python/tuple - - filename - - king_arthur.txt - - ? !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - : application/octet-stream - - !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - _is_multipart: true - _quote_fields: true - _writer: !!python/object:aiohttp.multipart.MultipartWriter - _boundary: !!binary | - OTJkNThmNDZjMTlmNDhkMGE3ZDVmN2MyOGZlMGQzNmM= - _content_type: multipart/form-data; boundary="92d58f46c19f48d0a7d5f7c28fe0d36c" - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data; boundary="92d58f46c19f48d0a7d5f7c28fe0d36c" - _parts: - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="tagging" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '89' - _size: 89 - _value: !!binary | - PFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8 - L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4= - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9InRhZ2dpbmciDQpDT05URU5ULUxFTkdUSDogODkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="key" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '139' - _size: 139 - _value: !!binary | - c3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1LzBNUjEtejJ3MG5TSll4 - d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvODYyMTY4ZWMtMDA0OC00NTc4LTllNmQtNGM2 - OTM2MWU5NzgwL2tpbmdfYXJ0aHVyLnR4dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9ImtleSINCkNPTlRFTlQtTEVOR1RIOiAxMzkNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Content-Type" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '25' - _size: 25 - _value: !!binary | - dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IkNvbnRlbnQtVHlwZSINCkNPTlRFTlQtTEVOR1RIOiAyNQ0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Credential" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '58' - _size: 58 - _value: !!binary | - QUtJQVk3QVU2R1FENUtXQlMzRkcvMjAyMDExMjUvZXUtY2VudHJhbC0xL3MzL2F3czRfcmVxdWVz - dA== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUNyZWRlbnRpYWwiDQpDT05URU5ULUxFTkdUSDogNTgNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Security-Token" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '0' - _size: 0 - _value: !!binary "" - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNlY3VyaXR5LVRva2VuIg0KQ09OVEVOVC1MRU5HVEg6IDAN - Cg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Algorithm" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - QVdTNC1ITUFDLVNIQTI1Ng== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LUFsZ29yaXRobSINCkNPTlRFTlQtTEVOR1RIOiAxNg0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Date" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '16' - _size: 16 - _value: !!binary | - MjAyMDExMjVUMTMyNjU0Wg== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LURhdGUiDQpDT05URU5ULUxFTkdUSDogMTYNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="Policy" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '904' - _size: 904 - _value: !!binary | - Q25zS0NTSmxlSEJwY21GMGFXOXVJam9nSWpJd01qQXRNVEV0TWpWVU1UTTZNalk2TlRSYUlpd0tD - U0pqYjI1a2FYUnBiMjV6SWpvZ1d3b0pDWHNpWW5WamEyVjBJam9nSW5CMVltNTFZaTF0Ym1WdGIz - TjVibVV0Wm1sc1pYTXRaWFV0WTJWdWRISmhiQzB4TFhCeVpDSjlMQW9KQ1ZzaVpYRWlMQ0FpSkhS - aFoyZHBibWNpTENBaVBGUmhaMmRwYm1jK1BGUmhaMU5sZEQ0OFZHRm5QanhMWlhrK1QySnFaV04w - VkZSTVNXNUVZWGx6UEM5TFpYaytQRlpoYkhWbFBqRThMMVpoYkhWbFBqd3ZWR0ZuUGp3dlZHRm5V - MlYwUGp3dlZHRm5aMmx1Wno0aVhTd0tDUWxiSW1WeElpd2dJaVJyWlhraUxDQWljM1ZpTFdNdFl6 - ZzRNalF5Wm1FdE1UTmhaUzB4TVdWaUxXSmpNelF0WTJVMlptUTVOamRoWmprMUx6Qk5VakV0ZWpK - M01HNVRTbGw0ZDBWNU56UndOVkZxVmpnMVZHMW5Ua0pMVUhKV056RjBOVFZPVkRBdk9EWXlNVFk0 - WldNdE1EQTBPQzAwTlRjNExUbGxObVF0TkdNMk9UTTJNV1U1Tnpnd0wydHBibWRmWVhKMGFIVnlM - blI0ZENKZExBb0pDVnNpWTI5dWRHVnVkQzFzWlc1bmRHZ3RjbUZ1WjJVaUxDQXdMQ0ExTWpReU9E - Z3dYU3dLQ1FsYkluTjBZWEowY3kxM2FYUm9JaXdnSWlSRGIyNTBaVzUwTFZSNWNHVWlMQ0FpSWww - c0Nna0pleUo0TFdGdGVpMWpjbVZrWlc1MGFXRnNJam9nSWtGTFNVRlpOMEZWTmtkUlJEVkxWMEpU - TTBaSEx6SXdNakF4TVRJMUwyVjFMV05sYm5SeVlXd3RNUzl6TXk5aGQzTTBYM0psY1hWbGMzUWlm - U3dLQ1FsN0luZ3RZVzE2TFhObFkzVnlhWFI1TFhSdmEyVnVJam9nSWlKOUxBb0pDWHNpZUMxaGJY - b3RZV3huYjNKcGRHaHRJam9nSWtGWFV6UXRTRTFCUXkxVFNFRXlOVFlpZlN3S0NRbDdJbmd0WVcx - NkxXUmhkR1VpT2lBaU1qQXlNREV4TWpWVU1UTXlOalUwV2lJZ2ZRb0pYUXA5Q2c9PQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlBvbGljeSINCkNPTlRFTlQtTEVOR1RIOiA5MDQNCg0K - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.StringPayload - _content_type: multipart/form-data - _encoding: utf-8 - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - multipart/form-data - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="X-Amz-Signature" - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '64' - _size: 64 - _value: !!binary | - OGM0YmM2NmUzMjhkYTk5YzMxNTg4NzdhZDVhYmQwOTMzOTRiMjRiZDIyYTY5M2FmOGJkOGY5Zjg0 - MzhmMzQ3MQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBtdWx0aXBhcnQvZm9ybS1kYXRhDQpDT05URU5ULURJU1BPU0lUSU9OOiBm - b3JtLWRhdGE7IG5hbWU9IlgtQW16LVNpZ25hdHVyZSINCkNPTlRFTlQtTEVOR1RIOiA2NA0KDQo= - - '' - - '' - - !!python/tuple - - !!python/object:aiohttp.payload.BytesPayload - _content_type: application/octet-stream - _encoding: null - _filename: null - _headers: !!python/object/apply:multidict._multidict.CIMultiDict - - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-TYPE - - application/octet-stream - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-DISPOSITION - - form-data; name="file"; filename="king_arthur.txt"; filename*=utf-8''king_arthur.txt - - !!python/tuple - - !!python/object/new:multidict._multidict.istr - - CONTENT-LENGTH - - '19' - _size: 19 - _value: !!binary | - S25pZ2h0cyB3aG8gc2F5IE5pIQ== - - !!binary | - Q09OVEVOVC1UWVBFOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNPTlRFTlQtRElTUE9TSVRJ - T046IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJraW5nX2FydGh1ci50eHQiOyBm - aWxlbmFtZSo9dXRmLTgnJ2tpbmdfYXJ0aHVyLnR4dA0KQ09OVEVOVC1MRU5HVEg6IDE5DQoNCg== - - '' - - '' - _value: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: Wed, 25 Nov 2020 13:25:55 GMT - ETag: '"3676cdb7a927db43c846070c4e7606c7"' - Location: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F862168ec-0048-4578-9e6d-4c69361e9780%2Fking_arthur.txt - Server: AmazonS3 - x-amz-expiration: expiry-date="Fri, 27 Nov 2020 00:00:00 GMT", rule-id="Archive - file 1 day after creation" - x-amz-id-2: oQNsM/Ih2gVYskQl1csWFbx5mbP7t37lMPdjnQHfbtFN85qNiV9JHA73kmWqaGnIk4nak5urV6s= - x-amz-request-id: 6P1NBGDZDW4NBJ6T - x-amz-server-side-encryption: AES256 - status: - code: 204 - message: No Content - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com - - / - - '' - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22862168ec-0048-4578-9e6d-4c69361e9780%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222 - response: - body: - string: '[1,"Sent","16063107548270363"]' - headers: - Access-Control-Allow-Methods: GET - Access-Control-Allow-Origin: '*' - Cache-Control: no-cache - Connection: keep-alive - Content-Length: '30' - Content-Type: text/javascript; charset="UTF-8" - Date: Wed, 25 Nov 2020 13:25:54 GMT - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22862168ec-0048-4578-9e6d-4c69361e9780%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D - - meta=null&ttl=222&store=1&pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=ee97d818-f36d-4524-908f-5738e917bd42&l_file=0.27685248851776123 - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: '*' - Cache-Control: public, max-age=2286, immutable - Connection: keep-alive - Content-Length: '0' - Date: Wed, 25 Nov 2020 13:25:54 GMT - Location: https://files-eu-central-1.pndsn.com/sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201125%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201125T130000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=094b5452e8788ee0ace5be5397c41cb3b0ba0b9db93797630010a250fae4b196 - status: - code: 307 - message: Temporary Redirect - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - ps.pndsn.com - - /v1/files/sub-c-mock-key/channels/files_asyncio_ch/files/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt - - pnsdk=PubNub-Python-Asyncio%2F4.7.0&uuid=ee97d818-f36d-4524-908f-5738e917bd42&l_file=0.19709094365437826 - - '' -- request: - body: null - headers: - User-Agent: - - PubNub-Python-Asyncio/4.7.0 - method: GET - uri: https://files-eu-central-1.pndsn.com/sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201125%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201125T130000Z&X-Amz-Expires=3900&X-Amz-Signature=094b5452e8788ee0ace5be5397c41cb3b0ba0b9db93797630010a250fae4b196&X-Amz-SignedHeaders=host - response: - body: - string: Knights who say Ni! - headers: - Accept-Ranges: bytes - Connection: keep-alive - Content-Length: '19' - Content-Type: text/plain; charset=utf-8 - Date: Wed, 25 Nov 2020 13:25:56 GMT - ETag: '"3676cdb7a927db43c846070c4e7606c7"' - Last-Modified: Wed, 25 Nov 2020 13:25:55 GMT - Server: AmazonS3 - Via: 1.1 e86025dac63232624d2273c5fd256ce4.cloudfront.net (CloudFront) - X-Amz-Cf-Id: JxKntRKPJTqm1yjJBSY8tGTsbQ6V23bKVqmt6efKi_hJ5BrLEyLaUw== - X-Amz-Cf-Pop: FRA2-C1 - X-Cache: Miss from cloudfront - x-amz-expiration: expiry-date="Fri, 27 Nov 2020 00:00:00 GMT", rule-id="Archive - file 1 day after creation" - x-amz-server-side-encryption: AES256 - status: - code: 200 - message: OK - url: !!python/object/new:yarl.URL - state: !!python/tuple - - !!python/object/new:urllib.parse.SplitResult - - https - - files-eu-central-1.pndsn.com - - /sub-c-mock-key/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/862168ec-0048-4578-9e6d-4c69361e9780/king_arthur.txt - - X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201125%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201125T130000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=094b5452e8788ee0ace5be5397c41cb3b0ba0b9db93797630010a250fae4b196 - - '' -version: 1 diff --git a/tests/integrational/fixtures/asyncio/publish/do_not_store.json b/tests/integrational/fixtures/asyncio/publish/do_not_store.json index 9b1c4eec..9bb522e9 100644 --- a/tests/integrational/fixtures/asyncio/publish/do_not_store.json +++ b/tests/integrational/fixtures/asyncio/publish/do_not_store.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?store=0", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?store=0", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814518791750\"]" + "string": "[1,\"Sent\",\"17334108326343660\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/fire_get.json b/tests/integrational/fixtures/asyncio/publish/fire_get.json index a600a169..5992ad6a 100644 --- a/tests/integrational/fixtures/asyncio/publish/fire_get.json +++ b/tests/integrational/fixtures/asyncio/publish/fire_get.json @@ -5,10 +5,22 @@ "request": { "method": "GET", "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/unique_sync/0/%22bla%22?norep=1&store=0", - "body": null, + "body": "", "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.0.0" + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -19,7 +31,7 @@ }, "headers": { "Date": [ - "Wed, 06 Nov 2024 09:02:46 GMT" + "Thu, 05 Dec 2024 15:02:03 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -44,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17308837665022824\"]" + "string": "[1,\"Sent\",\"17334109234005323\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/invalid_key.json b/tests/integrational/fixtures/asyncio/publish/invalid_key.json index 9a2369f1..011bd8d5 100644 --- a/tests/integrational/fixtures/asyncio/publish/invalid_key.json +++ b/tests/integrational/fixtures/asyncio/publish/invalid_key.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22?signature=v2.4M6YAw0h3h9DlHYeay10TKjyslKmg0LtlasLj9Y18Wg×tamp=1732781451", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?timestamp=1733410832", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:52 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814520248690\"]" + "string": "[1,\"Sent\",\"17334108327846111\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/meta_object.json b/tests/integrational/fixtures/asyncio/publish/meta_object.json index 605dc6bd..e6cc0feb 100644 --- a/tests/integrational/fixtures/asyncio/publish/meta_object.json +++ b/tests/integrational/fixtures/asyncio/publish/meta_object.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22?meta=%7B%22a%22%3A+2%2C+%22b%22%3A+%22qwer%22%7D", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814517559683\"]" + "string": "[1,\"Sent\",\"17334108324343105\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json index c5e17fae..928991d5 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22hi%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/5", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:30 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,14 +56,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814505205290\"]" + "string": "[1,\"Sent\",\"17334108309073692\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/5", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/true", "body": "", "headers": { "host": [ @@ -79,7 +79,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -90,7 +90,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:30 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -115,14 +115,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814505210879\"]" + "string": "[1,\"Sent\",\"17334108309078547\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%5B%22hi%22%2C%20%22hi2%22%2C%20%22hi3%22%5D", "body": "", "headers": { "host": [ @@ -138,7 +138,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -149,7 +149,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:30 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -174,14 +174,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814505217874\"]" + "string": "[1,\"Sent\",\"17334108309084840\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/true", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22hi%22", "body": "", "headers": { "host": [ @@ -197,7 +197,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -208,7 +208,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:30 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -233,7 +233,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814505243996\"]" + "string": "[1,\"Sent\",\"17334108309088320\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json index d3514360..21024c8b 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX%2BmTa3M0vVg2xcyYg7CW45mG%22", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,14 +56,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814511050381\"]" + "string": "[1,\"Sent\",\"17334108315447185\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA%3D%22", "body": "", "headers": { "host": [ @@ -79,7 +79,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -90,7 +90,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -115,14 +115,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814511072139\"]" + "string": "[1,\"Sent\",\"17334108315532626\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NclhU9jqi%2B5cNMXFiry5TPU%3D%22", "body": "", "headers": { "host": [ @@ -138,7 +138,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -149,7 +149,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -174,14 +174,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814511141823\"]" + "string": "[1,\"Sent\",\"17334108315533708\"]" } } }, { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NS%2FB7ZYYL%2F8ZE%2FNEGBapOF0%3D%22", "body": "", "headers": { "host": [ @@ -197,7 +197,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -208,7 +208,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -233,7 +233,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814511152366\"]" + "string": "[1,\"Sent\",\"17334108315555981\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json index 81c76c51..5547b5a9 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post.json @@ -4,8 +4,8 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "5", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"hi\"", "headers": { "host": [ "ps.pndsn.com" @@ -20,13 +20,13 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" ], "content-length": [ - "1" + "4" ] } }, @@ -37,7 +37,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -62,15 +62,15 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814508078560\"]" + "string": "[1,\"Sent\",\"17334108312181183\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "true", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "5", "headers": { "host": [ "ps.pndsn.com" @@ -85,13 +85,13 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" ], "content-length": [ - "4" + "1" ] } }, @@ -102,7 +102,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -127,14 +127,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814508116328\"]" + "string": "[1,\"Sent\",\"17334108312184536\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", "body": "[\"hi\", \"hi2\", \"hi3\"]", "headers": { "host": [ @@ -150,7 +150,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -167,7 +167,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -192,15 +192,15 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814508163459\"]" + "string": "[1,\"Sent\",\"17334108312228688\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "\"hi\"", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "true", "headers": { "host": [ "ps.pndsn.com" @@ -215,7 +215,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -232,7 +232,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -257,7 +257,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814508167027\"]" + "string": "[1,\"Sent\",\"17334108312261591\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json index 8d858163..aaec71f2 100644 --- a/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/mixed_via_post_encrypted.json @@ -4,8 +4,8 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU=\"", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG\"", "headers": { "host": [ "ps.pndsn.com" @@ -20,13 +20,13 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" ], "content-length": [ - "46" + "66" ] } }, @@ -37,7 +37,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -62,15 +62,15 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814514281042\"]" + "string": "[1,\"Sent\",\"17334108318604078\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0=\"", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NclhU9jqi+5cNMXFiry5TPU=\"", "headers": { "host": [ "ps.pndsn.com" @@ -85,7 +85,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -102,7 +102,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -127,15 +127,15 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814514290630\"]" + "string": "[1,\"Sent\",\"17334108318621552\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", - "body": "\"a25pZ2h0c29mbmkxMjM0NdOBbiWd7zGph7bFEv5GX+mTa3M0vVg2xcyYg7CW45mG\"", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", + "body": "\"a25pZ2h0c29mbmkxMjM0NS/B7ZYYL/8ZE/NEGBapOF0=\"", "headers": { "host": [ "ps.pndsn.com" @@ -150,13 +150,13 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" ], "content-length": [ - "66" + "46" ] } }, @@ -167,7 +167,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -192,14 +192,14 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814514297687\"]" + "string": "[1,\"Sent\",\"17334108318645172\"]" } } }, { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", "body": "\"a25pZ2h0c29mbmkxMjM0NQ66CzLYXFOKoI1a9G0s0hA=\"", "headers": { "host": [ @@ -215,7 +215,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -232,7 +232,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -257,7 +257,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814514313760\"]" + "string": "[1,\"Sent\",\"17334108320605934\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/not_permitted.json b/tests/integrational/fixtures/asyncio/publish/not_permitted.json index e0d593cc..04ca4bba 100644 --- a/tests/integrational/fixtures/asyncio/publish/not_permitted.json +++ b/tests/integrational/fixtures/asyncio/publish/not_permitted.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-98863562-19a6-4760-bf0b-d537d1f5c582/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/0/asyncio-int-publish/0/%22hey%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PAM_PUBLISH}/{PN_KEY_PAM_SUBSCRIBE}/0/asyncio-int-publish/0/%22hey%22", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:52 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=UTF-8" diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get.json b/tests/integrational/fixtures/asyncio/publish/object_via_get.json index d2bac3b9..2728778d 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%7B%22name%22%3A%20%22Alex%22%2C%20%22online%22%3A%20true%7D", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%7B%22name%22%3A%20%22Alex%22%2C%20%22online%22%3A%20true%7D", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814506635096\"]" + "string": "[1,\"Sent\",\"17334108310602900\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json index ee731202..6d49587e 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_get_encrypted.json @@ -4,7 +4,7 @@ { "request": { "method": "GET", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0/%22a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR%2BzhR3WaTKTArF54xtAoq4J7zUtg%3D%3D%22", "body": "", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ] } }, @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814512572544\"]" + "string": "[1,\"Sent\",\"17334108317005269\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post.json b/tests/integrational/fixtures/asyncio/publish/object_via_post.json index 1140fe66..70fe7642 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post.json @@ -4,7 +4,7 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", "body": "{\"name\": \"Alex\", \"online\": true}", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -37,7 +37,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:50 GMT" + "Thu, 05 Dec 2024 15:00:31 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -62,7 +62,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814509661189\"]" + "string": "[1,\"Sent\",\"17334108313923637\"]" } } } diff --git a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json index fbbcd302..741c15d8 100644 --- a/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json +++ b/tests/integrational/fixtures/asyncio/publish/object_via_post_encrypted.json @@ -4,7 +4,7 @@ { "request": { "method": "POST", - "uri": "https://ps.pndsn.com/publish/pub-c-739aa0fc-3ed5-472b-af26-aca1b333ec52/sub-c-33f55052-190b-11e6-bfbc-02ee2ddab7fe/0/asyncio-int-publish/0", + "uri": "https://ps.pndsn.com/publish/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/asyncio-int-publish/0", "body": "\"a25pZ2h0c29mbmkxMjM0NZJdqrQwIy2EGbanaofVioxjgR2wkk02J3Z3NvR+zhR3WaTKTArF54xtAoq4J7zUtg==\"", "headers": { "host": [ @@ -20,7 +20,7 @@ "keep-alive" ], "user-agent": [ - "PubNub-Python-Asyncio/9.0.0" + "PubNub-Python-Asyncio/9.1.0" ], "content-type": [ "application/json" @@ -37,7 +37,7 @@ }, "headers": { "Date": [ - "Thu, 28 Nov 2024 08:10:51 GMT" + "Thu, 05 Dec 2024 15:00:32 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -62,7 +62,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17327814515859746\"]" + "string": "[1,\"Sent\",\"17334108322170052\"]" } } } diff --git a/tests/integrational/native_sync/test_publish.py b/tests/integrational/native_sync/test_publish.py index 9eac37cc..b7911905 100644 --- a/tests/integrational/native_sync/test_publish.py +++ b/tests/integrational/native_sync/test_publish.py @@ -1,6 +1,7 @@ import logging import unittest import urllib +import urllib.parse import pubnub from pubnub.exceptions import PubNubException @@ -385,7 +386,7 @@ def test_publish_custom_message_type(self): assert isinstance(envelope.result, PNPublishResult) assert envelope.result.timetoken > 1 assert len(cassette) == 1 - uri = urlparse(cassette.requests[0].uri) - query = parse_qs(uri.query) + uri = urllib.parse.urlparse(cassette.requests[0].uri) + query = urllib.parse.parse_qs(uri.query) assert 'custom_message_type' in query.keys() assert query['custom_message_type'] == ['test_message'] From 4e07c6d2071b991ca62ea4d6aea5a4fd2adee807 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 5 Dec 2024 21:20:55 +0100 Subject: [PATCH 04/16] Fix for behat tests --- tests/acceptance/subscribe/steps/then_steps.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/subscribe/steps/then_steps.py b/tests/acceptance/subscribe/steps/then_steps.py index ef09d821..c66d37c0 100644 --- a/tests/acceptance/subscribe/steps/then_steps.py +++ b/tests/acceptance/subscribe/steps/then_steps.py @@ -131,4 +131,6 @@ async def step_impl(context, channel1, channel2): @then(u'I don\'t observe any Events and Invocations of the Presence EE') @async_run_until_complete async def step_impl(context): - assert len(context.log_stream.getvalue().splitlines()) == 0 + logs = context.log_stream.getvalue().splitlines() + logs = list(filter(lambda line: not line == 'Shutting down StateMachine', logs)) + assert len(logs) == 0 From defccecbbb80e6177db0c8a1df13108b0d1c6771 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 5 Dec 2024 21:40:12 +0100 Subject: [PATCH 05/16] forgotten import --- tests/integrational/vcr_serializer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/integrational/vcr_serializer.py b/tests/integrational/vcr_serializer.py index 8d00e7d9..00ae4fd1 100644 --- a/tests/integrational/vcr_serializer.py +++ b/tests/integrational/vcr_serializer.py @@ -2,7 +2,6 @@ import re from base64 import b64decode, b64encode from vcr.serializers.jsonserializer import serialize, deserialize -from aiohttp.formdata import FormData from pickle import dumps, loads @@ -31,7 +30,7 @@ def serialize(self, cassette_dict): if type(interaction['response']['body']['string']) is bytes: ascii_body = b64encode(interaction['response']['body']['string']).decode('ascii') interaction['response']['body'] = {'binary': ascii_body} - if isinstance(interaction['request']['body'], FormData): + if interaction['request']['body']: ascii_body = b64encode(dumps(interaction['request']['body'])).decode('ascii') interaction['request']['body'] = {'pickle': ascii_body} From 4a4872c9ed6880e77de9519a6ffca671217cc059 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Wed, 11 Dec 2024 13:15:39 +0100 Subject: [PATCH 06/16] Rework invocation of requests --- .pubnub.yml | 26 +- README.md | 7 +- pubnub/crypto.py | 2 + .../file_operations/download_file.py | 4 +- .../file_operations/send_file_asyncio.py | 32 +- pubnub/pubnub_asyncio.py | 23 +- pubnub/pubnub_core.py | 4 +- pubnub/request_handlers/requests_handler.py | 25 +- setup.py | 9 +- tests/helper.py | 4 +- .../integrational/asyncio/test_file_upload.py | 25 +- ...nd_download_encrypted_file_cipher_key.json | 223 ++++---------- ...download_encrypted_file_crypto_module.json | 223 ++++---------- .../file_upload/send_and_download_file.json | 220 +++----------- .../native_sync/file_upload/delete_file.yaml | 182 ------------ .../file_upload/download_file.yaml | 231 --------------- .../file_upload/download_file_encrypted.yaml | 259 ----------------- .../native_sync/file_upload/download_url.yaml | 182 ------------ .../download_url_check_auth_key_in_url.yaml | 34 --- .../file_upload/fetch_file_upload_data.yaml | 58 ---- .../file_size_exceeded_maximum_size.yaml | 97 ------- .../native_sync/file_upload/list_files.yaml | 41 --- .../file_upload/publish_file_message.yaml | 36 --- .../publish_file_message_encrypted.yaml | 36 --- .../publish_file_message_with_ptto.yaml | 36 --- ...wnload_encrypted_file_fallback_decode.json | 273 ++---------------- .../send_and_download_gcm_encrypted_file.json | 273 ++---------------- .../file_upload/send_file_with_ptto.yaml | 150 ---------- .../test_publish_file_with_custom_type.json | 44 +-- .../native_sync/history/not_permitted.yaml | 25 -- .../native_sync/test_file_upload.py | 152 +++++----- .../integrational/native_sync/test_history.py | 7 +- tests/integrational/native_sync/test_state.py | 6 +- tests/integrational/vcr_helper.py | 2 + tests/integrational/vcr_serializer.py | 9 +- tests/pytest.ini | 2 + 36 files changed, 390 insertions(+), 2572 deletions(-) delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/delete_file.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/download_file.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/download_url.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/list_files.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/publish_file_message.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.yaml delete mode 100644 tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.yaml delete mode 100644 tests/integrational/fixtures/native_sync/history/not_permitted.yaml diff --git a/.pubnub.yml b/.pubnub.yml index e8fba1d1..ce691879 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -61,12 +61,6 @@ sdks: - x86 - x86-64 requires: - - name: requests - min-version: "2.4" - location: https://pypi.org/project/requests/ - license: Apache Software License (Apache 2.0) - license-url: https://github.com/psf/requests/blob/master/LICENSE - is-required: Required - name: pycryptodomex min-version: "3.3" location: https://pypi.org/project/pycryptodomex/ @@ -79,11 +73,11 @@ sdks: license: MIT License (MIT) license-url: https://github.com/agronholm/cbor2/blob/master/LICENSE.txt is-required: Required - - name: aiohttp - min-version: "2.3.10" - location: https://pypi.org/project/aiohttp/ - license: Apache Software License (Apache 2) - license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt + - name: httpx + min-version: "0.28.0" + location: https://pypi.org/project/httpx/ + license: BSD License (BSD-3-Clause) + license-url: https://github.com/encode/httpx/blob/master/LICENSE.md is-required: Required - language: python @@ -162,11 +156,11 @@ sdks: license-url: https://github.com/agronholm/cbor2/blob/master/LICENSE.txt is-required: Required - - name: aiohttp - min-version: "2.3.10" - location: https://pypi.org/project/aiohttp/ - license: Apache Software License (Apache 2) - license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt + name: httpx + min-version: "0.28.0" + location: https://pypi.org/project/httpx/ + license: BSD License (BSD-3-Clause) + license-url: https://github.com/encode/httpx/blob/master/LICENSE.md is-required: Required changelog: - date: 2024-11-19 diff --git a/README.md b/README.md index e548c8d9..e713b1fd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your ## Configure PubNub 1. Integrate the Python SDK into your project using `pip`: - + ```bash pip install pubnub ``` @@ -83,9 +83,8 @@ pubnub.subscribe().channels('my_channel').execute() ## Documentation -* [Build your first realtime Python app with PubNub](https://www.pubnub.com/docs/platform/quickstarts/python) -* [API reference for Python](https://www.pubnub.com/docs/python/pubnub-python-sdk) -* [API reference for Python (asyncio)](https://www.pubnub.com/docs/python-aiohttp/pubnub-python-sdk) +* [Build your first realtime Python app with PubNub](https://www.pubnub.com/docs/general/basics/set-up-your-account) +* [API reference for Python](https://www.pubnub.com/docs/sdks/python) ## Support diff --git a/pubnub/crypto.py b/pubnub/crypto.py index f61269f5..095c8fd2 100644 --- a/pubnub/crypto.py +++ b/pubnub/crypto.py @@ -104,6 +104,8 @@ def decrypt(self, key, file, use_random_iv=True): cipher = AES.new(bytes(secret[0:32], "utf-8"), self.mode, initialization_vector) result = unpad(cipher.decrypt(extracted_file), 16) except ValueError: + if not self.fallback_mode: # No fallback mode so we return the original content + return file cipher = AES.new(bytes(secret[0:32], "utf-8"), self.fallback_mode, initialization_vector) result = unpad(cipher.decrypt(extracted_file), 16) diff --git a/pubnub/endpoints/file_operations/download_file.py b/pubnub/endpoints/file_operations/download_file.py index 3436d668..8bdddf87 100644 --- a/pubnub/endpoints/file_operations/download_file.py +++ b/pubnub/endpoints/file_operations/download_file.py @@ -5,6 +5,7 @@ from pubnub.request_handlers.requests_handler import RequestsRequestHandler from pubnub.endpoints.file_operations.get_file_url import GetFileDownloadUrl from warnings import warn +from urllib.parse import urlparse, parse_qs class DownloadFileNative(FileOperationEndpoint): @@ -69,7 +70,8 @@ def use_base_path(self): return False def build_params_callback(self): - return lambda a: {} + params = parse_qs(urlparse(self._download_data.result.file_url).query) + return lambda a: {key: str(params[key][0]) for key in params.keys()} def name(self): return "Downloading file" diff --git a/pubnub/endpoints/file_operations/send_file_asyncio.py b/pubnub/endpoints/file_operations/send_file_asyncio.py index 5ecf7db0..b6f65e80 100644 --- a/pubnub/endpoints/file_operations/send_file_asyncio.py +++ b/pubnub/endpoints/file_operations/send_file_asyncio.py @@ -4,27 +4,25 @@ class AsyncioSendFile(SendFileNative): - def options(self): - request_options = super(SendFileNative, self).options() - request_options.data = request_options.files - return request_options - async def future(self): - self._file_upload_envelope = await FetchFileUploadS3Data(self._pubnub).\ - channel(self._channel).\ - file_name(self._file_name).future() + self._file_upload_envelope = await FetchFileUploadS3Data(self._pubnub) \ + .channel(self._channel) \ + .file_name(self._file_name).future() response_envelope = await super(SendFileNative, self).future() - publish_file_response = await PublishFileMessage(self._pubnub).\ - channel(self._channel).\ - meta(self._meta).\ - message(self._message).\ - file_id(response_envelope.result.file_id).\ - file_name(response_envelope.result.name).\ - should_store(self._should_store).\ - ttl(self._ttl).\ - cipher_key(self._cipher_key).future() + publish_file_response = await PublishFileMessage(self._pubnub) \ + .channel(self._channel) \ + .meta(self._meta) \ + .message(self._message) \ + .file_id(response_envelope.result.file_id) \ + .file_name(response_envelope.result.name) \ + .should_store(self._should_store) \ + .ttl(self._ttl) \ + .replicate(self._replicate) \ + .ptto(self._ptto) \ + .custom_message_type(self._custom_message_type) \ + .cipher_key(self._cipher_key).future() response_envelope.result.timestamp = publish_file_response.result.timestamp return response_envelope diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index 62d7d494..d817cd54 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -7,7 +7,6 @@ import urllib from asyncio import Event, Queue, Semaphore -from yarl import URL from httpx import AsyncHTTPTransport from pubnub.event_engine.containers import PresenceStateContainer from pubnub.event_engine.models import events, states @@ -180,7 +179,8 @@ async def _request_helper(self, options_func, cancellation_event): else: url = utils.build_url(scheme="", origin="", path=options.path, params=options.query_string) - url = str(URL(url, encoded=True)) + full_url = httpx.URL(url, query=options.query_string.encode('utf-8')) + logger.debug("%s %s %s" % (options.method_string, url, options.data)) if options.request_headers: @@ -188,18 +188,23 @@ async def _request_helper(self, options_func, cancellation_event): else: request_headers = self.headers + request_arguments = { + 'method': options.method_string, + 'headers': request_headers, + 'url': full_url, + 'follow_redirects': options.allow_redirects, + 'timeout': (options.connect_timeout, options.request_timeout), + } + if options.is_post() or options.is_patch(): + request_arguments['content'] = options.data + request_arguments['files'] = options.files + try: if not self._session: await self.create_session() start_timestamp = time.time() response = await asyncio.wait_for( - self._session.request( - options.method_string, - url, - headers=request_headers, - data=options.data if options.data else None, - follow_redirects=options.allow_redirects - ), + self._session.request(**request_arguments), options.request_timeout ) except (asyncio.TimeoutError, asyncio.CancelledError): diff --git a/pubnub/pubnub_core.py b/pubnub/pubnub_core.py index f630acd1..90dc215d 100644 --- a/pubnub/pubnub_core.py +++ b/pubnub/pubnub_core.py @@ -225,7 +225,7 @@ def publish(self, channel: str = None, message: any = None, should_store: Option def grant(self): """ Deprecated. Use grant_token instead """ - warn("This method will stop working on 31th December 2024. We recommend that you use grant_token() instead.", + warn("Access management v2 is being deprecated. We recommend switching to grant_token().", DeprecationWarning, stacklevel=2) return Grant(self) @@ -240,7 +240,7 @@ def revoke_token(self, token: str) -> RevokeToken: def audit(self): """ Deprecated """ - warn("This method will stop working on 31th December 2024.", DeprecationWarning, stacklevel=2) + warn("Access management v2 is being deprecated.", DeprecationWarning, stacklevel=2) return Audit(self) # Push Related methods diff --git a/pubnub/request_handlers/requests_handler.py b/pubnub/request_handlers/requests_handler.py index a1ef6fd3..7a77a728 100644 --- a/pubnub/request_handlers/requests_handler.py +++ b/pubnub/request_handlers/requests_handler.py @@ -1,6 +1,5 @@ import logging import threading -import requests import httpx import json # noqa # pylint: disable=W0611 import urllib @@ -237,14 +236,13 @@ def _invoke_request(self, p_options, e_options, base_origin): args = { "method": e_options.method_string, "headers": request_headers, - "url": url, - "params": e_options.query_string, + "url": httpx.URL(url, query=e_options.query_string.encode("utf-8")), "timeout": (e_options.connect_timeout, e_options.request_timeout), "follow_redirects": e_options.allow_redirects } if e_options.is_post() or e_options.is_patch(): - args["data"] = e_options.data + args["content"] = e_options.data args["files"] = e_options.files logger.debug("%s %s %s" % ( e_options.method_string, @@ -265,32 +263,33 @@ def _invoke_request(self, p_options, e_options, base_origin): try: res = self.session.request(**args) logger.debug("GOT %s" % res.text) - except requests.exceptions.ConnectionError as e: + + except httpx.ConnectError as e: raise PubNubException( pn_error=PNERR_CONNECTION_ERROR, errormsg=str(e) ) - except requests.exceptions.HTTPError as e: - raise PubNubException( - pn_error=PNERR_HTTP_ERROR, - errormsg=str(e) - ) - except requests.exceptions.Timeout as e: + except httpx.TimeoutException as e: raise PubNubException( pn_error=PNERR_CLIENT_TIMEOUT, errormsg=str(e) ) - except requests.exceptions.TooManyRedirects as e: + except httpx.TooManyRedirects as e: raise PubNubException( pn_error=PNERR_TOO_MANY_REDIRECTS_ERROR, errormsg=str(e) ) + except httpx.HTTPStatusError as e: + raise PubNubException( + pn_error=PNERR_HTTP_ERROR, + errormsg=str(e), + status_code=e.response.status_code + ) except Exception as e: raise PubNubException( pn_error=PNERR_UNKNOWN_ERROR, errormsg=str(e) ) - return res diff --git a/setup.py b/setup.py index 6c86c082..4511e64f 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,9 @@ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: Implementation :: CPython', 'License :: Other/Proprietary License', 'Operating System :: OS Independent', @@ -30,10 +33,8 @@ python_requires='>=3.7', install_requires=[ 'pycryptodomex>=3.3', - 'requests>=2.4', - 'httpx>=0.18', - 'cbor2', - 'aiohttp' + 'httpx>=0.28', + 'cbor2>=5.6' ], zip_safe=False, ) diff --git a/tests/helper.py b/tests/helper.py index 2a55782b..24da50ac 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -196,8 +196,8 @@ def pnconf_pam_copy(): return deepcopy(pnconf_pam) -def pnconf_pam_stub_copy(): - return deepcopy(pnconf_pam_stub) +def pnconf_pam_stub_copy(**kwargs): + return copy_and_update(pnconf_pam_stub, **kwargs) def pnconf_pam_acceptance_copy(): diff --git a/tests/integrational/asyncio/test_file_upload.py b/tests/integrational/asyncio/test_file_upload.py index 738d1e8c..cd7d8c5c 100644 --- a/tests/integrational/asyncio/test_file_upload.py +++ b/tests/integrational/asyncio/test_file_upload.py @@ -66,10 +66,10 @@ async def test_list_files(): await pubnub.stop() -@pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json", serializer="pn_json", - filter_query_parameters=['uuid', 'l_file', 'pnsdk'] -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json", serializer="pn_json", +# filter_query_parameters=['uuid', 'l_file', 'pnsdk'] +# ) @pytest.mark.asyncio(loop_scope="module") async def test_send_and_download_file(file_for_upload): pubnub = PubNubAsyncio(pnconf_env_copy()) @@ -83,11 +83,12 @@ async def test_send_and_download_file(file_for_upload): await pubnub.stop() -@pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json", - filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json", +# filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' +# ) @pytest.mark.asyncio(loop_scope="module") +@pytest.mark.filterwarnings("ignore:.*Usage of local cipher_keys is discouraged.*:DeprecationWarning") async def test_send_and_download_file_encrypted_cipher_key(file_for_upload, file_upload_test_data): pubnub = PubNubAsyncio(pnconf_enc_env_copy()) @@ -105,10 +106,10 @@ async def test_send_and_download_file_encrypted_cipher_key(file_for_upload, file await pubnub.stop() -@pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", - filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", +# filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' +# ) @pytest.mark.asyncio(loop_scope="module") async def test_send_and_download_encrypted_file_crypto_module(file_for_upload, file_upload_test_data): pubnub = PubNubAsyncio(pnconf_enc_env_copy()) diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json index 0d103f6a..e19d3f17 100644 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_cipher_key.json @@ -7,98 +7,26 @@ "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", "body": "{\"name\": \"king_arthur.txt\"}", "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.4.2" + "host": [ + "ps.pndsn.com" ], - "Content-type": [ - "application/json" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Wed, 27 Mar 2024 14:15:16 GMT" + "accept": [ + "*/*" ], - "Content-Type": [ - "application/json" + "accept-encoding": [ + "gzip, deflate" ], - "Content-Length": [ - "1989" - ], - "Connection": [ + "connection": [ "keep-alive" ], - "Access-Control-Allow-Origin": [ - "*" - ] - }, - "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"4cee979e-98a6-4019-83f9-a8506e7333e9\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-03-27T14:16:16Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/4cee979e-98a6-4019-83f9-a8506e7333e9/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20240327/eu-central-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20240327T141616Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMDMtMjdUMTQ6MTY6MTZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtODhiOWRiYWItMjBmMS00OGQ0LThkZjMtOWJmYWJiMDBjMGI0LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNGNlZTk3OWUtOThhNi00MDE5LTgzZjktYTg1MDZlNzMzM2U5L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQwMzI3L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDAzMjdUMTQxNjE2WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"2b4c77b2bfdd08bf83b5bb642d4b0062da19f04e09fb7b5c1b856c2d8d16d956\"}]}}" - } - } - }, - { - "request": { - "method": "POST", - "uri": "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/", - "body": { - "pickle": "gASVQBIAAAAAAACMEGFpb2h0dHAuZm9ybWRhdGGUjAhGb3JtRGF0YZSTlCmBlH2UKIwHX3dyaXRlcpSMEWFpb2h0dHAubXVsdGlwYXJ0lIwPTXVsdGlwYXJ0V3JpdGVylJOUKYGUfZQojAlfYm91bmRhcnmUQyA3MjYyYWJjMzY3ZmM0ZGYzOTk0MGQ3ZmI5N2M4ZjBmZZSMCV9lbmNvZGluZ5ROjAlfZmlsZW5hbWWUTowIX2hlYWRlcnOUjBRtdWx0aWRpY3QuX211bHRpZGljdJSMC0NJTXVsdGlEaWN0lJOUXZRoEIwEaXN0cpSTlIwMQ29udGVudC1UeXBllIWUgZSMPm11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PTcyNjJhYmMzNjdmYzRkZjM5OTQwZDdmYjk3YzhmMGZllIaUYYWUUpSMBl92YWx1ZZROjAZfcGFydHOUXZQojA9haW9odHRwLnBheWxvYWSUjA1TdHJpbmdQYXlsb2FklJOUKYGUfZQoaA2MBXV0Zi04lGgOTmgPaBJdlChoGIwTbXVsdGlwYXJ0L2Zvcm0tZGF0YZSGlGgVjBNDb250ZW50LURpc3Bvc2l0aW9ulIWUgZSMGWZvcm0tZGF0YTsgbmFtZT0idGFnZ2luZyKUhpRoFYwOQ29udGVudC1MZW5ndGiUhZSBlIwCODmUhpRlhZRSlGgdQ1k8VGFnZ2luZz48VGFnU2V0PjxUYWc+PEtleT5PYmplY3RUVExJbkRheXM8L0tleT48VmFsdWU+MTwvVmFsdWU+PC9UYWc+PC9UYWdTZXQ+PC9UYWdnaW5nP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MD2tpbmdfYXJ0aHVyLnR4dJSGlGWFlFKUfZRoGGiec2imh5RljA1faXNfbXVsdGlwYXJ0lIiMDV9pc19wcm9jZXNzZWSUiIwNX3F1b3RlX2ZpZWxkc5SIjAhfY2hhcnNldJROdWIu" - }, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.4.2" - ] - } - }, - "response": { - "status": { - "code": 204, - "message": "No Content" - }, - "headers": { - "x-amz-id-2": [ - "sLfBX7SyW1G9k55Z0mYBFPxhudkF9Qz9/y4XDxSMpLIMyJXRYRp3S3XveE9no3xX3T+Hi45AXh25iocM3rWjUQ==" - ], - "x-amz-request-id": [ - "W4CR5WKB0MKJ20FJ" - ], - "Date": [ - "Wed, 27 Mar 2024 14:15:17 GMT" - ], - "x-amz-expiration": [ - "expiry-date=\"Fri, 29 Mar 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "Etag": [ - "\"54c0565f0dd787c6d22c3d455b12d6ac\"" + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ], - "Location": [ - "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F4cee979e-98a6-4019-83f9-a8506e7333e9%2Fking_arthur.txt" + "content-type": [ + "application/json" ], - "Server": [ - "AmazonS3" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%22a25pZ2h0c29mbmkxMjM0NXmhf%2BORk1GxlwqjcrSxSR7QjuwQHs4oHPiUsXidPQkk1vPPyxRJDAK7XvCHEfoIK%2FRZQp7A%2BLcccQ7uFhyz1B%2BH07cIalE%2F6KNNxUx40Y0a57VZsd6%2BAXuhmCuggimMsgCIxXIR5RWpZBBETdr8VBBDrQz0gGmCFgPp6%2Fji%2BQLO%22?meta=null&store=1&ttl=222", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.4.2" + "content-length": [ + "27" ] } }, @@ -109,135 +37,88 @@ }, "headers": { "Date": [ - "Wed, 27 Mar 2024 14:15:16 GMT" + "Mon, 09 Dec 2024 15:38:05 GMT" ], "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" + "application/json" ], "Content-Length": [ - "30" + "1982" ], "Connection": [ "keep-alive" ], - "Cache-Control": [ - "no-cache" + "Access-Control-Allow-Credentials": [ + "true" ], - "Access-Control-Allow-Origin": [ + "Access-Control-Expose-Headers": [ "*" - ], - "Access-Control-Allow-Methods": [ - "GET" ] }, "body": { - "string": "[1,\"Sent\",\"17115489163320100\"]" + "string": "{\"status\":200,\"data\":{\"id\":\"c7e30d08-b0af-4923-99b4-c2be5f931ff2\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-09T15:39:05Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/c7e30d08-b0af-4923-99b4-c2be5f931ff2/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241209/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241209T153905Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDVaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYzdlMzBkMDgtYjBhZi00OTIzLTk5YjQtYzJiZTVmOTMxZmYyL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA1WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"df74a5c203a340d443760e4ee28f0b6d7abb01e20cc73ee611b33d92251cb049\"}]}}" } } }, { "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/4cee979e-98a6-4019-83f9-a8506e7333e9/king_arthur.txt", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.4.2" - ] - } - }, - "response": { - "status": { - "code": 307, - "message": "Temporary Redirect" - }, + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": "tagging=&tagging=%3CTagging%3E%3CTagSet%3E%3CTag%3E%3CKey%3EObjectTTLInDays%3C%2FKey%3E%3CValue%3E1%3C%2FValue%3E%3C%2FTag%3E%3C%2FTagSet%3E%3C%2FTagging%3E&key=&key={PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fc7e30d08-b0af-4923-99b4-c2be5f931ff2%2Fking_arthur.txt&Content-Type=&Content-Type=text%2Fplain%3B+charset%3Dutf-8&X-Amz-Credential=&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Security-Token=&X-Amz-Security-Token=&X-Amz-Algorithm=&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=&X-Amz-Date=20241209T153905Z&Policy=&Policy=CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDVaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc%2BPFRhZ1NldD48VGFnPjxLZXk%2BT2JqZWN0VFRMSW5EYXlzPC9LZXk%2BPFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYzdlMzBkMDgtYjBhZi00OTIzLTk5YjQtYzJiZTVmOTMxZmYyL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA1WiIgfQoJXQp9Cg%3D%3D&X-Amz-Signature=&X-Amz-Signature=df74a5c203a340d443760e4ee28f0b6d7abb01e20cc73ee611b33d92251cb049&file=king_arthur.txt&file=b%27knightsofni12345%5Cxb5%5Cxe2%5Cxde%5Cx10%5Cn%5Cxce%5Cx96t%7D%5Cx12%5Cx16j%5Cxbb%60k%5Cxac%5Cx81%5Cxce%5Cx8a%5Cxed%5Cxea%5Cxb8%5Cxf5%5Cxd7%5Cx13V%5Cxceg%40%5Cx14h%5Cx7f%27&file=", "headers": { - "Date": [ - "Wed, 27 Mar 2024 14:15:16 GMT" + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" ], - "Content-Length": [ - "0" + "accept": [ + "*/*" ], - "Connection": [ + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ "keep-alive" ], - "Access-Control-Allow-Origin": [ - "*" + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ], - "Cache-Control": [ - "public, max-age=2924, immutable" + "content-length": [ + "1830" ], - "Location": [ - "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/4cee979e-98a6-4019-83f9-a8506e7333e9/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20240327%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240327T140000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=337cf3bf979ff66c54a9b499ca706ae0b63d0c78518889d304efcc9e25a7c9c1" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/4cee979e-98a6-4019-83f9-a8506e7333e9/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20240327%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240327T140000Z&X-Amz-Expires=3900&X-Amz-Signature=337cf3bf979ff66c54a9b499ca706ae0b63d0c78518889d304efcc9e25a7c9c1&X-Amz-SignedHeaders=host", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.4.2" + "content-type": [ + "application/x-www-form-urlencoded" ] } }, "response": { "status": { - "code": 200, - "message": "OK" + "code": 400, + "message": "Bad Request" }, "headers": { - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Content-Length": [ - "48" - ], - "Connection": [ - "keep-alive" - ], - "Date": [ - "Wed, 27 Mar 2024 14:15:17 GMT" + "x-amz-request-id": [ + "BP3X0AAZD6WF2T57" ], - "Last-Modified": [ - "Wed, 27 Mar 2024 14:15:17 GMT" + "x-amz-id-2": [ + "KoIsidWfwva/XBOvHo6JGnQ9ceUd+mHB4BQxzEG2duZkLcnxTmYdDW1fAkkr6H5VXFd/rG/S0Pg=" ], - "x-amz-expiration": [ - "expiry-date=\"Fri, 29 Mar 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + "Content-Type": [ + "application/xml" ], - "Etag": [ - "\"54c0565f0dd787c6d22c3d455b12d6ac\"" + "Transfer-Encoding": [ + "chunked" ], - "x-amz-server-side-encryption": [ - "AES256" + "Date": [ + "Mon, 09 Dec 2024 15:38:05 GMT" ], - "Accept-Ranges": [ - "bytes" + "Connection": [ + "close" ], "Server": [ "AmazonS3" - ], - "X-Cache": [ - "Miss from cloudfront" - ], - "Via": [ - "1.1 51ef96adddea56ccd77a68113e740792.cloudfront.net (CloudFront)" - ], - "X-Amz-Cf-Pop": [ - "HAM50-P3" - ], - "X-Amz-Cf-Id": [ - "k-y4MUu4bX9-Ii1rYUfV7gMhU-NvxnR-4bLhA70SWiNeEAIAh_lb6g==" ] }, "body": { - "binary": "a25pZ2h0c29mbmkxMjM0NbXi3hAKzpZ0fRIWartga6yBzort6rj11xNWzmdAFGh/" + "string": "\nAuthorizationQueryParametersErrorX-Amz-Algorithm only supports \"AWS4-HMAC-SHA256 and AWS4-ECDSA-P256-SHA256\"BP3X0AAZD6WF2T57KoIsidWfwva/XBOvHo6JGnQ9ceUd+mHB4BQxzEG2duZkLcnxTmYdDW1fAkkr6H5VXFd/rG/S0Pg=" } } } diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json index eab19a6f..7c751f43 100644 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json @@ -7,98 +7,26 @@ "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", "body": "{\"name\": \"king_arthur.txt\"}", "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.2.0" + "host": [ + "ps.pndsn.com" ], - "Content-type": [ - "application/json" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Wed, 04 Oct 2023 21:18:29 GMT" + "accept": [ + "*/*" ], - "Content-Type": [ - "application/json" + "accept-encoding": [ + "gzip, deflate" ], - "Content-Length": [ - "1989" - ], - "Connection": [ + "connection": [ "keep-alive" ], - "Access-Control-Allow-Origin": [ - "*" - ] - }, - "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"b22c070e-905a-4991-9fed-adac8fa8af16\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2023-10-04T21:19:29Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/b22c070e-905a-4991-9fed-adac8fa8af16/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20231004/eu-central-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20231004T211929Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjMtMTAtMDRUMjE6MTk6MjlaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtODhiOWRiYWItMjBmMS00OGQ0LThkZjMtOWJmYWJiMDBjMGI0LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYjIyYzA3MGUtOTA1YS00OTkxLTlmZWQtYWRhYzhmYThhZjE2L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjMxMDA0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMzEwMDRUMjExOTI5WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"5099f1cca2ca8fea8fe4e2a52b14c222aab151465170a83ec606651750e2824e\"}]}}" - } - } - }, - { - "request": { - "method": "POST", - "uri": "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/", - "body": { - "pickle": "gASV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, - "message": "No Content" - }, - "headers": { - "x-amz-id-2": [ - "V2r626odxjnMqEQmtN3oehjg6sglTjhLO1pieDbc8V8EnKYbMiqPANmfJ26Vp6jDEDbSagrSASc=" - ], - "x-amz-request-id": [ - "SV4ABQRDEFARYBAS" - ], - "Date": [ - "Wed, 04 Oct 2023 21:18:30 GMT" - ], - "x-amz-expiration": [ - "expiry-date=\"Fri, 06 Oct 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "Etag": [ - "\"362a42f11bfefffa798da06de4b19c69\"" + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ], - "Location": [ - "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fb22c070e-905a-4991-9fed-adac8fa8af16%2Fking_arthur.txt" + "content-type": [ + "application/json" ], - "Server": [ - "AmazonS3" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%22a25pZ2h0c29mbmkxMjM0NRV4jkZbYJKJpBh%2Ffy8gkkKwgHzJoLg%2FKPi4WjFBAQgYCqObP0j7BPevaNiSqFIQ%2FxkMxOZqOrIpql4hH9b%2B2pRRdQ0X8NGVLSR%2B7UtVZsZ1KGdglj05%2BEckPBWJ%2BiVsJVsWEtc2%2BkP1c6j5CuoHz3XD9cFfQ4RyNNudWGa1quE2%22?meta=null&store=1&ttl=222", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.2.0" + "content-length": [ + "27" ] } }, @@ -109,135 +37,88 @@ }, "headers": { "Date": [ - "Wed, 04 Oct 2023 21:18:29 GMT" + "Mon, 09 Dec 2024 15:38:06 GMT" ], "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" + "application/json" ], "Content-Length": [ - "30" + "1982" ], "Connection": [ "keep-alive" ], - "Cache-Control": [ - "no-cache" + "Access-Control-Allow-Credentials": [ + "true" ], - "Access-Control-Allow-Origin": [ + "Access-Control-Expose-Headers": [ "*" - ], - "Access-Control-Allow-Methods": [ - "GET" ] }, "body": { - "string": "[1,\"Sent\",\"16964543094635156\"]" + "string": "{\"status\":200,\"data\":{\"id\":\"10964cc6-bb29-4d16-a99d-807d47790cb3\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-09T15:39:06Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/10964cc6-bb29-4d16-a99d-807d47790cb3/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241209/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241209T153906Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvMTA5NjRjYzYtYmIyOS00ZDE2LWE5OWQtODA3ZDQ3NzkwY2IzL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA2WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"4e960086760d62dd32605d17ff958a7eb858f034f8d23cd7f612ab241782128d\"}]}}" } } }, { "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/b22c070e-905a-4991-9fed-adac8fa8af16/king_arthur.txt", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.2.0" - ] - } - }, - "response": { - "status": { - "code": 307, - "message": "Temporary Redirect" - }, + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": "tagging=&tagging=%3CTagging%3E%3CTagSet%3E%3CTag%3E%3CKey%3EObjectTTLInDays%3C%2FKey%3E%3CValue%3E1%3C%2FValue%3E%3C%2FTag%3E%3C%2FTagSet%3E%3C%2FTagging%3E&key=&key={PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F10964cc6-bb29-4d16-a99d-807d47790cb3%2Fking_arthur.txt&Content-Type=&Content-Type=text%2Fplain%3B+charset%3Dutf-8&X-Amz-Credential=&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Security-Token=&X-Amz-Security-Token=&X-Amz-Algorithm=&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=&X-Amz-Date=20241209T153906Z&Policy=&Policy=CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc%2BPFRhZ1NldD48VGFnPjxLZXk%2BT2JqZWN0VFRMSW5EYXlzPC9LZXk%2BPFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvMTA5NjRjYzYtYmIyOS00ZDE2LWE5OWQtODA3ZDQ3NzkwY2IzL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA2WiIgfQoJXQp9Cg%3D%3D&X-Amz-Signature=&X-Amz-Signature=4e960086760d62dd32605d17ff958a7eb858f034f8d23cd7f612ab241782128d&file=king_arthur.txt&file=b%27knightsofni12345%5Cxdd%5Cxd6%5Cx1e%5Cxf6%5Cxe8Ia%5Cx87%5Cxa3%5Cx10%5Cxf1%5Cx02%3F%5Cxd0%5Cx05g%5Cx87%5Cxc5%5Cxad%5Cx93%5Cx92%5Cxab%5D%5Cx8e%24%5Cxfd%5Cx87%23%5Cxfc%5Cxd1%5Cx02%26%27&file=", "headers": { - "Date": [ - "Wed, 04 Oct 2023 21:18:29 GMT" + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" ], - "Content-Length": [ - "0" + "accept": [ + "*/*" ], - "Connection": [ + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ "keep-alive" ], - "Access-Control-Allow-Origin": [ - "*" + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ], - "Cache-Control": [ - "public, max-age=2731, immutable" + "content-length": [ + "1841" ], - "Location": [ - "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/b22c070e-905a-4991-9fed-adac8fa8af16/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20231004%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20231004T210000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=1c98bdcaaa8e8b4a46527a6dd9d93e07a40750e75f3c9d65a46070c35488b97d" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/b22c070e-905a-4991-9fed-adac8fa8af16/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20231004%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20231004T210000Z&X-Amz-Expires=3900&X-Amz-Signature=1c98bdcaaa8e8b4a46527a6dd9d93e07a40750e75f3c9d65a46070c35488b97d&X-Amz-SignedHeaders=host", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/7.2.0" + "content-type": [ + "application/x-www-form-urlencoded" ] } }, "response": { "status": { - "code": 200, - "message": "OK" + "code": 400, + "message": "Bad Request" }, "headers": { - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Content-Length": [ - "48" - ], - "Connection": [ - "keep-alive" - ], - "Date": [ - "Wed, 04 Oct 2023 21:18:30 GMT" + "x-amz-request-id": [ + "45FBTK5ZK0HWSPE3" ], - "Last-Modified": [ - "Wed, 04 Oct 2023 21:18:30 GMT" + "x-amz-id-2": [ + "FpJ4LZGyVNHgWbR70beRKQ+j7tqUgucrZbbjzVLNg0tEvotzM5R4hfLZ/TIl3Lv/Eb4AG6RbVLU=" ], - "x-amz-expiration": [ - "expiry-date=\"Fri, 06 Oct 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + "Content-Type": [ + "application/xml" ], - "Etag": [ - "\"362a42f11bfefffa798da06de4b19c69\"" + "Transfer-Encoding": [ + "chunked" ], - "x-amz-server-side-encryption": [ - "AES256" + "Date": [ + "Mon, 09 Dec 2024 15:38:05 GMT" ], - "Accept-Ranges": [ - "bytes" + "Connection": [ + "close" ], "Server": [ "AmazonS3" - ], - "X-Cache": [ - "Miss from cloudfront" - ], - "Via": [ - "1.1 418adba378bf9a2158988959402e17a6.cloudfront.net (CloudFront)" - ], - "X-Amz-Cf-Pop": [ - "WAW51-P3" - ], - "X-Amz-Cf-Id": [ - "Ih3dVdK-NGOjK8nPNKg7GDN5Ifsd2e7ZgNiQ7A28YvDG0cclAlOM7g==" ] }, "body": { - "binary": "NjEyNDY0MzY0MzA0Mjk1NGaRM9sYxcHerM2AML91WtL/6siVzzQuU0c4VZpXFS24" + "string": "\nAuthorizationQueryParametersErrorX-Amz-Algorithm only supports \"AWS4-HMAC-SHA256 and AWS4-ECDSA-P256-SHA256\"45FBTK5ZK0HWSPE3FpJ4LZGyVNHgWbR70beRKQ+j7tqUgucrZbbjzVLNg0tEvotzM5R4hfLZ/TIl3Lv/Eb4AG6RbVLU=" } } } diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json index 6fa6063f..0d5d7606 100644 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json @@ -7,11 +7,26 @@ "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", "body": "{\"name\": \"king_arthur.txt\"}", "headers": { - "User-Agent": [ + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ "PubNub-Python-Asyncio/9.1.0" ], - "Content-type": [ + "content-type": [ "application/json" + ], + "content-length": [ + "27" ] } }, @@ -22,7 +37,7 @@ }, "headers": { "Date": [ - "Tue, 03 Dec 2024 14:48:28 GMT" + "Mon, 09 Dec 2024 15:38:04 GMT" ], "Content-Type": [ "application/json" @@ -41,7 +56,7 @@ ] }, "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"55efe26a-3aa3-4f15-bb49-394630953b75\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-03T14:49:28Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241203/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241203T144928Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDNUMTQ6NDk6MjhaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNTVlZmUyNmEtM2FhMy00ZjE1LWJiNDktMzk0NjMwOTUzYjc1L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjAzL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDNUMTQ0OTI4WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"d096204393f950ef72f2ac8f2716c6bc21520511b15b34335be5be6c363fcf9a\"}]}}" + "string": "{\"status\":200,\"data\":{\"id\":\"740ff3c3-6e0e-4849-801b-995dec393bca\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-09T15:39:04Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/740ff3c3-6e0e-4849-801b-995dec393bca/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241209/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241209T153904Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDRaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNzQwZmYzYzMtNmUwZS00ODQ5LTgwMWItOTk1ZGVjMzkzYmNhL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA0WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"ebb872e578135630979d016807f021e3f954a7ae97f8e8a98a513262991f7902\"}]}}" } } }, @@ -49,204 +64,61 @@ "request": { "method": "POST", "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", - "body": { - "pickle": "gASVmhEAAAAAAACMEGFpb2h0dHAuZm9ybWRhdGGUjAhGb3JtRGF0YZSTlCmBlH2UKIwHX3dyaXRlcpSMEWFpb2h0dHAubXVsdGlwYXJ0lIwPTXVsdGlwYXJ0V3JpdGVylJOUKYGUfZQojAlfYm91bmRhcnmUQyBkYzhiNzIxMzM5Y2U0ODNhODhlMTQ0MDc5NTczN2ZjNJSMCV9lbmNvZGluZ5ROjAlfZmlsZW5hbWWUTowIX2hlYWRlcnOUjBRtdWx0aWRpY3QuX211bHRpZGljdJSMC0NJTXVsdGlEaWN0lJOUXZRoEIwEaXN0cpSTlIwMQ29udGVudC1UeXBllIWUgZSMPm11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PWRjOGI3MjEzMzljZTQ4M2E4OGUxNDQwNzk1NzM3ZmM0lIaUYYWUUpSMBl92YWx1ZZROjAZfcGFydHOUXZQojA9haW9odHRwLnBheWxvYWSUjA1TdHJpbmdQYXlsb2FklJOUKYGUfZQoaA2MBXV0Zi04lGgOTmgPaBJdlChoGIwTbXVsdGlwYXJ0L2Zvcm0tZGF0YZSGlGgVjBNDb250ZW50LURpc3Bvc2l0aW9ulIWUgZSMGWZvcm0tZGF0YTsgbmFtZT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aUZYWUUpR9lGgYaIhzaI6HlGWMDV9pc19tdWx0aXBhcnSUiIwNX2lzX3Byb2Nlc3NlZJSIjA1fcXVvdGVfZmllbGRzlIiMCF9jaGFyc2V0lE51Yi4=" - }, + "body": "tagging=&tagging=%3CTagging%3E%3CTagSet%3E%3CTag%3E%3CKey%3EObjectTTLInDays%3C%2FKey%3E%3CValue%3E1%3C%2FValue%3E%3C%2FTag%3E%3C%2FTagSet%3E%3C%2FTagging%3E&key=&key={PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F740ff3c3-6e0e-4849-801b-995dec393bca%2Fking_arthur.txt&Content-Type=&Content-Type=text%2Fplain%3B+charset%3Dutf-8&X-Amz-Credential=&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Security-Token=&X-Amz-Security-Token=&X-Amz-Algorithm=&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=&X-Amz-Date=20241209T153904Z&Policy=&Policy=CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDRaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc%2BPFRhZ1NldD48VGFnPjxLZXk%2BT2JqZWN0VFRMSW5EYXlzPC9LZXk%2BPFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvNzQwZmYzYzMtNmUwZS00ODQ5LTgwMWItOTk1ZGVjMzkzYmNhL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA5L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDlUMTUzOTA0WiIgfQoJXQp9Cg%3D%3D&X-Amz-Signature=&X-Amz-Signature=ebb872e578135630979d016807f021e3f954a7ae97f8e8a98a513262991f7902&file=king_arthur.txt&file=b%27Knights+who+say+Ni%21%27&file=", "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.1.0" - ] - } - }, - "response": { - "status": { - "code": 204, - "message": "No Content" - }, - "headers": { - "x-amz-id-2": [ - "fzh7ifvK42Ie7Qv8f2cChOodj0p9454TXkCUKcuIxZiBXALvvy0neLniX47eNJUyLRTzJp0asr8=" - ], - "x-amz-request-id": [ - "4EJZKE3DYEB9HPDZ" - ], - "Date": [ - "Tue, 03 Dec 2024 14:48:29 GMT" - ], - "x-amz-expiration": [ - "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" ], - "x-amz-server-side-encryption": [ - "AES256" + "accept": [ + "*/*" ], - "Etag": [ - "\"3676cdb7a927db43c846070c4e7606c7\"" + "accept-encoding": [ + "gzip, deflate" ], - "Location": [ - "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F55efe26a-3aa3-4f15-bb49-394630953b75%2Fking_arthur.txt" - ], - "Server": [ - "AmazonS3" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%2255efe26a-3aa3-4f15-bb49-394630953b75%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.1.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Date": [ - "Tue, 03 Dec 2024 14:48:28 GMT" - ], - "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" - ], - "Content-Length": [ - "30" - ], - "Connection": [ + "connection": [ "keep-alive" ], - "Cache-Control": [ - "no-cache" + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" ], - "Access-Control-Allow-Methods": [ - "GET" + "content-length": [ + "1684" ], - "Access-Control-Allow-Credentials": [ - "true" - ], - "Access-Control-Expose-Headers": [ - "*" - ] - }, - "body": { - "string": "[1,\"Sent\",\"17332373086977226\"]" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.1.0" + "content-type": [ + "application/x-www-form-urlencoded" ] } }, "response": { "status": { - "code": 307, - "message": "Temporary Redirect" + "code": 400, + "message": "Bad Request" }, "headers": { - "Date": [ - "Tue, 03 Dec 2024 14:48:28 GMT" - ], - "Content-Length": [ - "0" - ], - "Connection": [ - "keep-alive" - ], - "Cache-Control": [ - "public, max-age=932, immutable" - ], - "Location": [ - "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241203T140000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=464ddee6259c7537247771648bfe53921327d9030b0fc70fc013d8967bedf4bd" + "x-amz-request-id": [ + "BP3G8C294E7HAKNJ" ], - "Access-Control-Allow-Credentials": [ - "true" + "x-amz-id-2": [ + "zMeim2dB+COXRwPdjzh3SS6Y3cfSyojyXb7z67As/oXDVVDxWTIABZCeEXnSOV5ws+10nRrYiJA=" ], - "Access-Control-Expose-Headers": [ - "*" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/55efe26a-3aa3-4f15-bb49-394630953b75/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241203%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241203T140000Z&X-Amz-Expires=3900&X-Amz-Signature=464ddee6259c7537247771648bfe53921327d9030b0fc70fc013d8967bedf4bd&X-Amz-SignedHeaders=host", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python-Asyncio/9.1.0" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { "Content-Type": [ - "text/plain; charset=utf-8" + "application/xml" ], - "Content-Length": [ - "19" - ], - "Connection": [ - "keep-alive" + "Transfer-Encoding": [ + "chunked" ], "Date": [ - "Tue, 03 Dec 2024 14:48:30 GMT" - ], - "Last-Modified": [ - "Tue, 03 Dec 2024 14:48:29 GMT" - ], - "x-amz-expiration": [ - "expiry-date=\"Thu, 05 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + "Mon, 09 Dec 2024 15:38:04 GMT" ], - "Etag": [ - "\"3676cdb7a927db43c846070c4e7606c7\"" - ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "Accept-Ranges": [ - "bytes" + "Connection": [ + "close" ], "Server": [ "AmazonS3" - ], - "X-Cache": [ - "Miss from cloudfront" - ], - "Via": [ - "1.1 376388af58845ad0897ba599cce4d92e.cloudfront.net (CloudFront)" - ], - "X-Amz-Cf-Pop": [ - "HAM50-C1" - ], - "X-Amz-Cf-Id": [ - "N1qaPHKyjBiA8tY5y7c5pJwplvxUQG2mvHPB0TT9Br1YyMP_rCCzLg==" ] }, "body": { - "string": "Knights who say Ni!" + "string": "\nAuthorizationQueryParametersErrorX-Amz-Algorithm only supports \"AWS4-HMAC-SHA256 and AWS4-ECDSA-P256-SHA256\"BP3G8C294E7HAKNJzMeim2dB+COXRwPdjzh3SS6Y3cfSyojyXb7z67As/oXDVVDxWTIABZCeEXnSOV5ws+10nRrYiJA=" } } } diff --git a/tests/integrational/fixtures/native_sync/file_upload/delete_file.yaml b/tests/integrational/fixtures/native_sync/file_upload/delete_file.yaml deleted file mode 100644 index 60b54119..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/delete_file.yaml +++ /dev/null @@ -1,182 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA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k+EOc1phnC1a75YLKks0izgLih3QOZ/E8/LBZ0Xf3sli6KSnoIxdWCqvuhs4WxtwgQePTq1tw6Xi - WhBafgXhFs5f/aLcPbsr3iwiYsy0nZmzrLmc87q7yAzKxXQNzjxPT75TFoG7EnSO0J7Fie9pLHqE - vV5vhFjV4vd++5zSxUu6HypoA1es42VKqC66gNsONR7pA4banmfp8aMXtckO+aKe3gfepnnry4zq - gqU5WB1uxGh5ic9XJduq6U7DvSZQjgTnoIgquBtwyF20F83sFrq9XQQmu4DmLt5sZlCHrOYYbPCo - ny+6PFFdijoHge6aZVhvet89EsNWzkavZDFvsB6vlZEHy4i38uTKc7KqU+K7QNI9s/R52FOuou5t - XqlWr5rP33RHNYxVkIVeQ/GnOuS1fbzMyBs3b0v30J6DB6sHjj2f96bjf17D3WQxrfk5n+aUb0/P - zuntHB0NxxLcfJUmVqN51l5R02/fPl8ZeVrT3+vh9mDzvMADEUV8HEWY43kgoZhPRMROJHESCbyE - IyGRZaDIYSLzgiKyEhJBKPOKzImiRK/1f37+/BcAAP//AwAzID7/uAcAAA== - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 19 Nov 2020 20:00:48 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: "--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - tagging\"\r\n\r\nObjectTTLInDays1\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - key\"\r\n\r\nsub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/b9d9b767-02d6-44a7-aa1c-5c6701a9ceb8/king_arthur.txt\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - Content-Type\"\r\n\r\ntext/plain; charset=utf-8\r\n--c8b75015006dd33852fc387a65435719\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Credential\"\r\n\r\nAKIAY7AU6GQD5KWBS3FG/20201119/eu-central-1/s3/aws4_request\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Security-Token\"\r\n\r\n\r\n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition:\ - \ form-data; name=\"X-Amz-Algorithm\"\r\n\r\nAWS4-HMAC-SHA256\r\n--c8b75015006dd33852fc387a65435719\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Date\"\r\n\r\n20201119T200148Z\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - Policy\"\r\n\r\nCnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMTlUMjA6MDE6NDhaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvYjlkOWI3NjctMDJkNi00NGE3LWFhMWMtNWM2NzAxYTljZWI4L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTE5L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMTlUMjAwMTQ4WiIgfQoJXQp9Cg==\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Signature\"\r\n\r\n334315ac3dcce23316ad3f5a07657c436ec4f88198bf8349506a51b83982556e\r\ - \n--c8b75015006dd33852fc387a65435719\r\nContent-Disposition: form-data; name=\"\ - file\"; filename=\"king_arthur.txt\"\r\n\r\nKnights who say Ni!\r\n--c8b75015006dd33852fc387a65435719--\r\ - \n" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2314' - Content-Type: - - multipart/form-data; boundary=c8b75015006dd33852fc387a65435719 - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: - - Thu, 19 Nov 2020 20:00:50 GMT - ETag: - - '"3676cdb7a927db43c846070c4e7606c7"' - Location: - - https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2Fb9d9b767-02d6-44a7-aa1c-5c6701a9ceb8%2Fking_arthur.txt - Server: - - AmazonS3 - x-amz-expiration: - - expiry-date="Sat, 21 Nov 2020 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-id-2: - - taqK+GJWRVIcdyCiat2ttz2p7OArx27pj11rHs72wFIJx8AwFOBHH7p+AwuswS7TdQEaRytSH4U= - x-amz-request-id: - - 0D04E2CE1C7F7FC1 - x-amz-server-side-encryption: - - AES256 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22b9d9b767-02d6-44a7-aa1c-5c6701a9ceb8%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16058160503920483"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:00:50 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - PubNub-Python/4.6.1 - method: DELETE - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files/b9d9b767-02d6-44a7-aa1c-5c6701a9ceb8/king_arthur.txt?uuid=files_native_sync_uuid - response: - body: - string: '{"status":200}' - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Length: - - '14' - Content-Type: - - application/json - Date: - - Thu, 19 Nov 2020 20:00:50 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/download_file.yaml b/tests/integrational/fixtures/native_sync/file_upload/download_file.yaml deleted file mode 100644 index 801e694d..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/download_file.yaml +++ /dev/null @@ -1,231 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xV23KjOBD9lS2/zhBL3GKyNQ8EXxkgtsHisruVEiAwmIvHiNh4Kv++wk4y3snL - PmDUrdOt091H+OegoZi2zeCBB+DrIMYUDx5+DrJ48DAg0b2E+TjkZCm650QZJ5wS8jInQ0VQkpEy - EqA4+DqocEkYepdV6TM+0G17uKMnOnj9Okiygjy3+6LG8fOB/GhJQ/vk7aFg+C2l++ZhONy3YdWG - XFmRsm66inB9VMORlotIRQ+44CC3P8R3jXCHS3yuK3xs7qK6HLKjS0K3dU91+WQ7zCanfXbANKur - Z1ZJz4oHPOAg5KDi8OABwAegBAyY1IfyOclIEbPK//o52JGOgSlOU1YF23/BRduH/90CIETO1X8x - yIfLJvQ3z635nXRX8ynMSUQdx1hUY9w1193hx/bVRv15Vwd8Q9y43jy/nTD8zGH4H6ZsBO+V9b+/ - qmpYvyMuGo14kU8wBwVMWI9IyIWRILK2y0msyPc4UaRhwtGFGlme/qSUI5i4CD3XXGKvuBfS7q2D - U9RI3SxDslmthv9HL8PPMnnnqNUVZRPnnG5PbshScqLDfYGz6s8/oi0+NIR+a2nCjW5CPU4tz5x2 - IDFLkOHiJlz9vlD9e3Ujz1Zj6bv7aAvT2bBXBYRQGd6qbNgIQ6Yt8UOqv+e3SdQeMtpxTr0j1c0Z - n5BqkdYMuS1vibi2yM1NVePsucpL8qegca/YX/h3jky3APaq/YVf1kUW3Q5Uq5rvmq0XZP64j8op - wK7SLvI6XeSLo5mr1HQm7Ck2bC2b4wl7CrzIjn1MHvLSDnvrPXuf+xj3WOua12R+hXLMI3DJUz1C - v5Sgn0EaloiGgiWF5YYGZdEEnkkDb0N9HrXxXN+GGjgZ3mMXaLpiqCwXarLAm2SGpmb6fL0N+Hgf - ltHFXk4/7C+XNbSKeCyO0GxaLfOTEXi7Lw6v/whcC6Dp2rRdaeJ7xXmpKZe95TTYhnNULPPJyIDv - 6+PLNf763rAa3tcBX7TBWcw8m9W+KsJFiU6sD+kiWx9YvgunSECZ4ZrUP6eima+6oOx7Z20DG5xM - t9/Tc/O8YvVu+KBcSVYeb4N8Bw3ep/GkePSB5Nu7kRQ66SkoYhcVyovhBs7GhnzgoaNT6Ztwprgr - hFZ+idAGTV4C1xQsd9IFswW1cpRbHQBWOS0Np8jM3Ge+iWSei/JpvBPN8wQYPGU9ixPf0wGeo86o - 1mKs6fF7v31eaeMZm4cGm8CVqniWUqaLNuA3fY1H9sC+tqdxevzoRWWBPl/Use+Bt67f+jJmugAs - BzDQWopml/hsUYBGS3c66XTRcKeUZDCPSrTrcdidNhfN7KaGvZkGFpgiaxev12NkIKA7Jgjmxvmi - yxPTpWTwCBquVYTVuvPdIzVt5Wx2yjYWTOAJehF5qIiEVZZced4vqpT6LpQNzyp8AXWMq2R46xem - 1avmszfdMQ0TDW5Dr2b4UxUK+j6ebekbN2/DZmhP4OOqg449mXSW438+w11vY1bzU6ayOagduzun - t3t0NB1VcrNFmqxq3VvtFS399u3zJyNLK/b3eri92IpyLwNJCRUsEZkHoxCLGIQkjkQgynwsJwmM - AZYTCGWeH4EIgnsxkXg+FGXCYxkOXv95ff0XAAD//wMArBAkrbgHAAA= - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 19 Nov 2020 20:00:09 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: "--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - tagging\"\r\n\r\nObjectTTLInDays1\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - key\"\r\n\r\nsub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/ec75a2db-65c7-46af-9b26-61939f898314/king_arthur.txt\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - Content-Type\"\r\n\r\ntext/plain; charset=utf-8\r\n--96df544f6e8c2c3f3920b0f27f3db1f4\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Credential\"\r\n\r\nAKIAY7AU6GQD5KWBS3FG/20201119/eu-central-1/s3/aws4_request\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Security-Token\"\r\n\r\n\r\n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition:\ - \ form-data; name=\"X-Amz-Algorithm\"\r\n\r\nAWS4-HMAC-SHA256\r\n--96df544f6e8c2c3f3920b0f27f3db1f4\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Date\"\r\n\r\n20201119T200109Z\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - Policy\"\r\n\r\nCnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMTlUMjA6MDE6MDlaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvZWM3NWEyZGItNjVjNy00NmFmLTliMjYtNjE5MzlmODk4MzE0L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTE5L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMTlUMjAwMTA5WiIgfQoJXQp9Cg==\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Signature\"\r\n\r\n9976059b9a5e6208ba4a0bedc40462d6ff1d0a6f1162280c1074f522b46e2a61\r\ - \n--96df544f6e8c2c3f3920b0f27f3db1f4\r\nContent-Disposition: form-data; name=\"\ - file\"; filename=\"king_arthur.txt\"\r\n\r\nKnights who say Ni!\r\n--96df544f6e8c2c3f3920b0f27f3db1f4--\r\ - \n" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2314' - Content-Type: - - multipart/form-data; boundary=96df544f6e8c2c3f3920b0f27f3db1f4 - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: - - Thu, 19 Nov 2020 20:00:10 GMT - ETag: - - '"3676cdb7a927db43c846070c4e7606c7"' - Location: - - https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2Fec75a2db-65c7-46af-9b26-61939f898314%2Fking_arthur.txt - Server: - - AmazonS3 - x-amz-expiration: - - expiry-date="Sat, 21 Nov 2020 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-id-2: - - A6YngC58iQIuE2uLkm65EMcHqPNAyDx9gB4tk9uUclaKKke31YylNWTVATJvEEazROWaL2atqyM= - x-amz-request-id: - - 69D7186D457E54B4 - x-amz-server-side-encryption: - - AES256 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22ec75a2db-65c7-46af-9b26-61939f898314%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16058160096948699"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:00:09 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files/ec75a2db-65c7-46af-9b26-61939f898314/king_arthur.txt?uuid=files_native_sync_uuid - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - public, max-age=3831, immutable - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 19 Nov 2020 20:00:09 GMT - Location: - - https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/ec75a2db-65c7-46af-9b26-61939f898314/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201119%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201119T200000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=ba518b25b2ce6544646a697acd0d77dc94ad347d36f786cb1070b66c954cb62e - status: - code: 307 - message: Temporary Redirect -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/ec75a2db-65c7-46af-9b26-61939f898314/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201119%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201119T200000Z&X-Amz-Expires=3900&X-Amz-Signature=ba518b25b2ce6544646a697acd0d77dc94ad347d36f786cb1070b66c954cb62e&X-Amz-SignedHeaders=host - response: - body: - string: Knights who say Ni! - headers: - Accept-Ranges: - - bytes - Connection: - - keep-alive - Content-Length: - - '19' - Content-Type: - - text/plain; charset=utf-8 - Date: - - Thu, 19 Nov 2020 20:00:11 GMT - ETag: - - '"3676cdb7a927db43c846070c4e7606c7"' - Last-Modified: - - Thu, 19 Nov 2020 20:00:10 GMT - Server: - - AmazonS3 - Via: - - 1.1 a2a926ace399371954fc9fbb55fd02ab.cloudfront.net (CloudFront) - X-Amz-Cf-Id: - - xs9ND4aDZCOO9uyAnqO4ImETMQMgOcLcWeCVv_JoOxAJo_x2BGkHwA== - X-Amz-Cf-Pop: - - BUD50-C1 - X-Cache: - - Miss from cloudfront - x-amz-expiration: - - expiry-date="Sat, 21 Nov 2020 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-server-side-encryption: - - AES256 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.yaml b/tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.yaml deleted file mode 100644 index b6c82c32..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.yaml +++ /dev/null @@ -1,259 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/5.0.1 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xVWXOjOBD+K1t+nSGWOGzI1jwQfDKAjcFcu1spAQKDOTxGxMZT+e8r7CTjnbzs - A6Bu9fF19yfxc9AQRNpm8MgC8HUQI4IGjz8HWTx4HIhRNEpEMWFAyI8ZHnMcgyQoMhAicYzZSBK5 - aPB1UKESU+t9VqXP6Eh27fGBnMng9esgyQr83B6KGsXPR/yjxQ3pg7fHgtrvCDk0j8PhoQ2rNmTK - Cpd101WY6b0aBrdMhCtyRAUDmcMxfmi4B1SiS12hU/MQ1eWQpi4x2dU91PXKsqmMz4fsiEhWV8+0 - kh4VC1jIAI4BvM2CRwgfeT6ghkl9LJ+TDBcxrfyvn4M97qgxQWlKq6D7L6hoe/e/WwC4yL7prwL+ - UFmY/Ka5F7/j7iauwhxHxLa1ZTVBXXPbHX5s32Snz3dTwDeLO9Wb5rcMw88Yhv9BSkfwXln//lVV - Q/sdMZEosjybIAZyCNOh4pAJI46nbR8lsTQao0QShglDlnJkeOpKKkWYuI7zXDOJZTIvuD0YR7uo - HXm7DvHWNIf/hy/DzzR5x6jUFaETZ+zugO/AEnwmw0OBsurPP6IdOjaYfGtJwoh3rh4jlxdGOeKY - BshQcecuf1/K/ljejubmRPjuPlncbD7sWQE4wA/vWTZsuCHlFv9B1d/jWzhqjxnpGLve4+ouxydL - uUhrarkr74G4Fs8sdFlhrIXMCqNPTpOesb/s3zFS3kLYs/aX/bousuh+oErVfFcstcCLp0NUzgBy - pXaZ1+kyX570fEr0iU6fzVbP5ZFuT0fGZIOW2an3yUNW2CNvc6DfS+/jnmpV8ZrMr5wcsQ64xqme - oF8K0M8gCUuHhJwhhOWWBGXRBJ5OAm9LfNZp44W6CxVw1rynLlBUSZNpLKfJAm+aaYqcqYvNLmDj - Q1hGV3k9+5C/XNfQKOIJLzrzWbXOz1rg7b/YrPojcA3gzDa65QpT3ysua0W67q1nwS5cOMU6n4oa - fF+fXm7+t++W1vC+DtiiDS585lm0drMIl6Vzpn1Il9nmSONdMUWck2muTvxLyuu52QUl7Z9t7AIL - nHW331Nz/WLSerdsUJqCkce7IN9DjfVJPC2efCD41l4UQjs9B0XsOoX0ormBvbUgG3jOya7UbTiX - XNNxTL90nK0zfVnNjdwofX4194k+XwKjAyCw9YvmTgXdTmn+2W41iQu91IXVxMg1ltCexYnvqQAt - nE6rNnysqPF7v31WauM5nYcCm8AVqnieEsqLNmC3fY0n+sC+ttUkPX30ojJAHy/q6H3gbeq3vkwo - LwCNATRnI0Tzq3+2LECjpHsVdyqvuTOCM5hHpbPv7ZA7a66c2c80azsLDDBzjH282UwczQGqrYNg - oV2uvDzpFxlorAM11yjCatP57onolnTRO2kXczrwOLWIPKeIODNLbjjHyyolvgtHmmcUPud0FKug - eZsXytUb57M33lEOYwXuQq+m9ucq5NRDPN+RN2zels7QmsIns4O2NZ12hu1/zuFudjGteZXJGT07 - nW7Ll7dzdNZtE7jZMk3MWvXMg6Sk3759vjKytKK/1+P9webHoxAKApQSAcb0uhyzIBKFEb06MYwA - HOOI4wTMiiIaCWPEhSgUeEkYY4DGooAwP3j95/X1XwAAAP//AwAHZJmquAcAAA== - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 04 Mar 2021 20:10:44 GMT - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: !!binary | - LS05YmRjYzMxOGMyODU1ZWM4MWQ4YzZiNmE4Mzg0ZGEzNQ0KQ29udGVudC1EaXNwb3NpdGlvbjog - Zm9ybS1kYXRhOyBuYW1lPSJ0YWdnaW5nIg0KDQo8VGFnZ2luZz48VGFnU2V0PjxUYWc+PEtleT5P - YmplY3RUVExJbkRheXM8L0tleT48VmFsdWU+MTwvVmFsdWU+PC9UYWc+PC9UYWdTZXQ+PC9UYWdn - aW5nPg0KLS05YmRjYzMxOGMyODU1ZWM4MWQ4YzZiNmE4Mzg0ZGEzNQ0KQ29udGVudC1EaXNwb3Np - dGlvbjogZm9ybS1kYXRhOyBuYW1lPSJrZXkiDQoNCnN1Yi1jLWM4ODI0MmZhLTEzYWUtMTFlYi1i - YzM0LWNlNmZkOTY3YWY5NS9mLXRJQWNOWEpPOW04MWZXVlZfby1mU1EtdmV1cE5yVGxvVkFVUGJl - VVFRLzhjYzZmODhmLTBiNDctNGUzMy1hOTE4LTExYTg3ZTJjOTgzYy9raW5nX2FydGh1ci50eHQN - Ci0tOWJkY2MzMThjMjg1NWVjODFkOGM2YjZhODM4NGRhMzUNCkNvbnRlbnQtRGlzcG9zaXRpb246 - IGZvcm0tZGF0YTsgbmFtZT0iQ29udGVudC1UeXBlIg0KDQp0ZXh0L3BsYWluOyBjaGFyc2V0PXV0 - Zi04DQotLTliZGNjMzE4YzI4NTVlYzgxZDhjNmI2YTgzODRkYTM1DQpDb250ZW50LURpc3Bvc2l0 - aW9uOiBmb3JtLWRhdGE7IG5hbWU9IlgtQW16LUNyZWRlbnRpYWwiDQoNCkFLSUFZN0FVNkdRRDVL - V0JTM0ZHLzIwMjEwMzA0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QNCi0tOWJkY2MzMThj - Mjg1NWVjODFkOGM2YjZhODM4NGRhMzUNCkNvbnRlbn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zb2ZuaTEyMzQ1eFfV0LUcHPC0 - jOgZUypICeqERdBWXaUFt/q9yQ87HtENCi0tOWJkY2MzMThjMjg1NWVjODFkOGM2YjZhODM4NGRh - MzUtLQ0K - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2343' - Content-Type: - - multipart/form-data; boundary=9bdcc318c2855ec81d8c6b6a8384da35 - User-Agent: - - PubNub-Python/5.0.1 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: - - Thu, 04 Mar 2021 20:10:46 GMT - ETag: - - '"31af664ac2b86f242369f06edf9dc460"' - Location: - - https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2F8cc6f88f-0b47-4e33-a918-11a87e2c983c%2Fking_arthur.txt - Server: - - AmazonS3 - x-amz-expiration: - - expiry-date="Sat, 06 Mar 2021 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-id-2: - - aKDSB+1kqtXh0NRTKdNpq5msRD8d9JP/7lMsg7EnX4AuEqOXuM2p4uWhrk/w3ajp4rcVaaudqnY= - x-amz-request-id: - - 9703A42693C1D1C5 - x-amz-server-side-encryption: - - AES256 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/5.0.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%22a25pZ2h0c29mbmkxMjM0NZRrfJgUztWUV6pXv5zfmA3XciGL8ZdRVe31QyUHau4hbr1JeckbF6Xa4tpO5qF0zUI1fdvGQJkwa1KMeFl5QAqqDzT7A7cURYcPmbGoWTyEzaSQCz4uw6HsJsdfOOAhryz%2FJjb3x1qVjn3rpIFZnpm0EzjUBAS%2FltCuIFjSFLRJ%22?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16148886452594352"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 04 Mar 2021 20:10:45 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/5.0.1 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files/8cc6f88f-0b47-4e33-a918-11a87e2c983c/king_arthur.txt?uuid=files_native_sync_uuid - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - public, max-age=3195, immutable - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 04 Mar 2021 20:10:45 GMT - Location: - - https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/8cc6f88f-0b47-4e33-a918-11a87e2c983c/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20210304%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20210304T200000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=e483478c649b8d03dce428694d49b6d25848b544f8cf5ff1ed5e0c8c67ead1d8 - status: - code: 307 - message: Temporary Redirect -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/5.0.1 - method: GET - uri: https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/8cc6f88f-0b47-4e33-a918-11a87e2c983c/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20210304%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20210304T200000Z&X-Amz-Expires=3900&X-Amz-Signature=e483478c649b8d03dce428694d49b6d25848b544f8cf5ff1ed5e0c8c67ead1d8&X-Amz-SignedHeaders=host - response: - body: - string: !!binary | - a25pZ2h0c29mbmkxMjM0NXhX1dC1HBzwtIzoGVMqSAnqhEXQVl2lBbf6vckPOx7R - headers: - Accept-Ranges: - - bytes - Connection: - - keep-alive - Content-Length: - - '48' - Content-Type: - - text/plain; charset=utf-8 - Date: - - Thu, 04 Mar 2021 20:10:46 GMT - ETag: - - '"31af664ac2b86f242369f06edf9dc460"' - Last-Modified: - - Thu, 04 Mar 2021 20:10:46 GMT - Server: - - AmazonS3 - Via: - - 1.1 697e9166a29142e018dae0e083c25f18.cloudfront.net (CloudFront) - X-Amz-Cf-Id: - - F2hjMRsbVq3UK_toZqiKWoaF9ZObgh7Hf_8GTJTeLjXmszc2EGpPew== - X-Amz-Cf-Pop: - - ZRH50-C1 - X-Cache: - - Miss from cloudfront - x-amz-expiration: - - expiry-date="Sat, 06 Mar 2021 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-server-side-encryption: - - AES256 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/download_url.yaml b/tests/integrational/fixtures/native_sync/file_upload/download_url.yaml deleted file mode 100644 index 8070421a..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/download_url.yaml +++ /dev/null @@ -1,182 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xVW3eiSBD+K3t8nSF2c1HJnnlQvBJAEWwuu3tyGmgQ5eJIE8Wc/PdtNMm4k5d9 - ALqqq6q/r+oDXjsVxbSuOo88AN87Eaa48/jaSaPOY0eOoSiGYsgRzG5iD0scDniRiwaQxBCKvCyL - ne+dAueERe/TInnGR7qtjw/0TDtv3ztxmpHn+pCVOHo+kp81qWhbvD5mLH5L6aF67HYPdVDUAZcX - JC+rpiBcm1VxpOZCUtAjzjjIHY7RQyU84BxfygKfqoewzLvs6JzQbdlCXS0tm9nkfEiPmKZl8cyY - tKh4wAMOQg7KNg8eAf8Igc8C4/KYP8cpySLG/K/Xzp40LJjiJGEs2P4Lzuo2/e8aACG0b/6rQT5d - FqG/ee7NJ9LczGWwIyG1bW1RjHFT3Xa7n9s3G7Xn3RzwPeLO9e757YTuVwzd/yBlI/hg1t5/sapY - v0MuHAx4kY8xBwVMWI9IwAWhILK29+JI7vVxLEvdmKOLYWi46lLOBzB2EHouudgyuRdSH4yjnZVo - uFkFZGOa3f+jl+5XmXxgVMqCsolzdnMgd2ApOdPuIcNp8ecf4RYfK0J/1DTmBnepLjfML5xyJBEr - kOLsLn34tBh6/eGmNzPH0pMzsoTprNuqAkIod+9V1q2ELtOW+CnV3+tbJKyPKW04u9yT4u6ML5HD - LClZ5Da/B+JYIjfXhwpnzYe81PuSNG4V+yv+AyPTLeBb1f6KX5VZGt4PVCmqJ8VSMzIfHcJ8CrAj - 14tdmSx2i5O+G1LdnrAr27B1Tx8vero9wov01ObsAl7aY3d9YM9Lm+OcSlVxq9Qr0A7zCFzrFCPo - 5RL0UkiDHNFAMKQg31A/zyrf1anvbqjHozqaq9tAAWfNHTW+osrakNVCVeq7k1RThqk6X299PjoE - eXi1V9NP+9t1DY0sGosDNJsWq91Z8939N5tXf/qOAdB0rVuONPHc7LJS5OveaupvgznKVrvJQIMf - 69PLLf/23DAOH2ufz2r/IqauxbibWbDI0Zn1IVmk6yOrd8UUCijVHJ16l0TUd2bj523vjK1vgbPu - tHvqTr+YjO+G93NTMnbR1t/tocZ7NJpkIw9InrUfSIGdnP0sclAmv2iOb28syPsuOtmFuglmsmMi - ZHo5Qhs0eVk63tkYr3fGjPXSmQCvAcDIJ1BzpinDQP0xq8VidNtslvYeaDxlPYtiz1UBnqNGK9Zi - pKjRR789Xq6jGZuHAivfkYpollCmi9rnNy3HE7tgy205Tk6fvSgM0NYLG/Y9cNfle1/GTBeA1QAa - Wkvh7JqfLjJQKcleJY0qMoyUpHAX5mjfxmFnWl01s59q1mbqG2CKjH20Xo+RhoBq68Cfa5erLhmf - iaTxiPE0sqBYN55zorolX/RG3kaCDlxBzUIXZaFgpvENZ39RJNRzYE9zjcwTUMOwSpq7fmFavWk+ - fdcd0zBR4DZwSxZ/LgJBPUSzLX3H5m7YDK0JHJkNtK3JpDFs7+sZznobMc7LdMjmMGz08eT8/h4x - /JOTky6S2CxV1zzISvLjx9dPRpoU7Pd6vH+xJUGUwphIA4nHQOoFPUiEHpAjvh/1+3FfDiQxkkM8 - CCIhAoM+P4j6Mg7jQR+QvhxCofP2z9vbvwAAAP//AwAmYIljuAcAAA== - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 19 Nov 2020 20:01:10 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: "--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - tagging\"\r\n\r\nObjectTTLInDays1\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - key\"\r\n\r\nsub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/9f144c4c-ea4c-46a5-ab24-d81ef1142994/king_arthur.txt\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - Content-Type\"\r\n\r\ntext/plain; charset=utf-8\r\n--81a347c1a55f80c7a78e3ce009fb4b6e\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Credential\"\r\n\r\nAKIAY7AU6GQD5KWBS3FG/20201119/eu-central-1/s3/aws4_request\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Security-Token\"\r\n\r\n\r\n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition:\ - \ form-data; name=\"X-Amz-Algorithm\"\r\n\r\nAWS4-HMAC-SHA256\r\n--81a347c1a55f80c7a78e3ce009fb4b6e\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Date\"\r\n\r\n20201119T200210Z\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - Policy\"\r\n\r\nCnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMTlUMjA6MDI6MTBaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvOWYxNDRjNGMtZWE0Yy00NmE1LWFiMjQtZDgxZWYxMTQyOTk0L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTE5L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMTlUMjAwMjEwWiIgfQoJXQp9Cg==\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Signature\"\r\n\r\n5345cfe5852a056b61e3609d27d77f79b54d9ca8bd3d08728d79acf870e79c13\r\ - \n--81a347c1a55f80c7a78e3ce009fb4b6e\r\nContent-Disposition: form-data; name=\"\ - file\"; filename=\"king_arthur.txt\"\r\n\r\nKnights who say Ni!\r\n--81a347c1a55f80c7a78e3ce009fb4b6e--\r\ - \n" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2314' - Content-Type: - - multipart/form-data; boundary=81a347c1a55f80c7a78e3ce009fb4b6e - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: - - Thu, 19 Nov 2020 20:01:11 GMT - ETag: - - '"3676cdb7a927db43c846070c4e7606c7"' - Location: - - https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2F9f144c4c-ea4c-46a5-ab24-d81ef1142994%2Fking_arthur.txt - Server: - - AmazonS3 - x-amz-expiration: - - expiry-date="Sat, 21 Nov 2020 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-id-2: - - ejWPHQ9G8PEIB1Levfzo41myQABuJy2DBKd3Rw9GUV+J6Qk746gPHGAxeRsXwIJtzwAouCUCYCA= - x-amz-request-id: - - 3DC7349C6A117585 - x-amz-server-side-encryption: - - AES256 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%229f144c4c-ea4c-46a5-ab24-d81ef1142994%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16058160706139422"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:01:10 GMT - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files/9f144c4c-ea4c-46a5-ab24-d81ef1142994/king_arthur.txt?uuid=files_native_sync_uuid - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - public, max-age=3770, immutable - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 19 Nov 2020 20:01:10 GMT - Location: - - https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/9f144c4c-ea4c-46a5-ab24-d81ef1142994/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201119%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201119T200000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=3a643977ebb796baafbaa45ad35bedffbb0c7a83adcf84f5ee03eb0edeca49ad - status: - code: 307 - message: Temporary Redirect -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.yaml b/tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.yaml deleted file mode 100644 index ac718cb4..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.4 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files/random_file_id/random_file_name?auth=test_auth_key&uuid=files_native_sync_uuid - response: - body: - string: '' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - public, max-age=686, immutable - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Wed, 21 Oct 2020 17:52:34 GMT - Location: - - https://files-eu-central-1.pndsn.com/sub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/random_file_id/random_file_name?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQD5KWBS3FG%2F20201021%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20201021T170000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=6faaeb530e4905cea2969d0e58c19dc9cb9b95dfb9e4ff790459c289f641fd7f - status: - code: 307 - message: Temporary Redirect -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.yaml b/tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.yaml deleted file mode 100644 index 3bfe1c19..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.yaml +++ /dev/null @@ -1,58 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/4.5.4 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xV23KjOBD9lS2/zhBLYByTrXlw8JUBxxgsLrtbKYHEzVw8RsTGU/n3FXaS8U5e - 9gGjbp1une4+yD97NcOsqXsPIgBfewQz3Hv42UtJ76E3IlSK7qkkACINhAEBsjASiSJI90GAIziK - pGHY+9orcUE5epeW8TM+sKQ53LET671+7UVpTp+bfV5h8nygPxpasy55c8g5PmFsXz/0+/smKJtA - KEpaVHVbUqGLqgXaCCEt2QHnAhT2B3JXS3e4wOeqxMf6LqyKPj+6oCypOqrrJ8vmNj3t0wNmaVU+ - 80o6ViIQgQCBIEIb3j9IygMc+BwYVYfiOUppTnjlf/3s7WjLwQzHMa+C77/gvOnC/24AkEL76r8Y - 9MNlUfab59b8Ttur+RRkNGS2rS/LCW7r627/Y/tqo+68qwO+IW5cb57fTuh/5tD/D1M+gvfKut9f - VdW836EQjkbiQIywACVMBQhpIAQhH3RIhxFRhvc4UuR+JLDlOFy52pNSjGDkIPRcCZFlCi+02a8O - dl6h8XYd0K1p9v+PXvqfZfLOUa1Kxicu2O2e3pBl9MT6+xyn5Z9/hAk+1JR9a1gkjG5CXWFcnAX1 - QAlPkOL8Jnz8fTn27sfb4dycyN+dR0uazfudKiAQYf9WZf1a6nNtDT6k+nt+i4bNIWWtYFc7Wt6c - 8Qk5zuOKI5PilohjDYSFMVYFazEW5eGnoEmn2F/4d45ct5LSqfYXfl3laXg7ULWsv6uWltPF4z4s - ZgA7SrPMqniZLY9GNmaGzZ9stjXscGicd0PD3uBleuxiskCUd9jd7Pn73MU4x0pT3Tr1SpRhEYFL - nvIReoUMvRSyoEAskFZyUGyZX+S17xrMd7fME1FDFloSqOCku4+tr2qKPua5UJ367jTV1XGqLTaJ - L5J9UIQXez37sL9c1nCVk8lghOazcp2ddN/dfbFF7YfvrACabQzLkaeem5/XqnLZW8/8JFigfJ1N - Rzp8Xx9frvHX95bX8L72xbzxz4PUtXjtZh4sC3TifYiX6ebA8104hRJKdcdg3jkeGJnZ+sWU92+V - +BY4GU63p2XG2eT1bkW/MOVVRhI/20Fd9BiZ5o8ekD1rN5IDOz75OXFQrrzojm9vLSj6LjrapbYN - 5opjImR6BUJbNH15mm9yQ/Qk3zaYMTfPKxUAfzKGuh23/mTHjDNJvWJWGHZSGGc/00XGe0Yiz9UA - XqBWLzcDomrkvd+eqDRkzuehwtp35JLMY8Z10fjitqvxyB/Y1fY0iY8fvShXoMsXtvw+cDfVW18m - XBeA5wA62sjh/BKfLnNQq/FOo6020J0ZoynMwgLtOhx2ZvVFM7uZbm1n/grM0GpHNpsJ0hHQbAP4 - C/180eXJmCxPuoig7qzyoNy0nnNkhqWcjVZJiGQAV9Ly0EV5KJlpdOV5vyxj5jlwqLur3JNQy7nK - urt54Vq9aj590x3XMFVhErgVx5/KQNL2ZJ6wN27uls/QmsJHs4W2NZ22K9v7fIazSQiv+Skdp5xv - a0ymx7fv6PxkT4GTLuPIrDTX3Ctq/O3b5ysjjUv+93q4/bAJvydhROUhFpUhHkHML9tRGI2GAAay - LMlAggGWIJQDGcABIWKoRGIwlOUowrJCot7rP6+v/wIAAP//AwBA2W25uAcAAA== - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Wed, 21 Oct 2020 17:38:14 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.yaml b/tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.yaml deleted file mode 100644 index a4cbffaf..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.yaml +++ /dev/null @@ -1,97 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '20' - User-Agent: - - PubNub-Python/4.5.4 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xVW5eiOBD+L77uMCZcvPSbDV6ggRaFcNnd0yeQoCAXR6I2zun/vkHHGWf6ZR9i - qipVqa+qvuD3XsMwOza9JxGALz2CGe49fe9lpPfUU9IRIeJoLACIiSADZSyMZCALIwkTeZAqQxin - vS+9CpeUe6dZQd+UMu59fLnJx31RY/J2oN+OtGHdrcdDwR23jO2bp35/f4yrYyyUFS3rpq2o0EU1 - Aj0KCa3YARcCFPYH8rWRvuISX+oKn5uvSV32ec6Ssm3dYVy+rl2u0/d9dsAsq6s3XkIHRwQiECAQ - ROiKgBf3JIsRd0zrQ/mWZrQgvOS/v/d2tOXODG82WbXh5ydcHLvwf44ASIl7s18V+tO0puwPy6P6 - Qtub+hrnNGGua+qVhtvmdtr/eXzTUZfvZoA/PB5MPyx/ZOh/xtD/DSkfwb2y7vdXVQ3vdyIko5Eo - iykWoISpACGNhTiRZN72QUrGgyFOx0o/FZg+SezAeB2XI5j6CL3VQrp2hBM97u2DW9Ro4i1j6jlO - //8Qpf/Ajzs4ta4YH7Xgtnv6gDLOKnxo+3XCKBMadqC4fAgKhEl5EdQDJTw0w8VD4ORFn4TDiTeY - O5ry4j+vpdm83xEBAhH2H4nVb6Q+p5P8k51/3r+myfGQsVZw6x2tHnJ88pwUm5p7bstHIP5aFhbW - RBXWi4moDD4FaR1Jf/nfMbqd0BH1l/+yLrLkcYZq1byoa6Ogi+d9Us4A9sdHPa83eq6frXzCLJev - fOZxedAtWzOwnp27mDwWlR0OVnu+X7oY/1wbatBkYYVyLCJwvad6hmGpwDCDLC4RiyVbiUuPRWXR - RIHFosBjoYiOZGFsYxW8m8FzG6nG2Jzwu1CTRcE0M9VJZixW20gk+7hMrvpy9lP/6ypDuyCaPELz - WbXM380o2P3lisa3yLcBmq2sta9Mw6C4LNXx9Ww5i7bxAhXLfDoy4V0+n27xt93jNdzlSCyO0UXO - gjWv3SlivUTvvA8bPVsd+H1XTImEMtO3WHjZyFbutFE55f2zt9EavFt+d2bk1sXh9XpiVDqKnZNt - lO+gKYaMTIvnECjhejdSYnfzHhXER8X4ZPqR662hGAXo7FaGF8/HvoOQE5YIeWh6sv1QjuZO+6rt - mKXNtpEKgKV5iulu+O6wV43n1xwxyj3J8o3SFKN9PEep7cNML0CjbnaG315nCSJfAab/XsQlAViF - begrVbTWG12b8OW1tqbLr9ozuc8mkVbbpFpdzIDsyXxzm9PUPsXVqogrh6FFcb7Gq/q9b0O92rDQ - hwPTt9vI7/xW+9A/Z6/ZJHM8ZjhoJznIE1dwNrU9FjiFdVntkhPnXmtpU87J6ekTZyTrYoozKbms - 0oTPhXfuQu4c4nykKtzGQc0SEeUkMPZksWNkPj5EvnzNq1e3PtDWkE1/xmjG/efklJQFwHNww4aI - a6tQd72ZZiJbd1wd2tnnHNF8BnjNA14zx8vfkMtxI+cq397O81jdFEStwMvnz0S2qfjf5+G3x0wG - WAYglukAUjqkMEkHUqrIlMijhECRwOEwTmUwxLEykDpZGqRjKqUSERUFDnsf/358/AcAAP//AwDj - 9pvemAcAAA== - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Wed, 21 Oct 2020 20:19:42 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: '' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '10488023' - Content-Type: - - multipart/form-data; boundary=be1bf8971123ddecbbd5ce51cb07fe71 - User-Agent: - - PubNub-Python/4.5.4 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: ' - - EntityTooLargeYour proposed upload exceeds the - maximum allowed size524468152428808W8NAT1S1REK9Y3Pl075W1QNv/VxQLeuGXoSSaOlFVJ/p4Bo3XRKrD3vf9m9TSAvmnqK8mWnMmHRRLXHdSUmCkyoG+U=' - headers: - Connection: - - close - Content-Type: - - application/xml - Date: - - Wed, 21 Oct 2020 20:19:49 GMT - Server: - - AmazonS3 - x-amz-id-2: - - l075W1QNv/VxQLeuGXoSSaOlFVJ/p4Bo3XRKrD3vf9m9TSAvmnqK8mWnMmHRRLXHdSUmCkyoG+U= - x-amz-request-id: - - 8W8NAT1S1REK9Y3P - status: - code: 400 - message: Bad Request -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/list_files.yaml b/tests/integrational/fixtures/native_sync/file_upload/list_files.yaml deleted file mode 100644 index 1c752f10..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/list_files.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.5.4 - method: GET - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/files?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA5TSwY5VIQwG4HdhfWqAFmjPc7jSTEyBojfOHJN7z00mTubdxbtwqbiEQL/0b9/c - 7dTzfnN79H5zXU91++c3d+iLud19vxxfv+j1/Ha/fjhfT7e5S5/XsSr5FAxCJgJqxsBVEihxziWE - Qd7m29vl5yxCvLl2NT3t8dVHD8FDDB9D2RF38p/c+/YvMRX0ySNDTTxFEwPtPQLmlK39Nlv/Iwb5 - i5j2wCti1lFaDxkMDYGEI3BMHVJvgzFUbl4XxLR72VNZEYtvWKIgKLIBMXvQKYHZTHVISD21tVQn - utQjoygmyxALFSC1AlLFQ8+Ve2zSfOQF8dEjLYkSuY6SDAaKzB4rg7bagVONoqVSX0+VllKtnLKW - GEHFD6AUK2jBArmbkKWGanFB/I9UW/VkiHOEfsxdTXOONWaC2mnEjq3EsriruKOsiEMpq1qDNMLc - VSWBimX2WIb3gqULl1XxkerT5g6b9ffj/vw8n/+4H/Mg778AAAD//wMAINFBWi8EAAA= - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Wed, 21 Oct 2020 17:36:44 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message.yaml b/tests/integrational/fixtures/native_sync/file_upload/publish_file_message.yaml deleted file mode 100644 index d08c529b..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?meta=%7B%7D&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16058161010686497"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:01:41 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.yaml b/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.yaml deleted file mode 100644 index b0ba18c3..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?meta=%7B%7D&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16058161166436271"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:01:56 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.yaml b/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.yaml deleted file mode 100644 index 2c5e2b08..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?meta=%7B%7D&norep=false&ptto=16057799474000000&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16057799474000000"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 19:56:53 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json index a6f96753..d6a953f7 100644 --- a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json +++ b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json @@ -7,134 +7,26 @@ "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/generate-upload-url?uuid=uuid-mock", "body": "{\"name\": \"king_arthur.txt\"}", "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" + "host": [ + "ps.pndsn.com" ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ + "accept": [ "*/*" ], - "Connection": [ - "keep-alive" - ], - "Content-type": [ - "application/json" - ], - "Content-Length": [ - "27" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Connection": [ - "keep-alive" - ], - "Content-Type": [ - "application/json" - ], - "Content-Length": [ - "1989" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ], - "Access-Control-Allow-Origin": [ - "*" - ] - }, - "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"6144738d-4719-4bcb-9574-759c87ba2dda\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2023-07-04T19:50:52Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/6144738d-4719-4bcb-9574-759c87ba2dda/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20230704/eu-central-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20230704T195052Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjMtMDctMDRUMTk6NTA6NTJaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtODhiOWRiYWItMjBmMS00OGQ0LThkZjMtOWJmYWJiMDBjMGI0L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvNjE0NDczOGQtNDcxOS00YmNiLTk1NzQtNzU5Yzg3YmEyZGRhL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjMwNzA0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMzA3MDRUMTk1MDUyWiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"09f9e541b894c0f477295cd13d346f66b0b1ce5252ab18eb3f7afadc63e1896b\"}]}}" - } - } - }, - { - "request": { - "method": "POST", - "uri": "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/", - "body": { - "binary": "LS04NTk5YTlhOGUyNzgzNjgzYjE0NmI1MTU5NTIyODhmZA0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJ0YWdnaW5nIg0KDQo8VGFnZ2luZz48VGFnU2V0PjxUYWc+PEtleT5PYmplY3RUVExJbkRheXM8L0tleT48VmFsdWU+MTwvVmFsdWU+PC9UYWc+PC9UYWdTZXQ+PC9UYWdnaW5nPg0KLS04NTk5YTlhOGUyNzgzNjgzYjE0NmI1MTU5NTIyODhmZA0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJrZXkiDQoNCnN1Yi1jLTg4YjlkYmFiLTIwZjEtNDhkNC04ZGYzLTliZmFiYjAwYzBiNC9mLXRJQWNOWEpPOW04MWZXVlZfby1mU1EtdmV1cE5yVGxvVkFVUGJlVVFRLzYxNDQ3MzhkLTQ3MTktNGJjYi05NTc0LTc1O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lVNVGsxTURVeVdpSWdmUW9KWFFwOUNnPT0NCi0tODU5OWE5YThlMjc4MzY4M2IxNDZiNTE1OTUyMjg4ZmQNCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iWC1BbXotU2lnbmF0dXJlIg0KDQowOWY5ZTU0MWI4OTRjMGY0NzcyOTVjZDEzZDM0NmY2NmIwYjFjZTUyNTJhYjE4ZWIzZjdhZmFkYzYzZTE4OTZiDQotLTg1OTlhOWE4ZTI3ODM2ODNiMTQ2YjUxNTk1MjI4OGZkDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImZpbGUiOyBmaWxlbmFtZT0ia2luZ19hcnRodXIudHh0Ig0KDQprbmlnaHRzb2ZuaTEyMzQ1eFfV0LUcHPC0jOgZUypICeqERdBWXaUFt/q9yQ87HtENCi0tODU5OWE5YThlMjc4MzY4M2IxNDZiNTE1OTUyMjg4ZmQtLQ0K" - }, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ + "accept-encoding": [ "gzip, deflate" ], - "Accept": [ - "*/*" - ], - "Connection": [ + "connection": [ "keep-alive" ], - "Content-Length": [ - "2343" - ], - "Content-Type": [ - "multipart/form-data; boundary=8599a9a8e2783683b146b515952288fd" - ] - } - }, - "response": { - "status": { - "code": 204, - "message": "No Content" - }, - "headers": { - "x-amz-expiration": [ - "expiry-date=\"Thu, 06 Jul 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-request-id": [ - "FG5BVM2Q7DVWN98W" - ], - "ETag": [ - "\"31af664ac2b86f242369f06edf9dc460\"" - ], - "Server": [ - "AmazonS3" - ], - "Location": [ - "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2F6144738d-4719-4bcb-9574-759c87ba2dda%2Fking_arthur.txt" - ], - "x-amz-id-2": [ - "O3Aq1zRp/A/AREfBqIqd4D43wUGqk8QMTUZtm+hmUyW4it+CNzdRyYvSHsuO/kFr1JozHbWP/OQ=" + "user-agent": [ + "PubNub-Python/9.1.0" ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:53 GMT" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%22a25pZ2h0c29mbmkxMjM0NZRrfJgUztWUV6pXv5zfmA3XciGL8ZdRVe31QyUHau4hbr1JeckbF6Xa4tpO5qF0zbp8T5zlm4YRqSNPOozSZbJK7NBLSrY1XH4sqRMmw9kqbFP0XZ1hkGhwY4A6xz5HK7NJA7AgYYcYNGHC89fuKpkY0O3GF50zbH86R6Jra3YM%22?meta=null&store=1&ttl=222&uuid=uuid-mock", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" + "content-type": [ + "application/json" ], - "Connection": [ - "keep-alive" + "content-length": [ + "27" ] } }, @@ -144,154 +36,27 @@ "message": "OK" }, "headers": { - "Cache-Control": [ - "no-cache" - ], - "Connection": [ - "keep-alive" + "Date": [ + "Fri, 06 Dec 2024 23:08:26 GMT" ], "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" + "application/json" ], "Content-Length": [ - "30" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ] - }, - "body": { - "string": "[1,\"Sent\",\"16885001923916260\"]" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files/6144738d-4719-4bcb-9574-759c87ba2dda/king_arthur.txt?uuid=uuid-mock", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" + "1982" ], "Connection": [ "keep-alive" - ] - } - }, - "response": { - "status": { - "code": 307, - "message": "Temporary Redirect" - }, - "headers": { - "Cache-Control": [ - "public, max-age=848, immutable" ], - "Location": [ - "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/6144738d-4719-4bcb-9574-759c87ba2dda/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20230704%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230704T190000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=eefac0ff6d196b2e9b7e630e54e2abcecb0ab9b2e954742e3e43d866e373f54e" + "Access-Control-Allow-Credentials": [ + "true" ], - "Connection": [ - "keep-alive" - ], - "Content-Length": [ - "0" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ], - "Access-Control-Allow-Origin": [ + "Access-Control-Expose-Headers": [ "*" ] }, "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/6144738d-4719-4bcb-9574-759c87ba2dda/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20230704%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230704T190000Z&X-Amz-Expires=3900&X-Amz-Signature=eefac0ff6d196b2e9b7e630e54e2abcecb0ab9b2e954742e3e43d866e373f54e&X-Amz-SignedHeaders=host", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" - ], - "Connection": [ - "keep-alive" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "x-amz-expiration": [ - "expiry-date=\"Thu, 06 Jul 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "X-Amz-Cf-Id": [ - "0su1Z_4V03uqmqXkurjllb3XWVKGorOUeSRzacQRIsQfEadHeyI-Sg==" - ], - "Accept-Ranges": [ - "bytes" - ], - "Via": [ - "1.1 116bbd3369f3a47b2d68a49a57fa7b40.cloudfront.net (CloudFront)" - ], - "ETag": [ - "\"31af664ac2b86f242369f06edf9dc460\"" - ], - "Server": [ - "AmazonS3" - ], - "Connection": [ - "keep-alive" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Last-Modified": [ - "Tue, 04 Jul 2023 19:49:53 GMT" - ], - "X-Amz-Cf-Pop": [ - "WAW51-P3" - ], - "X-Cache": [ - "Miss from cloudfront" - ], - "Content-Length": [ - "48" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:53 GMT" - ] - }, - "body": { - "binary": "a25pZ2h0c29mbmkxMjM0NXhX1dC1HBzwtIzoGVMqSAnqhEXQVl2lBbf6vckPOx7R" + "string": "{\"status\":200,\"data\":{\"id\":\"6fad526d-ab5f-4941-8d01-5a2630b34ab1\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-06T23:09:26Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/6fad526d-ab5f-4941-8d01-5a2630b34ab1/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241206/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241206T230926Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDZUMjM6MDk6MjZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvNmZhZDUyNmQtYWI1Zi00OTQxLThkMDEtNWEyNjMwYjM0YWIxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA2L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDZUMjMwOTI2WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"c80dc1a774e80a5c2545944e21b935d5191a58e4471ae872ea88e4d375eaa702\"}]}}" } } } diff --git a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json index 097afc48..edd94631 100644 --- a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json +++ b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json @@ -7,134 +7,26 @@ "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/generate-upload-url?uuid=uuid-mock", "body": "{\"name\": \"king_arthur.txt\"}", "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" + "host": [ + "ps.pndsn.com" ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ + "accept": [ "*/*" ], - "Connection": [ - "keep-alive" - ], - "Content-type": [ - "application/json" - ], - "Content-Length": [ - "27" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "Connection": [ - "keep-alive" - ], - "Content-Type": [ - "application/json" - ], - "Content-Length": [ - "1989" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:51 GMT" - ], - "Access-Control-Allow-Origin": [ - "*" - ] - }, - "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"4c8364f9-3d47-4196-8b0a-d1311a97e8d1\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2023-07-04T19:50:51Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/4c8364f9-3d47-4196-8b0a-d1311a97e8d1/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20230704/eu-central-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20230704T195051Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjMtMDctMDRUMTk6NTA6NTFaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtODhiOWRiYWItMjBmMS00OGQ0LThkZjMtOWJmYWJiMDBjMGI0L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvNGM4MzY0ZjktM2Q0Ny00MTk2LThiMGEtZDEzMTFhOTdlOGQxL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjMwNzA0L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMzA3MDRUMTk1MDUxWiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"ca3764c9c3cdf3be6d9fda3d53e2ab74f125abf70cb41110450ac101fb55ff68\"}]}}" - } - } - }, - { - "request": { - "method": "POST", - "uri": "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/", - "body": { - "binary": "LS0zMzRhYmM0MTAyMzEwODE4ZWUxNTAyODJiNTRjNTYwOQ0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJ0YWdnaW5nIg0KDQo8VGFnZ2luZz48VGFnU2V0PjxUYWc+PEtleT5PYmplY3RUVExJbkRheXM8L0tleT48VmFsdWU+MTwvVmFsdWU+PC9UYWc+PC9UYWdTZXQ+PC9UYWdnaW5nPg0KLS0zMzRhYmM0MTAyMzEwODE4ZWUxNTAyODJiNTRjNTYwOQ0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJrZXkiDQoNCnN1Yi1jLTg4YjlkYmFiLTIwZjEtNDhkNC04ZGYzLTliZmFiYjAwYzBiNC9mLXRJQWNOW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pvZ0lrRlhVelF0U0UxQlF5MVRTRUV5TlRZaWZTd0tDUWw3SW5ndFlXMTZMV1JoZEdVaU9pQWlNakF5TXpBM01EUlVNVGsxTURVeFdpSWdmUW9KWFFwOUNnPT0NCi0tMzM0YWJjNDEwMjMxMDgxOGVlMTUwMjgyYjU0YzU2MDkNCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iWC1BbXotU2lnbmF0dXJlIg0KDQpjYTM3NjRjOWMzY2RmM2JlNmQ5ZmRhM2Q1M2UyYWI3NGYxMjVhYmY3MGNiNDExMTA0NTBhYzEwMWZiNTVmZjY4DQotLTMzNGFiYzQxMDIzMTA4MThlZTE1MDI4MmI1NGM1NjA5DQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImZpbGUiOyBmaWxlbmFtZT0ia2luZ19hcnRodXIudHh0Ig0KDQprbmlnaHRzb2ZuaTEyMzQ1WROoIL5+mIcDLrFsD1pXILAs96HbdvkteQfzeLPZFVoNCi0tMzM0YWJjNDEwMjMxMDgxOGVlMTUwMjgyYjU0YzU2MDktLQ0K" - }, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ + "accept-encoding": [ "gzip, deflate" ], - "Accept": [ - "*/*" - ], - "Connection": [ + "connection": [ "keep-alive" ], - "Content-Length": [ - "2343" - ], - "Content-Type": [ - "multipart/form-data; boundary=334abc4102310818ee150282b54c5609" - ] - } - }, - "response": { - "status": { - "code": 204, - "message": "No Content" - }, - "headers": { - "x-amz-expiration": [ - "expiry-date=\"Thu, 06 Jul 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-request-id": [ - "HGJZYD4BKZEXHRBD" - ], - "ETag": [ - "\"34becf969765be57d7444e86655ba3e1\"" - ], - "Server": [ - "AmazonS3" - ], - "Location": [ - "https://pubnub-mnemosyne-files-eu-central-1-prd.s3.eu-central-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2F4c8364f9-3d47-4196-8b0a-d1311a97e8d1%2Fking_arthur.txt" - ], - "x-amz-id-2": [ - "v60LspWXjLjtaBRzmZXEXtOEAwxw7u5UbfYoUn6Fab0jm9Y/i7ShapdWHe8L9a1anirQ5xPkyW0=" + "user-agent": [ + "PubNub-Python/9.1.0" ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ] - }, - "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%22a25pZ2h0c29mbmkxMjM0NWlfrCKleYrAEWTkbAcZWmWNMYnBswiHQRNv3E%2Be9mwyA7pQMEzjEBgkyw0%2B5u%2BMOCRsrIyMqQV18bKtl18kvhtrPqmYunT84n9djZ2Vlo%2FNliZ29yx8TVeeI1YJxS3fdJ9%2FPwVKuA51%2BmfdRA2DcgsOBlkmMsBka4Yj%2Fl0nVbOk%22?meta=null&store=1&ttl=222&uuid=uuid-mock", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" + "content-type": [ + "application/json" ], - "Connection": [ - "keep-alive" + "content-length": [ + "27" ] } }, @@ -144,154 +36,27 @@ "message": "OK" }, "headers": { - "Cache-Control": [ - "no-cache" - ], - "Connection": [ - "keep-alive" + "Date": [ + "Fri, 06 Dec 2024 23:08:25 GMT" ], "Content-Type": [ - "text/javascript; charset=\"UTF-8\"" + "application/json" ], "Content-Length": [ - "30" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:51 GMT" - ], - "Access-Control-Allow-Origin": [ - "*" - ], - "Access-Control-Allow-Methods": [ - "GET" - ] - }, - "body": { - "string": "[1,\"Sent\",\"16885001917892621\"]" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files/4c8364f9-3d47-4196-8b0a-d1311a97e8d1/king_arthur.txt?uuid=uuid-mock", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" + "1982" ], "Connection": [ "keep-alive" - ] - } - }, - "response": { - "status": { - "code": 307, - "message": "Temporary Redirect" - }, - "headers": { - "Cache-Control": [ - "public, max-age=849, immutable" ], - "Location": [ - "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/4c8364f9-3d47-4196-8b0a-d1311a97e8d1/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20230704%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230704T190000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=53ddeccd7481586b498b8d52a3fca1cc3c509ee0e4db75114bdda960f42ad66a" + "Access-Control-Allow-Credentials": [ + "true" ], - "Connection": [ - "keep-alive" - ], - "Content-Length": [ - "0" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:51 GMT" - ], - "Access-Control-Allow-Origin": [ + "Access-Control-Expose-Headers": [ "*" ] }, "body": { - "string": "" - } - } - }, - { - "request": { - "method": "GET", - "uri": "https://files-eu-central-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/4c8364f9-3d47-4196-8b0a-d1311a97e8d1/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20230704%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230704T190000Z&X-Amz-Expires=3900&X-Amz-Signature=53ddeccd7481586b498b8d52a3fca1cc3c509ee0e4db75114bdda960f42ad66a&X-Amz-SignedHeaders=host", - "body": null, - "headers": { - "User-Agent": [ - "PubNub-Python/7.1.0" - ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ - "*/*" - ], - "Connection": [ - "keep-alive" - ] - } - }, - "response": { - "status": { - "code": 200, - "message": "OK" - }, - "headers": { - "x-amz-expiration": [ - "expiry-date=\"Thu, 06 Jul 2023 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" - ], - "x-amz-server-side-encryption": [ - "AES256" - ], - "X-Amz-Cf-Id": [ - "pq8WX-lwob2MNiiVsHdZjXEKD2YxDtB-BxS5KqG129X5DH-IN0-KBw==" - ], - "Accept-Ranges": [ - "bytes" - ], - "Via": [ - "1.1 cffe8a62b982ad6d295e862637dbfaf2.cloudfront.net (CloudFront)" - ], - "ETag": [ - "\"34becf969765be57d7444e86655ba3e1\"" - ], - "Server": [ - "AmazonS3" - ], - "Connection": [ - "keep-alive" - ], - "Content-Type": [ - "text/plain; charset=utf-8" - ], - "Last-Modified": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ], - "X-Amz-Cf-Pop": [ - "WAW51-P3" - ], - "X-Cache": [ - "Miss from cloudfront" - ], - "Content-Length": [ - "48" - ], - "Date": [ - "Tue, 04 Jul 2023 19:49:52 GMT" - ] - }, - "body": { - "binary": "a25pZ2h0c29mbmkxMjM0NVkTqCC+fpiHAy6xbA9aVyCwLPeh23b5LXkH83iz2RVa" + "string": "{\"status\":200,\"data\":{\"id\":\"0c1cd496-4371-4d12-b4ec-3cce862430df\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-06T23:09:25Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/0c1cd496-4371-4d12-b4ec-3cce862430df/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241206/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241206T230925Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDZUMjM6MDk6MjVaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvMGMxY2Q0OTYtNDM3MS00ZDEyLWI0ZWMtM2NjZTg2MjQzMGRmL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjA2L3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMDZUMjMwOTI1WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"13f8bebac2c91148fc71ec50aaefd3b9f03150b2b969f45f82a0e6c3484395eb\"}]}}" } } } diff --git a/tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.yaml b/tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.yaml deleted file mode 100644 index 8d532a7d..00000000 --- a/tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.yaml +++ /dev/null @@ -1,150 +0,0 @@ -interactions: -- request: - body: '{"name": "king_arthur.txt"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '27' - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://ps.pndsn.com/v1/files/sub-c-mock-key/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid - response: - body: - string: !!binary | - H4sIAAAAAAAAA4xVW3OiSBT+K1u+zhC7m0skW/Ng8AYDRAW57W6lGmgQ5OJIE8Wp/PdtNMm4k5e1 - Culz/845H/Bz0FBM22bwgAD4OogxxYOHn4MsHjwMJDQSeMDfc/dYxJwQoxGHIyxxMkpILIsIRJE0 - +DqocEmY9y6r0md8oNv2cEdPdPD6dZBkBXlu90WN4+cD+dGShvbJ20PB/LeU7puH4XDfhlUbcmVF - yrrpKsL1UQ1HWi4iFT3ggoPc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yWAelc6u98PurLlwZjfTrc0sMMHMMXfxej1xdAdotgGChX6+8PLE - eCnqyIG6axZhte5890gNSz4bnbyNeQN4vFZEnlNE/CpLrjjv1Sqlvgsl3TMLn3c6hlXUvfUL4+qV - 89kb7xiHiQK3oVcz/1MV8to+nm/pGzZvw3ZoTeHjqoO2NZ12pu1/ruGutzHr+SkbZwxvZ0ymp7fn - iO1qitxMTZNVrXmrvayk3759fmVkacU+r4fbB3s0kiQo8VhGKBakmE+ADASJhFgQAAEyxAlE4n0o - xQBGmESjML5nv4SXBVlGkSwPXv95ff0XAAD//wMA2y8GvLgHAAA= - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Encoding: - - gzip - Content-Type: - - application/json - Date: - - Thu, 19 Nov 2020 20:02:16 GMT - Vary: - - Accept-Encoding - status: - code: 200 - message: OK -- request: - body: "--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - tagging\"\r\n\r\nObjectTTLInDays1\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - key\"\r\n\r\nsub-c-mock-key/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/62843037-7a5a-4d28-aca6-92fed9520cc6/king_arthur.txt\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - Content-Type\"\r\n\r\ntext/plain; charset=utf-8\r\n--9a2cc9a17c70417a691d5d50320d1a2b\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Credential\"\r\n\r\nAKIAY7AU6GQD5KWBS3FG/20201119/eu-central-1/s3/aws4_request\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Security-Token\"\r\n\r\n\r\n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition:\ - \ form-data; name=\"X-Amz-Algorithm\"\r\n\r\nAWS4-HMAC-SHA256\r\n--9a2cc9a17c70417a691d5d50320d1a2b\r\ - \nContent-Disposition: form-data; name=\"X-Amz-Date\"\r\n\r\n20201119T200316Z\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - Policy\"\r\n\r\nCnsKCSJleHBpcmF0aW9uIjogIjIwMjAtMTEtMTlUMjA6MDM6MTZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtZXUtY2VudHJhbC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtYzg4MjQyZmEtMTNhZS0xMWViLWJjMzQtY2U2ZmQ5NjdhZjk1L2YtdElBY05YSk85bTgxZldWVl9vLWZTUS12ZXVwTnJUbG9WQVVQYmVVUVEvNjI4NDMwMzctN2E1YS00ZDI4LWFjYTYtOTJmZWQ5NTIwY2M2L2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRDVLV0JTM0ZHLzIwMjAxMTE5L2V1LWNlbnRyYWwtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyMDExMTlUMjAwMzE2WiIgfQoJXQp9Cg==\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - X-Amz-Signature\"\r\n\r\n8866163a922d46d3f09046eba440e091af1257b6d01caec8bd7777f394992c99\r\ - \n--9a2cc9a17c70417a691d5d50320d1a2b\r\nContent-Disposition: form-data; name=\"\ - file\"; filename=\"king_arthur.txt\"\r\n\r\nKnights who say Ni!\r\n--9a2cc9a17c70417a691d5d50320d1a2b--\r\ - \n" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2314' - Content-Type: - - multipart/form-data; boundary=9a2cc9a17c70417a691d5d50320d1a2b - User-Agent: - - PubNub-Python/4.6.1 - method: POST - uri: https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/ - response: - body: - string: '' - headers: - Date: - - Thu, 19 Nov 2020 20:02:17 GMT - ETag: - - '"3676cdb7a927db43c846070c4e7606c7"' - Location: - - https://pubnub-mnemosyne-files-eu-central-1-prd.s3.amazonaws.com/sub-c-mock-key%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2F62843037-7a5a-4d28-aca6-92fed9520cc6%2Fking_arthur.txt - Server: - - AmazonS3 - x-amz-expiration: - - expiry-date="Sat, 21 Nov 2020 00:00:00 GMT", rule-id="Archive file 1 day after - creation" - x-amz-id-2: - - ni/6kQFsLQrXV0wa1UpVrO2jbhDDngMdCBnFrO0AyYpVxI6ygUg0H3qdM3cPCWeLtSUCFoDzKqg= - x-amz-request-id: - - B88BF0CCE2F534B9 - x-amz-server-side-encryption: - - AES256 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - PubNub-Python/4.6.1 - method: GET - uri: https://ps.pndsn.com/v1/files/publish-file/pub-c-mock-key/sub-c-mock-key/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%2262843037-7a5a-4d28-aca6-92fed9520cc6%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&ptto=16057799474000000&store=1&ttl=222&uuid=files_native_sync_uuid - response: - body: - string: '[1,"Sent","16057799474000000"]' - headers: - Access-Control-Allow-Methods: - - GET - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - no-cache - Connection: - - keep-alive - Content-Length: - - '30' - Content-Type: - - text/javascript; charset="UTF-8" - Date: - - Thu, 19 Nov 2020 20:02:17 GMT - status: - code: 200 - message: OK -version: 1 diff --git a/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json index d884be54..d12949f1 100644 --- a/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json +++ b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json @@ -5,19 +5,22 @@ "request": { "method": "GET", "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?custom_message_type=test_message&meta=%7B%7D&store=0&ttl=0&uuid=uuid-mock", - "body": null, + "body": "", "headers": { - "User-Agent": [ - "PubNub-Python/9.0.0" + "host": [ + "ps.pndsn.com" ], - "Accept-Encoding": [ - "gzip, deflate" - ], - "Accept": [ + "accept": [ "*/*" ], - "Connection": [ + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" ] } }, @@ -27,30 +30,33 @@ "message": "OK" }, "headers": { - "Cache-Control": [ - "no-cache" - ], - "Access-Control-Allow-Methods": [ - "GET" - ], "Date": [ - "Mon, 21 Oct 2024 08:19:49 GMT" + "Fri, 06 Dec 2024 23:08:26 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" ], + "Content-Length": [ + "30" + ], "Connection": [ "keep-alive" ], - "Content-Length": [ - "30" + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" ], - "Access-Control-Allow-Origin": [ + "Access-Control-Expose-Headers": [ "*" ] }, "body": { - "string": "[1,\"Sent\",\"17294987898141374\"]" + "string": "[1,\"Sent\",\"17335265062074045\"]" } } } diff --git a/tests/integrational/fixtures/native_sync/history/not_permitted.yaml b/tests/integrational/fixtures/native_sync/history/not_permitted.yaml deleted file mode 100644 index d17c50b2..00000000 --- a/tests/integrational/fixtures/native_sync/history/not_permitted.yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [PubNub-Python/4.0.4] - method: GET - uri: https://ps.pndsn.com/v2/history/sub-key/sub-c-7ba2ac4c-4836-11e6-85a4-0619f8945a4f/channel/history-native-sync-ch?count=5&signature=DFG6A6mYSj-s8dj3w_cQNBJdMCPCYeHLpiAgeIbCb-g%3D×tamp=1482099937 - response: - body: {string: '[[],0,0]'} - headers: - Accept-Ranges: [bytes] - Access-Control-Allow-Methods: [GET] - Access-Control-Allow-Origin: ['*'] - Age: ['0'] - Cache-Control: [no-cache] - Connection: [keep-alive] - Content-Length: ['8'] - Content-Type: [text/javascript; charset="UTF-8"] - Date: ['Sun, 18 Dec 2016 22:25:37 GMT'] - Server: [Pubnub] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/integrational/native_sync/test_file_upload.py b/tests/integrational/native_sync/test_file_upload.py index 19f8fedf..620e0ad9 100644 --- a/tests/integrational/native_sync/test_file_upload.py +++ b/tests/integrational/native_sync/test_file_upload.py @@ -6,8 +6,8 @@ from unittest.mock import patch from pubnub.exceptions import PubNubException from pubnub.pubnub import PubNub -from tests.integrational.vcr_helper import pn_vcr, pn_vcr_with_empty_body_request -from tests.helper import pnconf_file_copy, pnconf_enc_env_copy, pnconf_env_copy +from tests.integrational.vcr_helper import pn_vcr # , pn_vcr_with_empty_body_request +from tests.helper import pnconf_env_copy, pnconf_enc_env_copy, pnconf_env_copy from pubnub.endpoints.file_operations.publish_file_message import PublishFileMessage from pubnub.models.consumer.file import ( PNSendFileResult, PNGetFilesResult, PNDownloadFileResult, @@ -17,13 +17,15 @@ CHANNEL = "files_native_sync_ch" -pubnub = PubNub(pnconf_file_copy()) +pubnub = PubNub(pnconf_env_copy(disable_config_locking=True)) pubnub.config.uuid = "files_native_sync_uuid" def send_file(file_for_upload, cipher_key=None, pass_binary=False, timetoken_override=None, pubnub_instance=None): if not pubnub_instance: pubnub_instance = pubnub + if cipher_key: + pubnub_instance.config.cipher_key = cipher_key with open(file_for_upload.strpath, "rb") as fd: if pass_binary: @@ -35,8 +37,7 @@ def send_file(file_for_upload, cipher_key=None, pass_binary=False, timetoken_ove .message({"test_message": "test"}) \ .should_store(True) \ .ttl(222) \ - .file_object(fd) \ - .cipher_key(cipher_key) + .file_object(fd) if timetoken_override: send_file_endpoint = send_file_endpoint.ptto(timetoken_override) @@ -50,22 +51,34 @@ def send_file(file_for_upload, cipher_key=None, pass_binary=False, timetoken_ove return envelope -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/list_files.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/delete_all_files.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) +def test_delete_all_files(file_upload_test_data): + envelope = pubnub.list_files().channel(CHANNEL).sync() + files = envelope.result.data + for i in range(len(files) - 1): + file = files[i] + pubnub.delete_file().channel(CHANNEL).file_id(file["id"]).file_name(file["name"]).sync() + + +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/list_files.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_list_files(file_upload_test_data): envelope = pubnub.list_files().channel(CHANNEL).sync() assert isinstance(envelope.result, PNGetFilesResult) - assert envelope.result.count == 9 - assert file_upload_test_data["UPLOADED_FILENAME"] == envelope.result.data[8]["name"] + assert envelope.result.count == 1 + assert file_upload_test_data["UPLOADED_FILENAME"] == envelope.result.data[0]["name"] -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/download_file.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/download_file.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_send_and_download_file_using_bytes_object(file_for_upload, file_upload_test_data): envelope = send_file(file_for_upload, pass_binary=True) @@ -79,10 +92,10 @@ def test_send_and_download_file_using_bytes_object(file_for_upload, file_upload_ assert data == bytes(file_upload_test_data["FILE_CONTENT"], "utf-8") -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_send_and_download_encrypted_file(file_for_upload, file_upload_test_data): cipher_key = "silly_walk" with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): @@ -91,18 +104,17 @@ def test_send_and_download_encrypted_file(file_for_upload, file_upload_test_data download_envelope = pubnub.download_file() \ .channel(CHANNEL) \ .file_id(envelope.result.file_id) \ - .file_name(envelope.result.name) \ - .cipher_key(cipher_key).sync() + .file_name(envelope.result.name).sync() assert isinstance(download_envelope.result, PNDownloadFileResult) data = download_envelope.result.data assert data == bytes(file_upload_test_data["FILE_CONTENT"], "utf-8") -@pn_vcr_with_empty_body_request.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr_with_empty_body_request.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/file_size_exceeded_maximum_size.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# # ) def test_file_exceeded_maximum_size(file_for_upload_10mb_size): with pytest.raises(PubNubException) as exception: send_file(file_for_upload_10mb_size) @@ -110,10 +122,10 @@ def test_file_exceeded_maximum_size(file_for_upload_10mb_size): assert "Your proposed upload exceeds the maximum allowed size" in str(exception.value) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/delete_file.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/delete_file.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_delete_file(file_for_upload): envelope = send_file(file_for_upload) @@ -125,10 +137,10 @@ def test_delete_file(file_for_upload): assert isinstance(delete_envelope.result, PNDeleteFileResult) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/download_url.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/download_url.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_get_file_url(file_for_upload): envelope = send_file(file_for_upload) @@ -138,14 +150,15 @@ def test_get_file_url(file_for_upload): .file_name(envelope.result.name).sync() assert isinstance(file_url_envelope.result, PNGetFileDownloadURLResult) + assert file_url_envelope.result.file_url is not None -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/download_url_check_auth_key_in_url.json", +# filter_query_parameters=('pnsdk',), serializer="pn_json", +# ) def test_get_file_url_has_auth_key_in_url_and_signature(file_upload_test_data): - pubnub = PubNub(pnconf_file_copy()) + pubnub = PubNub(pnconf_env_copy()) pubnub.config.uuid = "files_native_sync_uuid" pubnub.config.auth_key = "test_auth_key" @@ -157,10 +170,10 @@ def test_get_file_url_has_auth_key_in_url_and_signature(file_upload_test_data): assert "auth=test_auth_key" in str(file_url_envelope.status.client_request.url) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/fetch_file_upload_data.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_fetch_file_upload_s3_data(file_upload_test_data): envelope = pubnub._fetch_file_upload_s3_data() \ .channel(CHANNEL) \ @@ -169,10 +182,10 @@ def test_fetch_file_upload_s3_data(file_upload_test_data): assert isinstance(envelope.result, PNFetchFileUploadS3DataResult) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/publish_file_message.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/publish_file_message.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_publish_file_message(): envelope = PublishFileMessage(pubnub) \ .channel(CHANNEL) \ @@ -186,10 +199,10 @@ def test_publish_file_message(): assert isinstance(envelope.result, PNPublishFileMessageResult) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/publish_file_message_encrypted.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_publish_file_message_with_encryption(): envelope = PublishFileMessage(pubnub) \ .channel(CHANNEL) \ @@ -203,10 +216,10 @@ def test_publish_file_message_with_encryption(): assert isinstance(envelope.result, PNPublishFileMessageResult) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_ptto.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_publish_file_message_with_overriding_time_token(): timetoken_to_override = 16057799474000000 envelope = PublishFileMessage(pubnub) \ @@ -225,43 +238,44 @@ def test_publish_file_message_with_overriding_time_token(): assert "ptto" in urllib.parse.parse_qs(envelope.status.client_request.url.query.decode()) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.yaml", - filter_query_parameters=('pnsdk',) -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/send_file_with_ptto.json", serializer="pn_json", +# filter_query_parameters=('pnsdk',) +# ) def test_send_file_with_timetoken_override(file_for_upload): send_file(file_for_upload, pass_binary=True, timetoken_override=16057799474000000) -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json", - filter_query_parameters=('pnsdk',), serializer='pn_json' -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/send_and_download_gcm_encrypted_file.json", +# filter_query_parameters=('pnsdk',), serializer='pn_json' +# ) def test_send_and_download_gcm_encrypted_file(file_for_upload, file_upload_test_data): + cipher_key = "silly_walk" + config = pnconf_enc_env_copy() config.cipher_mode = AES.MODE_GCM config.fallback_cipher_mode = AES.MODE_CBC + config.cipher_key = cipher_key pubnub = PubNub(config) - cipher_key = "silly_walk" with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): envelope = send_file(file_for_upload, cipher_key=cipher_key, pubnub_instance=pubnub) download_envelope = pubnub.download_file() \ .channel(CHANNEL) \ .file_id(envelope.result.file_id) \ - .file_name(envelope.result.name) \ - .cipher_key(cipher_key).sync() + .file_name(envelope.result.name).sync() assert isinstance(download_envelope.result, PNDownloadFileResult) data = download_envelope.result.data assert data == bytes(file_upload_test_data["FILE_CONTENT"], "utf-8") -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json", - filter_query_parameters=('pnsdk',), serializer='pn_json' -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file_fallback_decode.json", +# filter_query_parameters=('pnsdk',), serializer='pn_json' +# ) def test_send_and_download_encrypted_file_fallback_decode(file_for_upload, file_upload_test_data): config_cbc = pnconf_enc_env_copy() pn_cbc = PubNub(config_cbc) diff --git a/tests/integrational/native_sync/test_history.py b/tests/integrational/native_sync/test_history.py index 335aaf85..c917f23a 100644 --- a/tests/integrational/native_sync/test_history.py +++ b/tests/integrational/native_sync/test_history.py @@ -10,7 +10,8 @@ from pubnub.models.consumer.history import PNHistoryResult from pubnub.models.consumer.pubsub import PNPublishResult from pubnub.pubnub import PubNub -from tests.helper import pnconf_copy, pnconf_enc_copy, pnconf_enc_env_copy, pnconf_env_copy, pnconf_pam_copy +from tests.helper import pnconf_copy, pnconf_enc_copy, pnconf_enc_env_copy, pnconf_env_copy, pnconf_pam_copy, \ + pnconf_pam_stub_copy from tests.integrational.vcr_helper import use_cassette_and_stub_time_sleep_native pubnub.set_stream_logger('pubnub', logging.DEBUG) @@ -76,11 +77,9 @@ def test_encrypted(self, crypto_mock): assert envelope.result.messages[3].entry == 'hey-3' assert envelope.result.messages[4].entry == 'hey-4' - @use_cassette_and_stub_time_sleep_native('tests/integrational/fixtures/native_sync/history/not_permitted.yaml', - filter_query_parameters=['uuid', 'pnsdk']) def test_not_permitted(self): ch = "history-native-sync-ch" - pubnub = PubNub(pnconf_pam_copy()) + pubnub = PubNub(pnconf_pam_stub_copy(non_subscribe_request_timeout=1)) pubnub.config.uuid = "history-native-sync-uuid" with pytest.raises(PubNubException): diff --git a/tests/integrational/native_sync/test_state.py b/tests/integrational/native_sync/test_state.py index d17b196d..4de5f036 100644 --- a/tests/integrational/native_sync/test_state.py +++ b/tests/integrational/native_sync/test_state.py @@ -4,7 +4,7 @@ import pubnub from pubnub.models.consumer.presence import PNSetStateResult, PNGetStateResult from pubnub.pubnub import PubNub -from tests.helper import pnconf_copy, pnconf_pam_copy +from tests.helper import pnconf_copy, pnconf_pam_env_copy from tests.integrational.vcr_helper import pn_vcr pubnub.set_stream_logger('pubnub', logging.DEBUG) @@ -57,9 +57,9 @@ def test_multiple_channels(self): def test_super_call(self): ch1 = "state-tornado-ch1" ch2 = "state-tornado-ch2" - pnconf = pnconf_pam_copy() + pnconf = pnconf_pam_env_copy() pubnub = PubNub(pnconf) - pubnub.config.uuid = 'test-state-native-uuid-|.*$' + pubnub.config.uuid = 'test-state-native-' state = {"name": "Alex", "count": 5} env = pubnub.set_state() \ diff --git a/tests/integrational/vcr_helper.py b/tests/integrational/vcr_helper.py index 3ef13a5b..57f57163 100644 --- a/tests/integrational/vcr_helper.py +++ b/tests/integrational/vcr_helper.py @@ -197,6 +197,8 @@ def check_the_difference_matcher(r1, r2): pn_vcr.register_matcher('string_list_in_query', string_list_in_query_matcher) pn_vcr.register_serializer('pn_json', PNSerializer()) +pn_vcr_with_empty_body_request.register_serializer('pn_json', PNSerializer()) + def use_cassette_and_stub_time_sleep_native(cassette_name, **kwargs): context = pn_vcr.use_cassette(cassette_name, **kwargs) diff --git a/tests/integrational/vcr_serializer.py b/tests/integrational/vcr_serializer.py index 00ae4fd1..e998a107 100644 --- a/tests/integrational/vcr_serializer.py +++ b/tests/integrational/vcr_serializer.py @@ -2,7 +2,6 @@ import re from base64 import b64decode, b64encode from vcr.serializers.jsonserializer import serialize, deserialize -from pickle import dumps, loads class PNSerializer: @@ -30,9 +29,6 @@ def serialize(self, cassette_dict): if type(interaction['response']['body']['string']) is bytes: ascii_body = b64encode(interaction['response']['body']['string']).decode('ascii') interaction['response']['body'] = {'binary': ascii_body} - if interaction['request']['body']: - ascii_body = b64encode(dumps(interaction['request']['body'])).decode('ascii') - interaction['request']['body'] = {'pickle': ascii_body} return self.replace_keys(serialize(cassette_dict)) @@ -44,8 +40,9 @@ def replace_placeholders(self, cassette_string): def deserialize(self, cassette_string): cassette_dict = deserialize(self.replace_placeholders(cassette_string)) for index, interaction in enumerate(cassette_dict['interactions']): - if isinstance(interaction['request']['body'], dict) and 'pickle' in interaction['request']['body'].keys(): - interaction['request']['body'] = loads(b64decode(interaction['request']['body']['pickle'])) + if isinstance(interaction['request']['body'], dict) and 'binary' in interaction['request']['body'].keys(): + interaction['request']['body']['string'] = b64decode(interaction['request']['body']['binary']) + del interaction['request']['body']['binary'] if 'binary' in interaction['response']['body'].keys(): interaction['response']['body']['string'] = b64decode(interaction['response']['body']['binary']) del interaction['response']['body']['binary'] diff --git a/tests/pytest.ini b/tests/pytest.ini index 3d66fe5b..4b96538c 100644 --- a/tests/pytest.ini +++ b/tests/pytest.ini @@ -1,5 +1,7 @@ [pytest] filterwarnings = ignore:Mutable config will be deprecated in the future.:DeprecationWarning + ignore:Access management v2 is being deprecated.:DeprecationWarning + ignore:.*Usage of local cipher_keys is discouraged.*:UserWarning asyncio_default_fixture_loop_scope = module \ No newline at end of file From f284dd57282d26b498a824d5fec22389fe5dec78 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Fri, 13 Dec 2024 16:50:44 +0100 Subject: [PATCH 07/16] Just before cleanup --- .../file_operations/download_file.py | 3 +- pubnub/endpoints/file_operations/send_file.py | 3 +- pubnub/pubnub.py | 58 ++- pubnub/pubnub_asyncio.py | 10 +- .../{requests_handler.py => httpx.py} | 12 +- pubnub/request_handlers/requests.py | 334 ++++++++++++++++++ .../asyncio/test_channel_groups.py | 18 +- .../integrational/asyncio/test_file_upload.py | 8 +- tests/integrational/asyncio/test_fire.py | 4 +- tests/integrational/asyncio/test_here_now.py | 2 +- .../asyncio/test_history_delete.py | 8 +- .../integrational/asyncio/test_invocations.py | 24 +- .../asyncio/test_message_count.py | 1 - tests/integrational/asyncio/test_pam.py | 36 +- tests/integrational/asyncio/test_publish.py | 64 ++-- tests/integrational/asyncio/test_signal.py | 4 +- tests/integrational/asyncio/test_ssl.py | 4 +- tests/integrational/asyncio/test_time.py | 4 +- ...download_encrypted_file_crypto_module.json | 233 +++++++++++- .../file_upload/send_and_download_file.json | 316 +++++++++++++++++ .../native_sync/file_upload/list_files.json | 111 ++++++ ...publish_file_message_with_custom_type.json | 64 ++++ .../send_and_download_encrypted_file.json | 325 +++++++++++++++++ ..._and_download_file_using_bytes_object.json | 325 +++++++++++++++++ .../test_publish_file_with_custom_type.json | 4 +- .../native_sync/test_file_upload.py | 32 +- tests/integrational/vcr_helper.py | 2 +- tests/integrational/vcr_serializer.py | 23 +- 28 files changed, 1861 insertions(+), 171 deletions(-) rename pubnub/request_handlers/{requests_handler.py => httpx.py} (94%) create mode 100644 pubnub/request_handlers/requests.py create mode 100644 tests/integrational/fixtures/native_sync/file_upload/list_files.json create mode 100644 tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_custom_type.json create mode 100644 tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file.json create mode 100644 tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json diff --git a/pubnub/endpoints/file_operations/download_file.py b/pubnub/endpoints/file_operations/download_file.py index 8bdddf87..02e153a9 100644 --- a/pubnub/endpoints/file_operations/download_file.py +++ b/pubnub/endpoints/file_operations/download_file.py @@ -2,7 +2,6 @@ from pubnub.enums import HttpMethod, PNOperationType from pubnub.crypto import PubNubFileCrypto from pubnub.models.consumer.file import PNDownloadFileResult -from pubnub.request_handlers.requests_handler import RequestsRequestHandler from pubnub.endpoints.file_operations.get_file_url import GetFileDownloadUrl from warnings import warn from urllib.parse import urlparse, parse_qs @@ -86,4 +85,4 @@ def sync(self): return super(DownloadFileNative, self).sync() def pn_async(self, callback): - return RequestsRequestHandler(self._pubnub).async_file_based_operation(self.sync, callback, "File Download") + self._pubnub.get_request_handler().async_file_based_operation(self.sync, callback, "File Download") diff --git a/pubnub/endpoints/file_operations/send_file.py b/pubnub/endpoints/file_operations/send_file.py index c6107c0b..6edc7521 100644 --- a/pubnub/endpoints/file_operations/send_file.py +++ b/pubnub/endpoints/file_operations/send_file.py @@ -5,7 +5,6 @@ from pubnub.models.consumer.file import PNSendFileResult from pubnub.endpoints.file_operations.publish_file_message import PublishFileMessage from pubnub.endpoints.file_operations.fetch_upload_details import FetchFileUploadS3Data -from pubnub.request_handlers.requests_handler import RequestsRequestHandler from pubnub.endpoints.mixins import TimeTokenOverrideMixin from warnings import warn @@ -152,4 +151,4 @@ def sync(self): return response_envelope def pn_async(self, callback): - return RequestsRequestHandler(self._pubnub).async_file_based_operation(self.sync, callback, "File Download") + self._pubnub.get_request_handler().async_file_based_operation(self.sync, callback, "File Download") diff --git a/pubnub/pubnub.py b/pubnub/pubnub.py index d1c5017e..d9e133ce 100644 --- a/pubnub/pubnub.py +++ b/pubnub/pubnub.py @@ -2,22 +2,23 @@ import logging import threading +from typing import Type from threading import Event from queue import Queue, Empty -from . import utils -from .request_handlers.base import BaseRequestHandler -from .request_handlers.requests_handler import RequestsRequestHandler -from .callbacks import SubscribeCallback, ReconnectionCallback -from .endpoints.presence.heartbeat import Heartbeat -from .endpoints.presence.leave import Leave -from .endpoints.pubsub.subscribe import Subscribe -from .enums import PNStatusCategory, PNHeartbeatNotificationOptions, PNOperationType, PNReconnectionPolicy -from .managers import SubscriptionManager, PublishSequenceManager, ReconnectionManager, TelemetryManager -from .models.consumer.common import PNStatus -from .pnconfiguration import PNConfiguration -from .pubnub_core import PubNubCore -from .structures import PlatformOptions -from .workers import SubscribeMessageWorker +from pubnub import utils +from pubnub.request_handlers.base import BaseRequestHandler +from pubnub.request_handlers.httpx import HttpxRequestHandler +from pubnub.callbacks import SubscribeCallback, ReconnectionCallback +from pubnub.endpoints.presence.heartbeat import Heartbeat +from pubnub.endpoints.presence.leave import Leave +from pubnub.endpoints.pubsub.subscribe import Subscribe +from pubnub.enums import PNStatusCategory, PNHeartbeatNotificationOptions, PNOperationType, PNReconnectionPolicy +from pubnub.managers import SubscriptionManager, PublishSequenceManager, ReconnectionManager, TelemetryManager +from pubnub.models.consumer.common import PNStatus +from pubnub.pnconfiguration import PNConfiguration +from pubnub.pubnub_core import PubNubCore +from pubnub.structures import PlatformOptions +from pubnub.workers import SubscribeMessageWorker logger = logging.getLogger("pubnub") @@ -25,10 +26,21 @@ class PubNub(PubNubCore): """PubNub Python API""" - def __init__(self, config): + def __init__(self, config: PNConfiguration, *, custom_request_handler: Type[BaseRequestHandler] = None): + """ PubNub instance constructor + + Parameters: + config (PNConfiguration): PNConfiguration instance (required) + custom_request_handler (BaseRequestHandler): Custom request handler class (optional) + + """ assert isinstance(config, PNConfiguration) PubNubCore.__init__(self, config) - self._request_handler = RequestsRequestHandler(self) + + if isinstance(custom_request_handler, BaseRequestHandler): + self._request_handler = custom_request_handler(self) + else: + self._request_handler = HttpxRequestHandler(self) if self.config.enable_subscribe: self._subscription_manager = NativeSubscriptionManager(self) @@ -40,10 +52,22 @@ def __init__(self, config): def sdk_platform(self): return "" - def set_request_handler(self, handler): + def set_request_handler(self, handler: BaseRequestHandler): + """Set custom request handler + + Parametrers: + handler (BaseRequestHandler): Instance of custom request handler + """ assert isinstance(handler, BaseRequestHandler) self._request_handler = handler + def get_request_handler(self) -> BaseRequestHandler: + """Get instance of request handler + + Return: handler(BaseRequestHandler): Instance of request handler + """ + return self._request_handler + def request_sync(self, endpoint_call_options): platform_options = PlatformOptions(self.headers, self.config) diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index d817cd54..a7c15362 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -18,6 +18,9 @@ from pubnub.endpoints.presence.leave import Leave from pubnub.endpoints.pubsub.subscribe import Subscribe from pubnub.pubnub_core import PubNubCore +from pubnub.request_handlers.base import BaseRequestHandler +from pubnub.request_handlers.httpx import HttpxRequestHandler +from pubnub.request_handlers.requests import RequestsRequestHandler from pubnub.workers import SubscribeMessageWorker from pubnub.managers import SubscriptionManager, PublishSequenceManager, ReconnectionManager, TelemetryManager from pubnub import utils @@ -46,7 +49,7 @@ class PubNubAsyncio(PubNubCore): PubNub Python SDK for asyncio framework """ - def __init__(self, config, custom_event_loop=None, subscription_manager=None): + def __init__(self, config, custom_event_loop=None, subscription_manager=None, *, custom_request_handler=None): super(PubNubAsyncio, self).__init__(config) self.event_loop = custom_event_loop or asyncio.get_event_loop() @@ -55,6 +58,11 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None): self._connector = PubNubAsyncHTTPTransport() + if isinstance(custom_request_handler, BaseRequestHandler): + self._request_handler = custom_request_handler(self) + else: + self._request_handler = RequestsRequestHandler(self) + if not subscription_manager: subscription_manager = EventEngineSubscriptionManager diff --git a/pubnub/request_handlers/requests_handler.py b/pubnub/request_handlers/httpx.py similarity index 94% rename from pubnub/request_handlers/requests_handler.py rename to pubnub/request_handlers/httpx.py index 7a77a728..aee0a84d 100644 --- a/pubnub/request_handlers/requests_handler.py +++ b/pubnub/request_handlers/httpx.py @@ -23,18 +23,12 @@ logger = logging.getLogger("pubnub") -class RequestsRequestHandler(BaseRequestHandler): +class HttpxRequestHandler(BaseRequestHandler): """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ ENDPOINT_THREAD_COUNTER: int = 0 def __init__(self, pubnub): self.session = httpx.Client() - # self.session = Session() - - # self.session.mount('http://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) - # self.session.mount('https://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) - # self.session.mount('http://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) - # self.session.mount('https://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) self.pubnub = pubnub @@ -89,11 +83,11 @@ def execute_callback_in_separate_thread( ): client = AsyncHTTPClient(callback_to_invoke_in_another_thread) - RequestsRequestHandler.ENDPOINT_THREAD_COUNTER += 1 + HttpxRequestHandler.ENDPOINT_THREAD_COUNTER += 1 thread = threading.Thread( target=client.run, - name=f"Thread-{operation_name}-{RequestsRequestHandler.ENDPOINT_THREAD_COUNTER}", + name=f"Thread-{operation_name}-{HttpxRequestHandler.ENDPOINT_THREAD_COUNTER}", daemon=self.pubnub.config.daemon ).start() diff --git a/pubnub/request_handlers/requests.py b/pubnub/request_handlers/requests.py new file mode 100644 index 00000000..1b29068d --- /dev/null +++ b/pubnub/request_handlers/requests.py @@ -0,0 +1,334 @@ +import logging +import threading +import requests +import json # noqa # pylint: disable=W0611 +import urllib + +from requests import Session +from requests.adapters import HTTPAdapter + +from pubnub import utils +from pubnub.enums import PNStatusCategory +from pubnub.errors import PNERR_CLIENT_ERROR, PNERR_UNKNOWN_ERROR, PNERR_TOO_MANY_REDIRECTS_ERROR, \ + PNERR_CLIENT_TIMEOUT, PNERR_HTTP_ERROR, PNERR_CONNECTION_ERROR +from pubnub.errors import PNERR_SERVER_ERROR +from pubnub.exceptions import PubNubException +from pubnub.request_handlers.base import BaseRequestHandler +from pubnub.structures import RequestOptions, PlatformOptions, ResponseInfo, Envelope + +try: + from json.decoder import JSONDecodeError +except ImportError: + JSONDecodeError = ValueError + + +logger = logging.getLogger("pubnub") + + +class RequestsRequestHandler(BaseRequestHandler): + """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + ENDPOINT_THREAD_COUNTER: int = 0 + + def __init__(self, pubnub): + self.session = Session() + + self.session.mount('http://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) + self.session.mount('https://%s' % pubnub.config.origin, HTTPAdapter(max_retries=1, pool_maxsize=500)) + self.session.mount('http://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) + self.session.mount('https://%s/v2/subscribe' % pubnub.config.origin, HTTPAdapter(pool_maxsize=500)) + + self.pubnub = pubnub + + def sync_request(self, platform_options, endpoint_call_options): + return self._build_envelope(platform_options, endpoint_call_options) + + def async_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): + call = Call() + + if cancellation_event is None: + cancellation_event = threading.Event() + + def callback_to_invoke_in_separate_thread(): + try: + envelope = self._build_envelope(platform_options, endpoint_call_options) + if cancellation_event is not None and cancellation_event.is_set(): + # Since there are no way to affect on ongoing request it's response will + # be just ignored on cancel call + return + callback(envelope) + except PubNubException as e: + logger.error("Async request PubNubException. %s" % str(e)) + callback(Envelope( + result=None, + status=endpoint_call_options.create_status( + category=PNStatusCategory.PNBadRequestCategory, + response=None, + response_info=None, + exception=e))) + except Exception as e: + logger.error("Async request Exception. %s" % str(e)) + + callback(Envelope( + result=None, + status=endpoint_call_options.create_status( + category=PNStatusCategory.PNInternalExceptionCategory, + response=None, + response_info=None, + exception=e))) + finally: + call.executed_cb() + + self.execute_callback_in_separate_thread( + callback_to_invoke_in_separate_thread, + endpoint_name, + call, + cancellation_event + ) + + def execute_callback_in_separate_thread( + self, callback_to_invoke_in_another_thread, operation_name, call_obj, cancellation_event + ): + client = AsyncHTTPClient(callback_to_invoke_in_another_thread) + + RequestsRequestHandler.ENDPOINT_THREAD_COUNTER += 1 + + thread = threading.Thread( + target=client.run, + name=f"Thread-{operation_name}-{RequestsRequestHandler.ENDPOINT_THREAD_COUNTER}", + daemon=self.pubnub.config.daemon + ).start() + + call_obj.thread = thread + call_obj.cancellation_event = cancellation_event + + return call_obj + + def async_file_based_operation(self, func, callback, operation_name, cancellation_event=None): + call = Call() + + if cancellation_event is None: + cancellation_event = threading.Event() + + def callback_to_invoke_in_separate_thread(): + try: + envelope = func() + callback(envelope.result, envelope.status) + except Exception as e: + logger.error("Async file upload request Exception. %s" % str(e)) + callback( + Envelope(result=None, status=e) + ) + finally: + call.executed_cb() + + self.execute_callback_in_separate_thread( + callback_to_invoke_in_separate_thread, + operation_name, + call, + cancellation_event + ) + + return call + + def _build_envelope(self, p_options, e_options): + """ A wrapper for _invoke_url to separate request logic """ + + status_category = PNStatusCategory.PNUnknownCategory + response_info = None + + url_base_path = self.pubnub.base_origin if e_options.use_base_path else None + try: + res = self._invoke_request(p_options, e_options, url_base_path) + except PubNubException as e: + if e._pn_error is PNERR_CONNECTION_ERROR: + status_category = PNStatusCategory.PNUnexpectedDisconnectCategory + elif e._pn_error is PNERR_CLIENT_TIMEOUT: + status_category = PNStatusCategory.PNTimeoutCategory + + return Envelope( + result=None, + status=e_options.create_status( + category=status_category, + response=None, + response_info=response_info, + exception=e)) + + if res is not None: + url = urllib.parse.urlparse(res.url) + query = urllib.parse.parse_qs(url.query) + uuid = None + auth_key = None + + if 'uuid' in query and len(query['uuid']) > 0: + uuid = query['uuid'][0] + + if 'auth_key' in query and len(query['auth_key']) > 0: + auth_key = query['auth_key'][0] + + response_info = ResponseInfo( + status_code=res.status_code, + tls_enabled='https' == url.scheme, + origin=url.hostname, + uuid=uuid, + auth_key=auth_key, + client_request=res.request + ) + + if not res.ok: + if res.status_code == 403: + status_category = PNStatusCategory.PNAccessDeniedCategory + + if res.status_code == 400: + status_category = PNStatusCategory.PNBadRequestCategory + + if res.text is None: + text = "N/A" + else: + text = res.text + + if res.status_code >= 500: + err = PNERR_SERVER_ERROR + else: + err = PNERR_CLIENT_ERROR + try: + response = res.json() + except JSONDecodeError: + response = None + return Envelope( + result=None, + status=e_options.create_status( + category=status_category, + response=response, + response_info=response_info, + exception=PubNubException( + pn_error=err, + errormsg=text, + status_code=res.status_code + ))) + else: + if e_options.non_json_response: + response = res + else: + response = res.json() + + return Envelope( + result=e_options.create_response(response), + status=e_options.create_status( + category=PNStatusCategory.PNAcknowledgmentCategory, + response=response, + response_info=response_info, + exception=None + ) + ) + + def _invoke_request(self, p_options, e_options, base_origin): + assert isinstance(p_options, PlatformOptions) + assert isinstance(e_options, RequestOptions) + + if base_origin: + url = p_options.pn_config.scheme() + "://" + base_origin + e_options.path + else: + url = e_options.path + + if e_options.request_headers: + request_headers = {**p_options.headers, **e_options.request_headers} + else: + request_headers = p_options.headers + + args = { + "method": e_options.method_string, + "headers": request_headers, + "url": url, + "params": e_options.query_string, + "timeout": (e_options.connect_timeout, e_options.request_timeout), + "allow_redirects": e_options.allow_redirects + } + + if e_options.is_post() or e_options.is_patch(): + args["data"] = e_options.data + args["files"] = e_options.files + logger.debug("%s %s %s" % ( + e_options.method_string, + utils.build_url( + p_options.pn_config.scheme(), + base_origin, + e_options.path, + e_options.query_string), e_options.data)) + else: + logger.debug("%s %s" % ( + e_options.method_string, + utils.build_url( + p_options.pn_config.scheme(), + base_origin, + e_options.path, + e_options.query_string))) + + try: + res = self.session.request(**args) + logger.debug("GOT %s" % res.text) + except requests.exceptions.ConnectionError as e: + raise PubNubException( + pn_error=PNERR_CONNECTION_ERROR, + errormsg=str(e) + ) + except requests.exceptions.HTTPError as e: + raise PubNubException( + pn_error=PNERR_HTTP_ERROR, + errormsg=str(e) + ) + except requests.exceptions.Timeout as e: + raise PubNubException( + pn_error=PNERR_CLIENT_TIMEOUT, + errormsg=str(e) + ) + except requests.exceptions.TooManyRedirects as e: + raise PubNubException( + pn_error=PNERR_TOO_MANY_REDIRECTS_ERROR, + errormsg=str(e) + ) + except Exception as e: + raise PubNubException( + pn_error=PNERR_UNKNOWN_ERROR, + errormsg=str(e) + ) + + return res + + +class AsyncHTTPClient: + """A wrapper for threaded calls""" + + def __init__(self, callback_to_invoke): + self._callback_to_invoke = callback_to_invoke + + def run(self): + self._callback_to_invoke() + + +class Call(object): + """ + A platform dependent representation of async PubNub method call + """ + + def __init__(self): + self.thread = None + self.cancellation_event = None + self.is_executed = False + self.is_canceled = False + + def cancel(self): + """ + Set Event flag to stop thread on timeout. This will not stop thread immediately, it will stopped + only after ongoing request will be finished + :return: nothing + """ + if self.cancellation_event is not None: + self.cancellation_event.set() + self.is_canceled = True + + def join(self): + if isinstance(self.thread, threading.Thread): + self.thread.join() + + def executed_cb(self): + self.is_executed = True diff --git a/tests/integrational/asyncio/test_channel_groups.py b/tests/integrational/asyncio/test_channel_groups.py index 0d37da12..59eed591 100644 --- a/tests/integrational/asyncio/test_channel_groups.py +++ b/tests/integrational/asyncio/test_channel_groups.py @@ -4,7 +4,7 @@ from pubnub.models.consumer.channel_group import PNChannelGroupsAddChannelResult, PNChannelGroupsListResult, \ PNChannelGroupsRemoveChannelResult, PNChannelGroupsRemoveGroupResult from pubnub.pubnub_asyncio import PubNubAsyncio -from tests.helper import pnconf, pnconf_copy, pnconf_pam_copy +from tests.helper import pnconf_copy, pnconf_pam_copy from tests.integrational.vcr_asyncio_sleeper import get_sleeper from tests.integrational.vcr_helper import pn_vcr @@ -13,8 +13,8 @@ @pn_vcr.use_cassette('tests/integrational/fixtures/asyncio/groups/add_remove_single_channel.yaml', filter_query_parameters=['uuid', 'pnsdk', 'l_cg', 'l_pub']) @pytest.mark.asyncio -async def test_add_remove_single_channel(event_loop, sleeper=asyncio.sleep): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) +async def test_add_remove_single_channel(sleeper=asyncio.sleep, **kwargs): + pubnub = PubNubAsyncio(pnconf_copy()) pubnub.config.uuid = 'test-channel-group-asyncio-uuid1' ch = "test-channel-groups-asyncio-ch" @@ -58,8 +58,8 @@ async def test_add_remove_single_channel(event_loop, sleeper=asyncio.sleep): @pn_vcr.use_cassette('tests/integrational/fixtures/asyncio/groups/add_remove_multiple_channels.yaml', filter_query_parameters=['uuid', 'pnsdk', 'l_cg', 'l_pub']) @pytest.mark.asyncio -async def test_add_remove_multiple_channels(event_loop, sleeper=asyncio.sleep): - pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) +async def test_add_remove_multiple_channels(sleeper=asyncio.sleep, **kwargs): + pubnub = PubNubAsyncio(pnconf_copy()) ch1 = "channel-groups-tornado-ch1" ch2 = "channel-groups-tornado-ch2" @@ -100,8 +100,8 @@ async def test_add_remove_multiple_channels(event_loop, sleeper=asyncio.sleep): @pn_vcr.use_cassette('tests/integrational/fixtures/asyncio/groups/add_channel_remove_group.yaml', filter_query_parameters=['uuid', 'pnsdk', 'l_cg', 'l_pub']) @pytest.mark.asyncio -async def test_add_channel_remove_group(event_loop, sleeper=asyncio.sleep): - pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) +async def test_add_channel_remove_group(sleeper=asyncio.sleep, **kwargs): + pubnub = PubNubAsyncio(pnconf_copy()) ch = "channel-groups-tornado-ch" gr = "channel-groups-tornado-cg" @@ -136,8 +136,8 @@ async def test_add_channel_remove_group(event_loop, sleeper=asyncio.sleep): @pytest.mark.asyncio -async def test_super_call(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_super_call(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) ch = "channel-groups-torna|do-ch" gr = "channel-groups-torna|do-cg" diff --git a/tests/integrational/asyncio/test_file_upload.py b/tests/integrational/asyncio/test_file_upload.py index cd7d8c5c..957fb76d 100644 --- a/tests/integrational/asyncio/test_file_upload.py +++ b/tests/integrational/asyncio/test_file_upload.py @@ -106,10 +106,10 @@ async def test_send_and_download_file_encrypted_cipher_key(file_for_upload, file await pubnub.stop() -# @pn_vcr.use_cassette( -# "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", -# filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' -# ) +@pn_vcr.use_cassette( + "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", + filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' +) @pytest.mark.asyncio(loop_scope="module") async def test_send_and_download_encrypted_file_crypto_module(file_for_upload, file_upload_test_data): pubnub = PubNubAsyncio(pnconf_enc_env_copy()) diff --git a/tests/integrational/asyncio/test_fire.py b/tests/integrational/asyncio/test_fire.py index 9a9a513f..2b31a5d8 100644 --- a/tests/integrational/asyncio/test_fire.py +++ b/tests/integrational/asyncio/test_fire.py @@ -12,10 +12,10 @@ filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_single_channel(event_loop): +async def test_single_channel(): config = pnconf_env_copy() config.enable_subscribe = False - pn = PubNubAsyncio(config, custom_event_loop=event_loop) + pn = PubNubAsyncio(config) chan = 'unique_sync' envelope = await pn.fire().channel(chan).message('bla').future() diff --git a/tests/integrational/asyncio/test_here_now.py b/tests/integrational/asyncio/test_here_now.py index b5417ac8..acbdc2d5 100644 --- a/tests/integrational/asyncio/test_here_now.py +++ b/tests/integrational/asyncio/test_here_now.py @@ -147,7 +147,7 @@ async def test_global(): @pytest.mark.asyncio -async def test_here_now_super_call(event_loop): +async def test_here_now_super_call(): pubnub = PubNubAsyncio(pnconf_demo_copy()) pubnub.config.uuid = 'test-here-now-asyncio-uuid1' diff --git a/tests/integrational/asyncio/test_history_delete.py b/tests/integrational/asyncio/test_history_delete.py index 045dbea1..98a29657 100644 --- a/tests/integrational/asyncio/test_history_delete.py +++ b/tests/integrational/asyncio/test_history_delete.py @@ -10,8 +10,8 @@ filter_query_parameters=['uuid', 'pnsdk'] ) @pytest.mark.asyncio -async def test_success(event_loop): - pubnub = PubNubAsyncio(mocked_config_copy(), custom_event_loop=event_loop) +async def test_success(): + pubnub = PubNubAsyncio(mocked_config_copy()) res = await pubnub.delete_messages().channel("my-ch").start(123).end(456).future() @@ -26,8 +26,8 @@ async def test_success(event_loop): filter_query_parameters=['uuid', 'pnsdk'] ) @pytest.mark.asyncio -async def test_delete_with_space_and_wildcard_in_channel_name(event_loop): - pubnub = PubNubAsyncio(mocked_config_copy(), custom_event_loop=event_loop) +async def test_delete_with_space_and_wildcard_in_channel_name(): + pubnub = PubNubAsyncio(mocked_config_copy()) res = await pubnub.delete_messages().channel("my-ch- |.* $").start(123).end(456).future() diff --git a/tests/integrational/asyncio/test_invocations.py b/tests/integrational/asyncio/test_invocations.py index d62e07bb..13053e7c 100644 --- a/tests/integrational/asyncio/test_invocations.py +++ b/tests/integrational/asyncio/test_invocations.py @@ -22,8 +22,8 @@ filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_future(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) +async def test_publish_future(): + pubnub = PubNubAsyncio(pnconf_copy()) result = await pubnub.publish().message('hey').channel('blah').result() assert isinstance(result, PNPublishResult) @@ -35,8 +35,8 @@ async def test_publish_future(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_future_raises_pubnub_error(event_loop): - pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) +async def test_publish_future_raises_pubnub_error(): + pubnub = PubNubAsyncio(corrupted_keys) with pytest.raises(PubNubException) as exinfo: await pubnub.publish().message('hey').channel('blah').result() @@ -52,8 +52,8 @@ async def test_publish_future_raises_pubnub_error(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_future_raises_lower_level_error(event_loop): - pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) +async def test_publish_future_raises_lower_level_error(): + pubnub = PubNubAsyncio(corrupted_keys) pubnub._connector.close() @@ -70,8 +70,8 @@ async def test_publish_future_raises_lower_level_error(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_envelope(event_loop): - pubnub = PubNubAsyncio(pnconf_copy(), custom_event_loop=event_loop) +async def test_publish_envelope(): + pubnub = PubNubAsyncio(pnconf_copy()) envelope = await pubnub.publish().message('hey').channel('blah').future() assert isinstance(envelope, AsyncioEnvelope) assert not envelope.is_error() @@ -84,8 +84,8 @@ async def test_publish_envelope(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_envelope_raises(event_loop): - pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) +async def test_publish_envelope_raises(): + pubnub = PubNubAsyncio(corrupted_keys) e = await pubnub.publish().message('hey').channel('blah').future() assert isinstance(e, PubNubAsyncioException) assert e.is_error() @@ -99,8 +99,8 @@ async def test_publish_envelope_raises(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_envelope_raises_lower_level_error(event_loop): - pubnub = PubNubAsyncio(corrupted_keys, custom_event_loop=event_loop) +async def test_publish_envelope_raises_lower_level_error(): + pubnub = PubNubAsyncio(corrupted_keys) pubnub._connector.close() diff --git a/tests/integrational/asyncio/test_message_count.py b/tests/integrational/asyncio/test_message_count.py index bfbeba91..67171f18 100644 --- a/tests/integrational/asyncio/test_message_count.py +++ b/tests/integrational/asyncio/test_message_count.py @@ -13,7 +13,6 @@ def pn(event_loop): config.enable_subscribe = False pn = PubNubAsyncio(config, custom_event_loop=event_loop) yield pn - pn.stop() @pn_vcr.use_cassette( diff --git a/tests/integrational/asyncio/test_pam.py b/tests/integrational/asyncio/test_pam.py index 638728ed..697ae575 100644 --- a/tests/integrational/asyncio/test_pam.py +++ b/tests/integrational/asyncio/test_pam.py @@ -11,8 +11,8 @@ filter_query_parameters=['signature', 'timestamp', 'pnsdk', 'l_pam'] ) @pytest.mark.asyncio -async def test_global_level(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_global_level(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "my_uuid" env = await pubnub.grant().write(True).read(True).future() @@ -33,8 +33,8 @@ async def test_global_level(event_loop): filter_query_parameters=['signature', 'timestamp', 'pnsdk', 'l_pam'] ) @pytest.mark.asyncio -async def test_single_channel(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_single_channel(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "my_uuid" ch = "test-pam-asyncio-ch" @@ -54,8 +54,8 @@ async def test_single_channel(event_loop): filter_query_parameters=['signature', 'timestamp', 'pnsdk', 'l_pam'] ) @pytest.mark.asyncio -async def test_single_channel_with_auth(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_single_channel_with_auth(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "test-pam-asyncio-uuid" ch = "test-pam-asyncio-ch" auth = "test-pam-asyncio-auth" @@ -78,8 +78,8 @@ async def test_single_channel_with_auth(event_loop): ) @pytest.mark.asyncio -async def test_multiple_channels(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_multiple_channels(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "test-pam-asyncio-uuid" ch1 = "test-pam-asyncio-ch1" ch2 = "test-pam-asyncio-ch2" @@ -105,8 +105,8 @@ async def test_multiple_channels(event_loop): match_on=['method', 'scheme', 'host', 'port', 'path', 'string_list_in_query'] ) @pytest.mark.asyncio -async def test_multiple_channels_with_auth(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_multiple_channels_with_auth(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "my_uuid" ch1 = "test-pam-asyncio-ch1" ch2 = "test-pam-asyncio-ch2" @@ -132,8 +132,8 @@ async def test_multiple_channels_with_auth(event_loop): filter_query_parameters=['signature', 'timestamp', 'pnsdk', 'l_pam'] ) @pytest.mark.asyncio -async def test_single_channel_group(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_single_channel_group(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "test-pam-asyncio-uuid" cg = "test-pam-asyncio-cg" @@ -154,8 +154,8 @@ async def test_single_channel_group(event_loop): filter_query_parameters=['signature', 'timestamp', 'pnsdk', 'l_pam'] ) @pytest.mark.asyncio -async def test_single_channel_group_with_auth(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_single_channel_group_with_auth(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "test-pam-asyncio-uuid" gr = "test-pam-asyncio-cg" auth = "test-pam-asyncio-auth" @@ -178,8 +178,8 @@ async def test_single_channel_group_with_auth(event_loop): match_on=['method', 'scheme', 'host', 'port', 'path', 'string_list_in_query'], ) @pytest.mark.asyncio -async def test_multiple_channel_groups(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_multiple_channel_groups(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "my_uuid" gr1 = "test-pam-asyncio-cg1" gr2 = "test-pam-asyncio-cg2" @@ -205,8 +205,8 @@ async def test_multiple_channel_groups(event_loop): match_on=['method', 'scheme', 'host', 'port', 'path', 'string_list_in_query'], ) @pytest.mark.asyncio -async def test_multiple_channel_groups_with_auth(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop) +async def test_multiple_channel_groups_with_auth(): + pubnub = PubNubAsyncio(pnconf_pam_copy()) pubnub.config.uuid = "my_uuid" gr1 = "test-pam-asyncio-cg1" gr2 = "test-pam-asyncio-cg2" diff --git a/tests/integrational/asyncio/test_publish.py b/tests/integrational/asyncio/test_publish.py index 20867de9..f77f4e94 100644 --- a/tests/integrational/asyncio/test_publish.py +++ b/tests/integrational/asyncio/test_publish.py @@ -51,8 +51,8 @@ async def assert_success_publish_post(pubnub, msg): filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'] ) @pytest.mark.asyncio -async def test_publish_mixed_via_get(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_mixed_via_get(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await asyncio.gather( asyncio.ensure_future(assert_success_publish_get(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_get(pubnub, 5)), @@ -69,8 +69,8 @@ async def test_publish_mixed_via_get(event_loop): match_on=['method', 'scheme', 'host', 'port', 'object_in_path', 'query'] ) @pytest.mark.asyncio -async def test_publish_object_via_get(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_object_via_get(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await asyncio.ensure_future(assert_success_publish_get(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @@ -80,8 +80,8 @@ async def test_publish_object_via_get(event_loop): 'tests/integrational/fixtures/asyncio/publish/mixed_via_post.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio -async def test_publish_mixed_via_post(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_mixed_via_post(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await asyncio.gather( asyncio.ensure_future(assert_success_publish_post(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_post(pubnub, 5)), @@ -96,8 +96,8 @@ async def test_publish_mixed_via_post(event_loop): filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['method', 'scheme', 'host', 'port', 'path', 'query', 'object_in_body']) @pytest.mark.asyncio -async def test_publish_object_via_post(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_object_via_post(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await asyncio.ensure_future(assert_success_publish_post(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @@ -107,9 +107,9 @@ async def test_publish_object_via_post(event_loop): 'tests/integrational/fixtures/asyncio/publish/mixed_via_get_encrypted.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio -async def test_publish_mixed_via_get_encrypted(event_loop): +async def test_publish_mixed_via_get_encrypted(): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) await asyncio.gather( asyncio.ensure_future(assert_success_publish_get(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_get(pubnub, 5)), @@ -125,9 +125,9 @@ async def test_publish_mixed_via_get_encrypted(event_loop): match_on=['host', 'method', 'query'] ) @pytest.mark.asyncio -async def test_publish_object_via_get_encrypted(event_loop): +async def test_publish_object_via_get_encrypted(): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) await asyncio.ensure_future(assert_success_publish_get(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @@ -139,9 +139,9 @@ async def test_publish_object_via_get_encrypted(event_loop): match_on=['method', 'path', 'query', 'body'] ) @pytest.mark.asyncio -async def test_publish_mixed_via_post_encrypted(event_loop): +async def test_publish_mixed_via_post_encrypted(): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) await asyncio.gather( asyncio.ensure_future(assert_success_publish_post(pubnub, "hi")), asyncio.ensure_future(assert_success_publish_post(pubnub, 5)), @@ -158,33 +158,33 @@ async def test_publish_mixed_via_post_encrypted(event_loop): match_on=['method', 'path', 'query'] ) @pytest.mark.asyncio -async def test_publish_object_via_post_encrypted(event_loop): +async def test_publish_object_via_post_encrypted(): with patch("pubnub.crypto.PubNubCryptodome.get_initialization_vector", return_value="knightsofni12345"): - pubnub = PubNubAsyncio(pnconf_enc_env_copy(), custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf_enc_env_copy()) await asyncio.ensure_future(assert_success_publish_post(pubnub, {"name": "Alex", "online": True})) await pubnub.stop() @pytest.mark.asyncio -async def test_error_missing_message(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_error_missing_message(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await assert_client_side_error(pubnub.publish().channel(ch).message(None), "Message missing") await pubnub.stop() @pytest.mark.asyncio -async def test_error_missing_channel(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_error_missing_channel(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await assert_client_side_error(pubnub.publish().channel("").message("hey"), "Channel missing") await pubnub.stop() @pytest.mark.asyncio -async def test_error_non_serializable(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_error_non_serializable(): + pubnub = PubNubAsyncio(pnconf_env_copy()) def method(): pass @@ -198,8 +198,8 @@ def method(): filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature'], match_on=['host', 'method', 'path', 'meta_object_in_query']) @pytest.mark.asyncio -async def test_publish_with_meta(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_with_meta(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await assert_success_await(pubnub.publish().channel(ch).message("hey").meta({'a': 2, 'b': 'qwer'})) await pubnub.stop() @@ -209,8 +209,8 @@ async def test_publish_with_meta(event_loop): 'tests/integrational/fixtures/asyncio/publish/do_not_store.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio -async def test_publish_do_not_store(event_loop): - pubnub = PubNubAsyncio(pnconf_env_copy(), custom_event_loop=event_loop) +async def test_publish_do_not_store(): + pubnub = PubNubAsyncio(pnconf_env_copy()) await assert_success_await(pubnub.publish().channel(ch).message("hey").should_store(False)) await pubnub.stop() @@ -228,10 +228,10 @@ async def assert_server_side_error_yield(publish_builder, expected_err_msg): 'tests/integrational/fixtures/asyncio/publish/invalid_key.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio -async def test_error_invalid_key(event_loop): +async def test_error_invalid_key(): pnconf = pnconf_pam_env_copy() - pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf) await assert_server_side_error_yield(pubnub.publish().channel(ch).message("hey"), "Invalid Key") await pubnub.stop() @@ -241,18 +241,18 @@ async def test_error_invalid_key(event_loop): 'tests/integrational/fixtures/asyncio/publish/not_permitted.json', serializer='pn_json', filter_query_parameters=['uuid', 'seqn', 'signature', 'timestamp', 'pnsdk', 'l_pub', 'signature']) @pytest.mark.asyncio -async def test_not_permitted(event_loop): +async def test_not_permitted(): pnconf = pnconf_pam_env_copy() pnconf.secret_key = None - pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) + pubnub = PubNubAsyncio(pnconf) await assert_server_side_error_yield(pubnub.publish().channel(ch).message("hey"), "HTTP Client Error (403") await pubnub.stop() @pytest.mark.asyncio -async def test_publish_super_admin_call(event_loop): - pubnub = PubNubAsyncio(pnconf_pam_env_copy(), custom_event_loop=event_loop) +async def test_publish_super_admin_call(): + pubnub = PubNubAsyncio(pnconf_pam_env_copy()) await pubnub.publish().channel(ch).message("hey").future() await pubnub.publish().channel("f#!|oo.bar").message("hey^&#$").should_store(True).meta({ diff --git a/tests/integrational/asyncio/test_signal.py b/tests/integrational/asyncio/test_signal.py index 5527b8b4..eb58be69 100644 --- a/tests/integrational/asyncio/test_signal.py +++ b/tests/integrational/asyncio/test_signal.py @@ -12,8 +12,8 @@ filter_query_parameters=['uuid', 'seqn', 'pnsdk'] ) @pytest.mark.asyncio -async def test_single_channel(event_loop): - pn = PubNubAsyncio(pnconf_demo, custom_event_loop=event_loop) +async def test_single_channel(): + pn = PubNubAsyncio(pnconf_demo) chan = 'unique_sync' envelope = await pn.signal().channel(chan).message('test').future() diff --git a/tests/integrational/asyncio/test_ssl.py b/tests/integrational/asyncio/test_ssl.py index 53458a70..0bce1ecb 100644 --- a/tests/integrational/asyncio/test_ssl.py +++ b/tests/integrational/asyncio/test_ssl.py @@ -17,8 +17,8 @@ filter_query_parameters=['uuid', 'pnsdk'] ) @pytest.mark.asyncio -async def test_publish_string_via_get_encrypted(event_loop): - pubnub = PubNubAsyncio(pnconf_ssl_copy(), custom_event_loop=event_loop) +async def test_publish_string_via_get_encrypted(): + pubnub = PubNubAsyncio(pnconf_ssl_copy()) res = await pubnub.publish().channel(ch).message("hey").future() assert res.result.timetoken > 0 diff --git a/tests/integrational/asyncio/test_time.py b/tests/integrational/asyncio/test_time.py index ba1015f6..90d1847b 100644 --- a/tests/integrational/asyncio/test_time.py +++ b/tests/integrational/asyncio/test_time.py @@ -10,8 +10,8 @@ 'tests/integrational/fixtures/asyncio/time/get.yaml', filter_query_parameters=['uuid', 'pnsdk']) @pytest.mark.asyncio -async def test_time(event_loop): - pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop) +async def test_time(): + pubnub = PubNubAsyncio(pnconf) res = await pubnub.time().result() diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json index 7c751f43..9f739df2 100644 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json @@ -5,7 +5,9 @@ "request": { "method": "POST", "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", - "body": "{\"name\": \"king_arthur.txt\"}", + "body": { + "pickle": "gASVHwAAAAAAAACMG3sibmFtZSI6ICJraW5nX2FydGh1ci50eHQifZQu" + }, "headers": { "host": [ "ps.pndsn.com" @@ -37,7 +39,7 @@ }, "headers": { "Date": [ - "Mon, 09 Dec 2024 15:38:06 GMT" + "Thu, 12 Dec 2024 09:14:50 GMT" ], "Content-Type": [ "application/json" @@ -56,7 +58,7 @@ ] }, "body": { - "string": "{\"status\":200,\"data\":{\"id\":\"10964cc6-bb29-4d16-a99d-807d47790cb3\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-09T15:39:06Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/10964cc6-bb29-4d16-a99d-807d47790cb3/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241209/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241209T153906Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvMTA5NjRjYzYtYmIyOS00ZDE2LWE5OWQtODA3Z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YzNjgyZDk2ZGNhIn1dfX2Ucy4=" } } }, @@ -64,7 +66,9 @@ "request": { "method": "POST", "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", - "body": "tagging=&tagging=%3CTagging%3E%3CTagSet%3E%3CTag%3E%3CKey%3EObjectTTLInDays%3C%2FKey%3E%3CValue%3E1%3C%2FValue%3E%3C%2FTag%3E%3C%2FTagSet%3E%3C%2FTagging%3E&key=&key={PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2F10964cc6-bb29-4d16-a99d-807d47790cb3%2Fking_arthur.txt&Content-Type=&Content-Type=text%2Fplain%3B+charset%3Dutf-8&X-Amz-Credential=&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Security-Token=&X-Amz-Security-Token=&X-Amz-Algorithm=&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=&X-Amz-Date=20241209T153906Z&Policy=&Policy=CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMDlUMTU6Mzk6MDZaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc%2BPFRhZ1NldD48VGFnPjxLZXk%2BT2JqZWN0VFRMSW5EYXlzPC9LZXk%2BPFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvMTA5NjRjYzYtYmIyOS00ZDE2LWE5OWQ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mU3dLQ1FsN0luZ3RZVzE2TFhObFkzVnlhWFI1TFhSdmEyVnVJam9nSWlKOUxBb0pDWHNpZUMxaGJYb3RZV3huYjNKcGRHaHRJam9nSWtGWFV6UXRTRTFCUXkxVFNFRXlOVFlpZlN3S0NRbDdJbmd0WVcxNkxXUmhkR1VpT2lBaU1qQXlOREV5TVRKVU1Ea3hOVFV3V2lJZ2ZRb0pYUXA5Q2c9PQ0KLS02MWUxZGIzMjkxMjRlYWMzZDljZDUxZTA1ZDc5ZmVjNg0KQ29udGVudC1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJYLUFtei1TaWduYXR1cmUiDQoNCjc0ZjM4Njk2OGIyMjM3MjMwZDNlNzBlZjhjNmZjZmYxNTk5ZGE2NzUzOTBlNWRiOTZmMTQ5NjM2ODJkOTZkY2ENCi0tNjFlMWRiMzI5MTI0ZWFjM2Q5Y2Q1MWUwNWQ3OWZlYzYNCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJraW5nX2FydGh1ci50eHQiDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCg0Ka25pZ2h0c29mbmkxMjM0Nd3WHvboSWGHoxDxAj/QBWeHxa2TkqtdjiT9hyP80QImDQotLTYxZTFkYjMyOTEyNGVhYzNkOWNkNTFlMDVkNzlmZWM2LS0NCpQu" + }, "headers": { "host": [ "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" @@ -82,43 +86,238 @@ "PubNub-Python-Asyncio/9.1.0" ], "content-length": [ - "1841" + "2358" ], "content-type": [ - "application/x-www-form-urlencoded" + "multipart/form-data; boundary=61e1db329124eac3d9cd51e05d79fec6" ] } }, "response": { "status": { - "code": 400, - "message": "Bad Request" + "code": 204, + "message": "No Content" }, "headers": { + "x-amz-id-2": [ + "CzkNToRWTdvhay1h7KRrZVWLn5A7RmjsEkKBYgElXdL9RlHk/mZJ97dtlrQ2xCe7Q4I/jcyoA5E=" + ], "x-amz-request-id": [ - "45FBTK5ZK0HWSPE3" + "SSV0VCG2GKKM0QG5" ], - "x-amz-id-2": [ - "FpJ4LZGyVNHgWbR70beRKQ+j7tqUgucrZbbjzVLNg0tEvotzM5R4hfLZ/TIl3Lv/Eb4AG6RbVLU=" + "Date": [ + "Thu, 12 Dec 2024 09:14:51 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Sat, 14 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "ETag": [ + "\"3b28a7860336af6c6162621e650c0d0f\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fb32db05b-b3e6-4530-8b9b-bb01494f8eae%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%22a25pZ2h0c29mbmkxMjM0NRV4jkZbYJKJpBh%2Ffy8gkkKwgHzJoLg%2FKPi4WjFBAQgYCqObP0j7BPevaNiSqFIQ%2Fyk0%2BYCdZpjyci2AeutbmGRudJBMlaZQEU10pZMiCDGZz1dIrZYjMhyDDpUJUo0wtYy91qz8QGtR%2FJCbXpE%2F4%2FQqsjYEnJ64Y9q7G%2B%2FtAWQD%22?meta=null&store=1&ttl=222", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Thu, 12 Dec 2024 09:14:51 GMT" ], "Content-Type": [ - "application/xml" + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVLgAAAAAAAAB9lIwGc3RyaW5nlIweWzEsIlNlbnQiLCIxNzMzOTk0ODkxMTM5NzMwNyJdlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/b32db05b-b3e6-4530-8b9b-bb01494f8eae/king_arthur.txt", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" ], - "Transfer-Encoding": [ - "chunked" + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { "Date": [ - "Mon, 09 Dec 2024 15:38:05 GMT" + "Thu, 12 Dec 2024 09:14:51 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=2949, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/b32db05b-b3e6-4530-8b9b-bb01494f8eae/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241212%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241212T090000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=f894b5ed95aa68299207f4a33f06ee60650751ae2979a7b5f41e2be621eab580" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/b32db05b-b3e6-4530-8b9b-bb01494f8eae/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241212%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241212T090000Z&X-Amz-Expires=3900&X-Amz-Signature=f894b5ed95aa68299207f4a33f06ee60650751ae2979a7b5f41e2be621eab580&X-Amz-SignedHeaders=host", + "body": "", + "headers": { + "host": [ + "files-us-east-1.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/plain; charset=utf-8" + ], + "Content-Length": [ + "48" ], "Connection": [ - "close" + "keep-alive" + ], + "Date": [ + "Thu, 12 Dec 2024 09:14:53 GMT" + ], + "Last-Modified": [ + "Thu, 12 Dec 2024 09:14:51 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Sat, 14 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "ETag": [ + "\"3b28a7860336af6c6162621e650c0d0f\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Accept-Ranges": [ + "bytes" ], "Server": [ "AmazonS3" + ], + "X-Cache": [ + "Miss from cloudfront" + ], + "Via": [ + "1.1 33b871000011afaf6969997fc8fcc060.cloudfront.net (CloudFront)" + ], + "X-Amz-Cf-Pop": [ + "SFO5-P3" + ], + "X-Amz-Cf-Id": [ + "6K96qs-bg5Qyi2hjyIQy6JPC3TL25OvcKGqPa1R0ydzAGCz4MRzOAg==" ] }, "body": { - "string": "\nAuthorizationQueryParametersErrorX-Amz-Algorithm only supports \"AWS4-HMAC-SHA256 and AWS4-ECDSA-P256-SHA256\"45FBTK5ZK0HWSPE3FpJ4LZGyVNHgWbR70beRKQ+j7tqUgucrZbbjzVLNg0tEvotzM5R4hfLZ/TIl3Lv/Eb4AG6RbVLU=" + "pickle": "gASVQAAAAAAAAAB9lIwGc3RyaW5nlEMwa25pZ2h0c29mbmkxMjM0Nd3WHvboSWGHoxDxAj/QBWeHxa2TkqtdjiT9hyP80QImlHMu" } } } diff --git a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json index 0d5d7606..47787482 100644 --- a/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json +++ b/tests/integrational/fixtures/asyncio/file_upload/send_and_download_file.json @@ -121,6 +121,322 @@ "string": "\nAuthorizationQueryParametersErrorX-Amz-Algorithm only supports \"AWS4-HMAC-SHA256 and AWS4-ECDSA-P256-SHA256\"BP3G8C294E7HAKNJzMeim2dB+COXRwPdjzh3SS6Y3cfSyojyXb7z67As/oXDVVDxWTIABZCeEXnSOV5ws+10nRrYiJA=" } } + }, + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/generate-upload-url", + "body": "{\"name\": \"king_arthur.txt\"}", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "content-type": [ + "application/json" + ], + "content-length": [ + "27" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 13:43:35 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "{\"status\":200,\"data\":{\"id\":\"c2d3cc93-5813-4191-8bec-7d210d66c4f2\",\"name\":\"king_arthur.txt\"},\"file_upload_request\":{\"url\":\"https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/\",\"method\":\"POST\",\"expiration_date\":\"2024-12-11T13:44:35Z\",\"form_fields\":[{\"key\":\"tagging\",\"value\":\"\\u003cTagging\\u003e\\u003cTagSet\\u003e\\u003cTag\\u003e\\u003cKey\\u003eObjectTTLInDays\\u003c/Key\\u003e\\u003cValue\\u003e1\\u003c/Value\\u003e\\u003c/Tag\\u003e\\u003c/TagSet\\u003e\\u003c/Tagging\\u003e\"},{\"key\":\"key\",\"value\":\"{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/c2d3cc93-5813-4191-8bec-7d210d66c4f2/king_arthur.txt\"},{\"key\":\"Content-Type\",\"value\":\"text/plain; charset=utf-8\"},{\"key\":\"X-Amz-Credential\",\"value\":\"AKIAY7AU6GQDV5LCPVEX/20241211/us-east-1/s3/aws4_request\"},{\"key\":\"X-Amz-Security-Token\",\"value\":\"\"},{\"key\":\"X-Amz-Algorithm\",\"value\":\"AWS4-HMAC-SHA256\"},{\"key\":\"X-Amz-Date\",\"value\":\"20241211T134435Z\"},{\"key\":\"Policy\",\"value\":\"CnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMTFUMTM6NDQ6MzVaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYzJkM2NjOTMtNTgxMy00MTkxLThiZWMtN2QyMTBkNjZjNGYyL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjExL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMTFUMTM0NDM1WiIgfQoJXQp9Cg==\"},{\"key\":\"X-Amz-Signature\",\"value\":\"4ab85ea548c2bb97eab49565d34bd8c8a4535d22a7df6755dfda7f5a37dc68f9\"}]}}" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/", + "body": "--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"tagging\"\r\n\r\nObjectTTLInDays1\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"key\"\r\n\r\n{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/c2d3cc93-5813-4191-8bec-7d210d66c4f2/king_arthur.txt\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"Content-Type\"\r\n\r\ntext/plain; charset=utf-8\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"X-Amz-Credential\"\r\n\r\nAKIAY7AU6GQDV5LCPVEX/20241211/us-east-1/s3/aws4_request\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"X-Amz-Security-Token\"\r\n\r\n\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"X-Amz-Algorithm\"\r\n\r\nAWS4-HMAC-SHA256\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"X-Amz-Date\"\r\n\r\n20241211T134435Z\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"Policy\"\r\n\r\nCnsKCSJleHBpcmF0aW9uIjogIjIwMjQtMTItMTFUMTM6NDQ6MzVaIiwKCSJjb25kaXRpb25zIjogWwoJCXsiYnVja2V0IjogInB1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZCJ9LAoJCVsiZXEiLCAiJHRhZ2dpbmciLCAiPFRhZ2dpbmc+PFRhZ1NldD48VGFnPjxLZXk+T2JqZWN0VFRMSW5EYXlzPC9LZXk+PFZhbHVlPjE8L1ZhbHVlPjwvVGFnPjwvVGFnU2V0PjwvVGFnZ2luZz4iXSwKCQlbImVxIiwgIiRrZXkiLCAic3ViLWMtZDBiOGU1NDItMTJhMC00MWM0LTk5OWYtYTJkNTY5ZGM0MjU1LzBNUjEtejJ3MG5TSll4d0V5NzRwNVFqVjg1VG1nTkJLUHJWNzF0NTVOVDAvYzJkM2NjOTMtNTgxMy00MTkxLThiZWMtN2QyMTBkNjZjNGYyL2tpbmdfYXJ0aHVyLnR4dCJdLAoJCVsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCA1MjQyODgwXSwKCQlbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAiIl0sCgkJeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUFZN0FVNkdRRFY1TENQVkVYLzIwMjQxMjExL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKCQl7IngtYW16LXNlY3VyaXR5LXRva2VuIjogIiJ9LAoJCXsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKCQl7IngtYW16LWRhdGUiOiAiMjAyNDEyMTFUMTM0NDM1WiIgfQoJXQp9Cg==\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"X-Amz-Signature\"\r\n\r\n4ab85ea548c2bb97eab49565d34bd8c8a4535d22a7df6755dfda7f5a37dc68f9\r\n--2876c0687f6bb887121f13da41e6a26c\r\nContent-Disposition: form-data; name=\"file\"; filename=\"king_arthur.txt\"\r\nContent-Type: text/plain\r\n\r\nKnights who say Ni!\r\n--2876c0687f6bb887121f13da41e6a26c--\r\n", + "headers": { + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ], + "content-length": [ + "2329" + ], + "content-type": [ + "multipart/form-data; boundary=2876c0687f6bb887121f13da41e6a26c" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "53BiVvwuJD3G8bOBlm4U/vzgEkgh+pYb+3wOp/yFkEso9Bkyk+yFIupAD32rnngeA+a+SQySGrY=" + ], + "x-amz-request-id": [ + "5JWZWYRR0FFK6F2E" + ], + "Date": [ + "Wed, 11 Dec 2024 13:43:37 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "ETag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2F0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0%2Fc2d3cc93-5813-4191-8bec-7d210d66c4f2%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_asyncio_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22c2d3cc93-5813-4191-8bec-7d210d66c4f2%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 13:43:36 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "[1,\"Sent\",\"17339246164989106\"]" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_asyncio_ch/files/c2d3cc93-5813-4191-8bec-7d210d66c4f2/king_arthur.txt", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 13:43:36 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=1224, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/c2d3cc93-5813-4191-8bec-7d210d66c4f2/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T130000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=31281924b6e28335906e7d7cc7cc65c3278eda6f2b7a177fc9a6967329265156" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "string": "" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/0MR1-z2w0nSJYxwEy74p5QjV85TmgNBKPrV71t55NT0/c2d3cc93-5813-4191-8bec-7d210d66c4f2/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T130000Z&X-Amz-Expires=3900&X-Amz-Signature=31281924b6e28335906e7d7cc7cc65c3278eda6f2b7a177fc9a6967329265156&X-Amz-SignedHeaders=host", + "body": "", + "headers": { + "host": [ + "files-us-east-1.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python-Asyncio/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/plain; charset=utf-8" + ], + "Content-Length": [ + "19" + ], + "Connection": [ + "keep-alive" + ], + "Date": [ + "Wed, 11 Dec 2024 13:43:38 GMT" + ], + "Last-Modified": [ + "Wed, 11 Dec 2024 13:43:37 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "ETag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Accept-Ranges": [ + "bytes" + ], + "Server": [ + "AmazonS3" + ], + "X-Cache": [ + "Miss from cloudfront" + ], + "Via": [ + "1.1 9d27737697c14182077f1e9321735940.cloudfront.net (CloudFront)" + ], + "X-Amz-Cf-Pop": [ + "SFO5-P3" + ], + "X-Amz-Cf-Id": [ + "yYn-zPjZhNMM9iBpFaG-QYFKkbySONqdzHjx6zELxejn59lNWxB63A==" + ] + }, + "body": { + "string": "Knights who say Ni!" + } + } } ] } diff --git a/tests/integrational/fixtures/native_sync/file_upload/list_files.json b/tests/integrational/fixtures/native_sync/file_upload/list_files.json new file mode 100644 index 00000000..3183220a --- /dev/null +++ b/tests/integrational/fixtures/native_sync/file_upload/list_files.json @@ -0,0 +1,111 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files?uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:05:29 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "159" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVrwAAAAAAAAB9lIwGc3RyaW5nlIyfeyJzdGF0dXMiOjIwMCwiZGF0YSI6W3sibmFtZSI6ImtpbmdfYXJ0aHVyLnR4dCIsImlkIjoiZmY3MmY1OTktNmQ5MS00YWY2LWFkZDYtNGU3MjFiZGVkYzkwIiwic2l6ZSI6NDgsImNyZWF0ZWQiOiIyMDI0LTEyLTExVDEzOjIyOjEzWiJ9XSwibmV4dCI6bnVsbCwiY291bnQiOjF9lHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files?uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:05:30 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "159" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVrwAAAAAAAAB9lIwGc3RyaW5nlIyfeyJzdGF0dXMiOjIwMCwiZGF0YSI6W3sibmFtZSI6ImtpbmdfYXJ0aHVyLnR4dCIsImlkIjoiZmY3MmY1OTktNmQ5MS00YWY2LWFkZDYtNGU3MjFiZGVkYzkwIiwic2l6ZSI6NDgsImNyZWF0ZWQiOiIyMDI0LTEyLTExVDEzOjIyOjEzWiJ9XSwibmV4dCI6bnVsbCwiY291bnQiOjF9lHMu" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_custom_type.json b/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_custom_type.json new file mode 100644 index 00000000..b70d9957 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_custom_type.json @@ -0,0 +1,64 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%222222%22%2C%20%22name%22%3A%20%22test%22%7D%7D?custom_message_type=test_message&meta=%7B%7D&store=0&ttl=0&uuid=uuid-mock", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:00:04 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVLgAAAAAAAAB9lIwGc3RyaW5nlIweWzEsIlNlbnQiLCIxNzMzOTQwMDA0NzgzMTU4NSJdlHMu" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file.json b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file.json new file mode 100644 index 00000000..bc0b8821 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file.json @@ -0,0 +1,325 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid", + "body": { + "pickle": "gASVHwAAAAAAAACMG3sibmFtZSI6ICJraW5nX2FydGh1ci50eHQifZQu" + }, + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ], + "content-type": [ + "application/json" + ], + "content-length": [ + "27" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:34 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASV0QcAAAAAAAB9lIwGc3RyaW5nlFi+BwAAeyJzdGF0dXMiOjIwMCwiZGF0YSI6eyJpZCI6ImViZTYzODk1LWVlZmItNGIzYS1iMWM5LTdmNjUwMzZjZmM1NCIsIm5hbWUiOiJraW5nX2FydGh1ci50eHQifSwiZmlsZV91cGxvYWRfcmVxdWVzdCI6eyJ1cmwiOiJodHRwczovL3B1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZC5zMy5kdWFsc3RhY2sudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vIiwibWV0aG9kIjoiUE9TVCIsImV4cGlyYXRpb25fZGF0ZSI6IjIwMjQtMTItMTFUMTg6MTA6MzRaIiwiZm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ZmE5ZjEwZjI4YTI1NDVmZGNmZjVhZDU4MzgNCi0tYzhmM2E3ODFiY2NkODA3ZGQzMWRjNzdiMDNkMjJhMGYNCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJraW5nX2FydGh1ci50eHQiDQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW4NCg0KREWuym67nuVjBCNZjphL+Z370w1rl4BqzO46IemrhzYdR8wt/BuPP2+ln3puUGyJDQotLWM4ZjNhNzgxYmNjZDgwN2RkMzFkYzc3YjAzZDIyYTBmLS0NCpQu" + }, + "headers": { + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ], + "content-length": [ + "2358" + ], + "content-type": [ + "multipart/form-data; boundary=c8f3a781bccd807dd31dc77b03d22a0f" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "8fc1Vq/xhadzRf738YxDz092BrVVm5WppIWtWGHp/H0q/9NV45cZsx/8Dn8WidracRhCZ5CUZ5s=" + ], + "x-amz-request-id": [ + "ERF2JDZK7A8VTG35" + ], + "Date": [ + "Wed, 11 Dec 2024 18:09:36 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "ETag": [ + "\"bf4d8ce78234cc7e984a5ca6ad6dc641\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2Febe63895-eefb-4b3a-b1c9-7f65036cfc54%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%22xaV64cWsa2P3j5u5piKvm%2FbdHdLnqJ9P8kAsuQ7tehjctPjw2ctuX4JiyomF8bbGdjOle0mVKkoQXOAotxpwhWMBeQWVHx%2FiwU1LWfxjoXCD9CB%2BJKf6Bsep8TUZRkjHAitmDtigGGXTTh8iTEg437rfTftA%2BGjKwkehoXbcRkpidsCzMeMyqTL6yB5dsd8g%22?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:35 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVLgAAAAAAAAB9lIwGc3RyaW5nlIweWzEsIlNlbnQiLCIxNzMzOTQwNTc1NDc3NTA1NiJdlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files/ebe63895-eefb-4b3a-b1c9-7f65036cfc54/king_arthur.txt?uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:35 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=3265, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/ebe63895-eefb-4b3a-b1c9-7f65036cfc54/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T180000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=a60a6ce22d6785a958fb2317f9b55d8f523362eba5a5a079f2992df13b499e81" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/ebe63895-eefb-4b3a-b1c9-7f65036cfc54/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T180000Z&X-Amz-Expires=3900&X-Amz-Signature=a60a6ce22d6785a958fb2317f9b55d8f523362eba5a5a079f2992df13b499e81&X-Amz-SignedHeaders=host", + "body": "", + "headers": { + "host": [ + "files-us-east-1.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/plain; charset=utf-8" + ], + "Content-Length": [ + "48" + ], + "Connection": [ + "keep-alive" + ], + "Date": [ + "Wed, 11 Dec 2024 18:09:36 GMT" + ], + "Last-Modified": [ + "Wed, 11 Dec 2024 18:09:36 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "ETag": [ + "\"bf4d8ce78234cc7e984a5ca6ad6dc641\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Accept-Ranges": [ + "bytes" + ], + "Server": [ + "AmazonS3" + ], + "X-Cache": [ + "Miss from cloudfront" + ], + "Via": [ + "1.1 a44d1ad097088acd1fcfb2c987944ab8.cloudfront.net (CloudFront)" + ], + "X-Amz-Cf-Pop": [ + "MRS52-C1" + ], + "X-Amz-Cf-Id": [ + "Qy9rpgmy00XsdVoVbZ-PT3mizm0bPS-LUBigjjuqsDYFd9daW0J8GQ==" + ] + }, + "body": { + "pickle": "gASVQAAAAAAAAAB9lIwGc3RyaW5nlEMwREWuym67nuVjBCNZjphL+Z370w1rl4BqzO46IemrhzYdR8wt/BuPP2+ln3puUGyJlHMu" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json new file mode 100644 index 00000000..0a096440 --- /dev/null +++ b/tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json @@ -0,0 +1,325 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/generate-upload-url?uuid=files_native_sync_uuid", + "body": { + "pickle": "gASVHwAAAAAAAACMG3sibmFtZSI6ICJraW5nX2FydGh1ci50eHQifZQu" + }, + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ], + "content-type": [ + "application/json" + ], + "content-length": [ + "27" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:02 GMT" + ], + "Content-Type": [ + "application/json" + ], + "Content-Length": [ + "1982" + ], + "Connection": [ + "keep-alive" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASV0QcAAAAAAAB9lIwGc3RyaW5nlFi+BwAAeyJzdGF0dXMiOjIwMCwiZGF0YSI6eyJpZCI6ImNmNWMwOTdkLWMzMDEtNGU5NS04NmFjLWFkYWY3MmMxNzNmZSIsIm5hbWUiOiJraW5nX2FydGh1ci50eHQifSwiZmlsZV91cGxvYWRfcmVxdWVzdCI6eyJ1cmwiOiJodHRwczovL3B1Ym51Yi1tbmVtb3N5bmUtZmlsZXMtdXMtZWFzdC0xLXByZC5zMy5kdWFsc3RhY2sudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vIiwibWV0aG9kIjoiUE9TVCIsImV4cGlyYXRpb25fZGF0ZSI6IjIwMjQtMTItMTFUMTg6MTA6MDJaIiwiZm9ybV9maWVsZHMiOlt7ImtleSI6InRhZ2dpbmciLCJ2YWx1ZSI6Ilx1MDAzY1RhZ2dpbmdcdTAwM2VcdTAwM2NUYWdTZXRcdTAwM2VcdTAwM2NUYWdcdTAwM2VcdTAwM2NLZXlcdTAwM2VPYmplY3RUVExJbkRheXNcdTAwM2MvS2V5XHUwMDNlXHUwMDNjVmFsdWVcdTAwM2UxXHUwMDNjL1ZhbHVlXHUwMDNlX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y2VlNGY1YjI1OGY4Yi0tDQqULg==" + }, + "headers": { + "host": [ + "pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ], + "content-length": [ + "2329" + ], + "content-type": [ + "multipart/form-data; boundary=802ae8f7453b3219718cee4f5b258f8b" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "x-amz-id-2": [ + "fV5MzRnZKaf6N20hgK1u/NDp8LJHLYE/39ZoxyNm3kmc13HBpCGAzuySWZ29vYd4Qy+aXNUvj5k=" + ], + "x-amz-request-id": [ + "BQ2ZJCE1H7YXJ87D" + ], + "Date": [ + "Wed, 11 Dec 2024 18:09:04 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "ETag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "Location": [ + "https://pubnub-mnemosyne-files-us-east-1-prd.s3.dualstack.us-east-1.amazonaws.com/{PN_KEY_SUBSCRIBE}%2Ff-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ%2Fcf5c097d-c301-4e95-86ac-adaf72c173fe%2Fking_arthur.txt" + ], + "Server": [ + "AmazonS3" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/publish-file/{PN_KEY_PUBLISH}/{PN_KEY_SUBSCRIBE}/0/files_native_sync_ch/0/%7B%22message%22%3A%20%7B%22test_message%22%3A%20%22test%22%7D%2C%20%22file%22%3A%20%7B%22id%22%3A%20%22cf5c097d-c301-4e95-86ac-adaf72c173fe%22%2C%20%22name%22%3A%20%22king_arthur.txt%22%7D%7D?meta=null&store=1&ttl=222&uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:03 GMT" + ], + "Content-Type": [ + "text/javascript; charset=\"UTF-8\"" + ], + "Content-Length": [ + "30" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "no-cache" + ], + "Access-Control-Allow-Methods": [ + "GET" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVLgAAAAAAAAB9lIwGc3RyaW5nlIweWzEsIlNlbnQiLCIxNzMzOTQwNTQzMTM4MTIyMiJdlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://ps.pndsn.com/v1/files/{PN_KEY_SUBSCRIBE}/channels/files_native_sync_ch/files/cf5c097d-c301-4e95-86ac-adaf72c173fe/king_arthur.txt?uuid=files_native_sync_uuid", + "body": "", + "headers": { + "host": [ + "ps.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 307, + "message": "Temporary Redirect" + }, + "headers": { + "Date": [ + "Wed, 11 Dec 2024 18:09:03 GMT" + ], + "Content-Length": [ + "0" + ], + "Connection": [ + "keep-alive" + ], + "Cache-Control": [ + "public, max-age=3297, immutable" + ], + "Location": [ + "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/cf5c097d-c301-4e95-86ac-adaf72c173fe/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T180000Z&X-Amz-Expires=3900&X-Amz-SignedHeaders=host&X-Amz-Signature=3824c1c7fc58f5b8081736b0682927dc3295a34f49cc8979739fa2fea961dfd8" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Access-Control-Expose-Headers": [ + "*" + ] + }, + "body": { + "pickle": "gASVEAAAAAAAAAB9lIwGc3RyaW5nlIwAlHMu" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://files-us-east-1.pndsn.com/{PN_KEY_SUBSCRIBE}/f-tIAcNXJO9m81fWVV_o-fSQ-veupNrTloVAUPbeUQQ/cf5c097d-c301-4e95-86ac-adaf72c173fe/king_arthur.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAY7AU6GQDV5LCPVEX%2F20241211%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241211T180000Z&X-Amz-Expires=3900&X-Amz-Signature=3824c1c7fc58f5b8081736b0682927dc3295a34f49cc8979739fa2fea961dfd8&X-Amz-SignedHeaders=host", + "body": "", + "headers": { + "host": [ + "files-us-east-1.pndsn.com" + ], + "accept": [ + "*/*" + ], + "accept-encoding": [ + "gzip, deflate" + ], + "connection": [ + "keep-alive" + ], + "user-agent": [ + "PubNub-Python/9.1.0" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "text/plain; charset=utf-8" + ], + "Content-Length": [ + "19" + ], + "Connection": [ + "keep-alive" + ], + "Date": [ + "Wed, 11 Dec 2024 18:09:04 GMT" + ], + "Last-Modified": [ + "Wed, 11 Dec 2024 18:09:04 GMT" + ], + "x-amz-expiration": [ + "expiry-date=\"Fri, 13 Dec 2024 00:00:00 GMT\", rule-id=\"Archive file 1 day after creation\"" + ], + "ETag": [ + "\"3676cdb7a927db43c846070c4e7606c7\"" + ], + "x-amz-server-side-encryption": [ + "AES256" + ], + "Accept-Ranges": [ + "bytes" + ], + "Server": [ + "AmazonS3" + ], + "X-Cache": [ + "Miss from cloudfront" + ], + "Via": [ + "1.1 a44d1ad097088acd1fcfb2c987944ab8.cloudfront.net (CloudFront)" + ], + "X-Amz-Cf-Pop": [ + "MRS52-C1" + ], + "X-Amz-Cf-Id": [ + "3C2JK-vEpWXvubW2yarshDe4ZIjeFHByRyoXqjOW0geUqR_LoEMCjg==" + ] + }, + "body": { + "pickle": "gASVIwAAAAAAAAB9lIwGc3RyaW5nlIwTS25pZ2h0cyB3aG8gc2F5IE5pIZRzLg==" + } + } + } + ] +} diff --git a/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json index d12949f1..9a526f2c 100644 --- a/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json +++ b/tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json @@ -31,7 +31,7 @@ }, "headers": { "Date": [ - "Fri, 06 Dec 2024 23:08:26 GMT" + "Wed, 11 Dec 2024 17:59:14 GMT" ], "Content-Type": [ "text/javascript; charset=\"UTF-8\"" @@ -56,7 +56,7 @@ ] }, "body": { - "string": "[1,\"Sent\",\"17335265062074045\"]" + "pickle": "gASVLgAAAAAAAAB9lIwGc3RyaW5nlIweWzEsIlNlbnQiLCIxNzMzOTM5OTU0MzQxMTU2OCJdlHMu" } } } diff --git a/tests/integrational/native_sync/test_file_upload.py b/tests/integrational/native_sync/test_file_upload.py index 620e0ad9..cad6c475 100644 --- a/tests/integrational/native_sync/test_file_upload.py +++ b/tests/integrational/native_sync/test_file_upload.py @@ -51,23 +51,17 @@ def send_file(file_for_upload, cipher_key=None, pass_binary=False, timetoken_ove return envelope -# @pn_vcr.use_cassette( -# "tests/integrational/fixtures/native_sync/file_upload/delete_all_files.json", serializer="pn_json", -# filter_query_parameters=('pnsdk',) -# ) -def test_delete_all_files(file_upload_test_data): +@pn_vcr.use_cassette( + "tests/integrational/fixtures/native_sync/file_upload/list_files.json", serializer="pn_json", + filter_query_parameters=('pnsdk',) +) +def test_list_files(file_upload_test_data): envelope = pubnub.list_files().channel(CHANNEL).sync() files = envelope.result.data for i in range(len(files) - 1): file = files[i] pubnub.delete_file().channel(CHANNEL).file_id(file["id"]).file_name(file["name"]).sync() - -# @pn_vcr.use_cassette( -# "tests/integrational/fixtures/native_sync/file_upload/list_files.json", serializer="pn_json", -# filter_query_parameters=('pnsdk',) -# ) -def test_list_files(file_upload_test_data): envelope = pubnub.list_files().channel(CHANNEL).sync() assert isinstance(envelope.result, PNGetFilesResult) @@ -75,10 +69,10 @@ def test_list_files(file_upload_test_data): assert file_upload_test_data["UPLOADED_FILENAME"] == envelope.result.data[0]["name"] -# @pn_vcr.use_cassette( -# "tests/integrational/fixtures/native_sync/file_upload/download_file.json", serializer="pn_json", -# filter_query_parameters=('pnsdk',) -# ) +@pn_vcr.use_cassette( + "tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json", + filter_query_parameters=('pnsdk',), serializer="pn_json" +) def test_send_and_download_file_using_bytes_object(file_for_upload, file_upload_test_data): envelope = send_file(file_for_upload, pass_binary=True) @@ -93,8 +87,8 @@ def test_send_and_download_file_using_bytes_object(file_for_upload, file_upload_ # @pn_vcr.use_cassette( -# "tests/integrational/fixtures/native_sync/file_upload/download_file_encrypted.json", serializer="pn_json", -# filter_query_parameters=('pnsdk',) +# "tests/integrational/fixtures/native_sync/file_upload/send_and_download_encrypted_file.json", +# filter_query_parameters=('pnsdk',), serializer="pn_json" # ) def test_send_and_download_encrypted_file(file_for_upload, file_upload_test_data): cipher_key = "silly_walk" @@ -299,9 +293,9 @@ def test_send_and_download_encrypted_file_fallback_decode(file_for_upload, file_ assert data == bytes(file_upload_test_data["FILE_CONTENT"], "utf-8") -def test_publish_file_with_custom_type(): +def test_publish_file_message_with_custom_type(): with pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/test_publish_file_with_custom_type.json", + "tests/integrational/fixtures/native_sync/file_upload/publish_file_message_with_custom_type.json", filter_query_parameters=('pnsdk',), serializer='pn_json') as cassette: pubnub = PubNub(pnconf_env_copy()) diff --git a/tests/integrational/vcr_helper.py b/tests/integrational/vcr_helper.py index 57f57163..5ea55179 100644 --- a/tests/integrational/vcr_helper.py +++ b/tests/integrational/vcr_helper.py @@ -17,7 +17,7 @@ def remove_request_body(request): pn_vcr = vcr.VCR( - cassette_library_dir=vcr_dir + cassette_library_dir=vcr_dir, ) pn_vcr_with_empty_body_request = vcr.VCR( diff --git a/tests/integrational/vcr_serializer.py b/tests/integrational/vcr_serializer.py index e998a107..a8807b70 100644 --- a/tests/integrational/vcr_serializer.py +++ b/tests/integrational/vcr_serializer.py @@ -2,6 +2,7 @@ import re from base64 import b64decode, b64encode from vcr.serializers.jsonserializer import serialize, deserialize +from pickle import dumps, loads class PNSerializer: @@ -23,12 +24,12 @@ def replace_keys(self, uri_string): def serialize(self, cassette_dict): for index, interaction in enumerate(cassette_dict['interactions']): # for serializing binary body - if type(interaction['request']['body']) is bytes: - ascii_body = b64encode(interaction['request']['body']).decode('ascii') - interaction['request']['body'] = {'binary': ascii_body} - if type(interaction['response']['body']['string']) is bytes: - ascii_body = b64encode(interaction['response']['body']['string']).decode('ascii') - interaction['response']['body'] = {'binary': ascii_body} + if interaction['request']['body']: + picklebody = b64encode(dumps(interaction['request']['body'])).decode('ascii') + interaction['request']['body'] = {'pickle': picklebody} + if interaction['response']['body']: + picklebody = b64encode(dumps(interaction['response']['body'])).decode('ascii') + interaction['response']['body'] = {'pickle': picklebody} return self.replace_keys(serialize(cassette_dict)) @@ -40,11 +41,9 @@ def replace_placeholders(self, cassette_string): def deserialize(self, cassette_string): cassette_dict = deserialize(self.replace_placeholders(cassette_string)) for index, interaction in enumerate(cassette_dict['interactions']): - if isinstance(interaction['request']['body'], dict) and 'binary' in interaction['request']['body'].keys(): - interaction['request']['body']['string'] = b64decode(interaction['request']['body']['binary']) - del interaction['request']['body']['binary'] - if 'binary' in interaction['response']['body'].keys(): - interaction['response']['body']['string'] = b64decode(interaction['response']['body']['binary']) - del interaction['response']['body']['binary'] + if isinstance(interaction['request']['body'], dict) and 'pickle' in interaction['request']['body'].keys(): + interaction['request']['body'] = loads(b64decode(interaction['request']['body']['pickle'])) + if isinstance(interaction['response']['body'], dict) and 'pickle' in interaction['response']['body'].keys(): + interaction['response']['body'] = loads(b64decode(interaction['response']['body']['pickle'])) cassette_dict['interactions'][index] == interaction return cassette_dict From 05c8e5be2a5df9a0b7b8eb98b80c335ab20d8c4f Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 17 Dec 2024 08:57:51 +0100 Subject: [PATCH 08/16] missing dependencies --- pubnub/pubnub_asyncio.py | 3 +-- requirements-dev.txt | 2 ++ setup.py | 3 +++ tests/integrational/asyncio/test_file_upload.py | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index a7c15362..5adca009 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -20,7 +20,6 @@ from pubnub.pubnub_core import PubNubCore from pubnub.request_handlers.base import BaseRequestHandler from pubnub.request_handlers.httpx import HttpxRequestHandler -from pubnub.request_handlers.requests import RequestsRequestHandler from pubnub.workers import SubscribeMessageWorker from pubnub.managers import SubscriptionManager, PublishSequenceManager, ReconnectionManager, TelemetryManager from pubnub import utils @@ -61,7 +60,7 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None, *, if isinstance(custom_request_handler, BaseRequestHandler): self._request_handler = custom_request_handler(self) else: - self._request_handler = RequestsRequestHandler(self) + self._request_handler = HttpxRequestHandler(self) if not subscription_manager: subscription_manager = EventEngineSubscriptionManager diff --git a/requirements-dev.txt b/requirements-dev.txt index b22c9a38..70d1959c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,6 +5,8 @@ flake8 pytest pytest-asyncio httpx +requests +aiohttp cbor2 behave vcrpy diff --git a/setup.py b/setup.py index 4511e64f..afbd1e8e 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,9 @@ install_requires=[ 'pycryptodomex>=3.3', 'httpx>=0.28', + 'httpx>=0.28', + 'requests>=2.4', + 'aiohttp', 'cbor2>=5.6' ], zip_safe=False, diff --git a/tests/integrational/asyncio/test_file_upload.py b/tests/integrational/asyncio/test_file_upload.py index 957fb76d..cd7d8c5c 100644 --- a/tests/integrational/asyncio/test_file_upload.py +++ b/tests/integrational/asyncio/test_file_upload.py @@ -106,10 +106,10 @@ async def test_send_and_download_file_encrypted_cipher_key(file_for_upload, file await pubnub.stop() -@pn_vcr.use_cassette( - "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", - filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/asyncio/file_upload/send_and_download_encrypted_file_crypto_module.json", +# filter_query_parameters=['uuid', 'l_file', 'pnsdk'], serializer='pn_json' +# ) @pytest.mark.asyncio(loop_scope="module") async def test_send_and_download_encrypted_file_crypto_module(file_for_upload, file_upload_test_data): pubnub = PubNubAsyncio(pnconf_enc_env_copy()) From d853b9e35fbdd2a372438d8b5876eb158d1b973f Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Mon, 6 Jan 2025 14:49:32 +0100 Subject: [PATCH 09/16] separate handlers for asyncio --- pubnub/exceptions.py | 16 ++ pubnub/models/envelopes.py | 8 + pubnub/pubnub.py | 16 +- pubnub/pubnub_asyncio.py | 249 ++---------------- pubnub/request_handlers/async_aiohttp.py | 218 +++++++++++++++ pubnub/request_handlers/async_httpx.py | 228 ++++++++++++++++ pubnub/request_handlers/base.py | 6 +- pubnub/request_handlers/httpx.py | 5 +- pubnub/request_handlers/requests.py | 5 +- setup.py | 2 +- .../integrational/asyncio/test_change_uuid.py | 3 +- tests/integrational/asyncio/test_fire.py | 3 +- .../integrational/asyncio/test_invocations.py | 4 +- .../asyncio/test_message_count.py | 3 +- tests/integrational/asyncio/test_publish.py | 5 +- tests/integrational/asyncio/test_signal.py | 3 +- tests/integrational/asyncio/test_subscribe.py | 3 +- .../native_sync/test_file_upload.py | 16 +- .../integrational/native_sync/test_publish.py | 9 +- 19 files changed, 557 insertions(+), 245 deletions(-) create mode 100644 pubnub/models/envelopes.py create mode 100644 pubnub/request_handlers/async_aiohttp.py create mode 100644 pubnub/request_handlers/async_httpx.py diff --git a/pubnub/exceptions.py b/pubnub/exceptions.py index bbfebe07..4f611302 100644 --- a/pubnub/exceptions.py +++ b/pubnub/exceptions.py @@ -18,3 +18,19 @@ def __init__(self, errormsg="", status_code=0, pn_error=None, status=None): def _status(self): raise DeprecationWarning return self.status + + +class PubNubAsyncioException(Exception): + def __init__(self, result, status): + self.result = result + self.status = status + + def __str__(self): + return str(self.status.error_data.exception) + + @staticmethod + def is_error(): + return True + + def value(self): + return self.status.error_data.exception diff --git a/pubnub/models/envelopes.py b/pubnub/models/envelopes.py new file mode 100644 index 00000000..e25b90dd --- /dev/null +++ b/pubnub/models/envelopes.py @@ -0,0 +1,8 @@ +class AsyncioEnvelope: + def __init__(self, result, status): + self.result = result + self.status = status + + @staticmethod + def is_error(): + return False diff --git a/pubnub/pubnub.py b/pubnub/pubnub.py index d9e133ce..5ad22224 100644 --- a/pubnub/pubnub.py +++ b/pubnub/pubnub.py @@ -1,6 +1,8 @@ import copy +import importlib import logging import threading +import os from typing import Type from threading import Event @@ -37,7 +39,17 @@ def __init__(self, config: PNConfiguration, *, custom_request_handler: Type[Base assert isinstance(config, PNConfiguration) PubNubCore.__init__(self, config) - if isinstance(custom_request_handler, BaseRequestHandler): + if (not custom_request_handler) and (handler := os.getenv('PUBNUB_REQUEST_HANDLER')): + module_name, class_name = handler.rsplit('.', 1) + module = importlib.import_module(module_name) + custom_request_handler = getattr(module, class_name) + if not issubclass(custom_request_handler, BaseRequestHandler): + raise Exception("Custom request handler must be subclass of BaseRequestHandler") + self._request_handler = custom_request_handler(self) + + if custom_request_handler: + if not issubclass(custom_request_handler, BaseRequestHandler): + raise Exception("Custom request handler must be subclass of BaseRequestHandler") self._request_handler = custom_request_handler(self) else: self._request_handler = HttpxRequestHandler(self) @@ -87,7 +99,7 @@ def request_async(self, endpoint_name, endpoint_call_options, callback, cancella tt = endpoint_call_options.params["tt"] if "tt" in endpoint_call_options.params else 0 print(f'\033[48;5;236m{endpoint_name=}, {endpoint_call_options.path}, TT={tt}\033[0m\n') - return self._request_handler.async_request( + return self._request_handler.threaded_request( endpoint_name, platform_options, endpoint_call_options, diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index 5adca009..5d1e00fd 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -1,12 +1,10 @@ +import importlib import logging -import json import asyncio -import httpx import math -import time -import urllib from asyncio import Event, Queue, Semaphore +import os from httpx import AsyncHTTPTransport from pubnub.event_engine.containers import PresenceStateContainer from pubnub.event_engine.models import events, states @@ -19,18 +17,14 @@ from pubnub.endpoints.pubsub.subscribe import Subscribe from pubnub.pubnub_core import PubNubCore from pubnub.request_handlers.base import BaseRequestHandler -from pubnub.request_handlers.httpx import HttpxRequestHandler +from pubnub.request_handlers.async_httpx import AsyncHttpxRequestHandler from pubnub.workers import SubscribeMessageWorker from pubnub.managers import SubscriptionManager, PublishSequenceManager, ReconnectionManager, TelemetryManager from pubnub import utils -from pubnub.structures import ResponseInfo, RequestOptions from pubnub.enums import PNStatusCategory, PNHeartbeatNotificationOptions, PNOperationType, PNReconnectionPolicy from pubnub.callbacks import SubscribeCallback, ReconnectionCallback -from pubnub.errors import ( - PNERR_SERVER_ERROR, PNERR_CLIENT_ERROR, PNERR_JSON_DECODING_FAILED, - PNERR_REQUEST_CANCELLED, PNERR_CLIENT_TIMEOUT -) -from .exceptions import PubNubException +from pubnub.errors import PNERR_REQUEST_CANCELLED, PNERR_CLIENT_TIMEOUT +from pubnub.exceptions import PubNubAsyncioException, PubNubException logger = logging.getLogger("pubnub") @@ -52,15 +46,22 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None, *, super(PubNubAsyncio, self).__init__(config) self.event_loop = custom_event_loop or asyncio.get_event_loop() - self._connector = None self._session = None - self._connector = PubNubAsyncHTTPTransport() + if (not custom_request_handler) and (handler := os.getenv('PUBNUB_ASYNC_REQUEST_HANDLER')): + module_name, class_name = handler.rsplit('.', 1) + module = importlib.import_module(module_name) + custom_request_handler = getattr(module, class_name) + if not issubclass(custom_request_handler, BaseRequestHandler): + raise Exception("Custom request handler must be subclass of BaseRequestHandler") + self._request_handler = custom_request_handler(self) - if isinstance(custom_request_handler, BaseRequestHandler): + if custom_request_handler: + if not issubclass(custom_request_handler, BaseRequestHandler): + raise Exception("Custom request handler must be subclass of BaseRequestHandler") self._request_handler = custom_request_handler(self) else: - self._request_handler = HttpxRequestHandler(self) + self._request_handler = AsyncHttpxRequestHandler(self) if not subscription_manager: subscription_manager = EventEngineSubscriptionManager @@ -72,25 +73,22 @@ def __init__(self, config, custom_event_loop=None, subscription_manager=None, *, self._telemetry_manager = AsyncioTelemetryManager() + @property + def _connector(self): + return self._request_handler._connector + async def close_pending_tasks(self, tasks): await asyncio.gather(*tasks) await asyncio.sleep(0.1) async def create_session(self): - self._session = httpx.AsyncClient( - timeout=httpx.Timeout(self.config.connect_timeout), - transport=self._connector - ) + await self._request_handler.create_session() async def close_session(self): - if self._session is not None: - await self._session.aclose() - - async def set_connector(self, cn): - await self._session.aclose() + await self._request_handler.close_session() - self._connector = cn - await self.create_session() + async def set_connector(self, connector): + await self._request_handler.set_connector(connector) async def stop(self): if self._subscription_manager: @@ -107,12 +105,12 @@ def request_deferred(self, *args): raise NotImplementedError async def request_result(self, options_func, cancellation_event): - envelope = await self._request_helper(options_func, cancellation_event) + envelope = await self._request_handler.async_request(options_func, cancellation_event) return envelope.result async def request_future(self, options_func, cancellation_event): try: - res = await self._request_helper(options_func, cancellation_event) + res = await self._request_handler.async_request(options_func, cancellation_event) return res except PubNubException as e: return PubNubAsyncioException( @@ -154,175 +152,6 @@ async def request_future(self, options_func, cancellation_event): ) ) - async def _request_helper(self, options_func, cancellation_event): - """ - Query string should be provided as a manually serialized and encoded string. - - :param options_func: - :param cancellation_event: - :return: - """ - if self._connector and self._connector.is_closed: - raise RuntimeError('Session is closed') - if cancellation_event is not None: - assert isinstance(cancellation_event, Event) - - options = options_func() - assert isinstance(options, RequestOptions) - - create_response = options.create_response - create_status = options.create_status - create_exception = options.create_exception - - params_to_merge_in = {} - - if options.operation_type == PNOperationType.PNPublishOperation: - params_to_merge_in['seqn'] = await self._publish_sequence_manager.get_next_sequence() - - options.merge_params_in(params_to_merge_in) - - if options.use_base_path: - url = utils.build_url(self.config.scheme(), self.base_origin, options.path, options.query_string) - else: - url = utils.build_url(scheme="", origin="", path=options.path, params=options.query_string) - - full_url = httpx.URL(url, query=options.query_string.encode('utf-8')) - - logger.debug("%s %s %s" % (options.method_string, url, options.data)) - - if options.request_headers: - request_headers = {**self.headers, **options.request_headers} - else: - request_headers = self.headers - - request_arguments = { - 'method': options.method_string, - 'headers': request_headers, - 'url': full_url, - 'follow_redirects': options.allow_redirects, - 'timeout': (options.connect_timeout, options.request_timeout), - } - if options.is_post() or options.is_patch(): - request_arguments['content'] = options.data - request_arguments['files'] = options.files - - try: - if not self._session: - await self.create_session() - start_timestamp = time.time() - response = await asyncio.wait_for( - self._session.request(**request_arguments), - options.request_timeout - ) - except (asyncio.TimeoutError, asyncio.CancelledError): - raise - except Exception as e: - logger.error("session.request exception: %s" % str(e)) - raise - - response_body = response.read() - if not options.non_json_response: - body = response_body - else: - if isinstance(response.content, bytes): - body = response.content # TODO: simplify this logic within the v5 release - else: - body = response_body - - if cancellation_event is not None and cancellation_event.is_set(): - return - - response_info = None - status_category = PNStatusCategory.PNUnknownCategory - - if response: - request_url = urllib.parse.urlparse(str(response.url)) - query = urllib.parse.parse_qs(request_url.query) - uuid = None - auth_key = None - - if 'uuid' in query and len(query['uuid']) > 0: - uuid = query['uuid'][0] - - if 'auth_key' in query and len(query['auth_key']) > 0: - auth_key = query['auth_key'][0] - - response_info = ResponseInfo( - status_code=response.status_code, - tls_enabled='https' == request_url.scheme, - origin=request_url.hostname, - uuid=uuid, - auth_key=auth_key, - client_request=None, - client_response=response - ) - - # if body is not None and len(body) > 0 and not options.non_json_response: - if body is not None and len(body) > 0: - if options.non_json_response: - data = body - else: - try: - data = json.loads(body) - except ValueError: - if response.status == 599 and len(body) > 0: - data = body - else: - raise - except TypeError: - try: - data = json.loads(body.decode("utf-8")) - except ValueError: - raise create_exception( - category=status_category, - response=response, - response_info=response_info, - exception=PubNubException( - pn_error=PNERR_JSON_DECODING_FAILED, - errormsg='json decode error', - ) - ) - else: - data = "N/A" - - logger.debug(data) - - if response.status_code not in (200, 307, 204): - - if response.status_code >= 500: - err = PNERR_SERVER_ERROR - else: - err = PNERR_CLIENT_ERROR - - if response.status_code == 403: - status_category = PNStatusCategory.PNAccessDeniedCategory - - if response.status_code == 400: - status_category = PNStatusCategory.PNBadRequestCategory - - raise create_exception( - category=status_category, - response=data, - response_info=response_info, - exception=PubNubException( - errormsg=data, - pn_error=err, - status_code=response.status_code - ) - ) - else: - self._telemetry_manager.store_latency(time.time() - start_timestamp, options.operation_type) - - return AsyncioEnvelope( - result=create_response(data) if not options.non_json_response else create_response(response, data), - status=create_status( - PNStatusCategory.PNAcknowledgmentCategory, - data, - response_info, - None - ) - ) - class AsyncioReconnectionManager(ReconnectionManager): def __init__(self, pubnub): @@ -717,32 +546,6 @@ def _schedule_next(self): self._timeout = self._event_loop.call_at(self._next_timeout, self._run) -class AsyncioEnvelope(object): - def __init__(self, result, status): - self.result = result - self.status = status - - @staticmethod - def is_error(): - return False - - -class PubNubAsyncioException(Exception): - def __init__(self, result, status): - self.result = result - self.status = status - - def __str__(self): - return str(self.status.error_data.exception) - - @staticmethod - def is_error(): - return True - - def value(self): - return self.status.error_data.exception - - class SubscribeListener(SubscribeCallback): def __init__(self): self.connected = False diff --git a/pubnub/request_handlers/async_aiohttp.py b/pubnub/request_handlers/async_aiohttp.py new file mode 100644 index 00000000..8c7ee4fc --- /dev/null +++ b/pubnub/request_handlers/async_aiohttp.py @@ -0,0 +1,218 @@ +import aiohttp +import asyncio +import logging +import time +import json # noqa # pylint: disable=W0611 +import urllib + +from asyncio import Event +from pubnub import utils +from pubnub.enums import PNOperationType, PNStatusCategory +from pubnub.errors import PNERR_CLIENT_ERROR, PNERR_JSON_DECODING_FAILED, PNERR_SERVER_ERROR +from pubnub.exceptions import PubNubException +from pubnub.models.envelopes import AsyncioEnvelope +from pubnub.request_handlers.base import BaseRequestHandler +from pubnub.structures import RequestOptions, ResponseInfo +from yarl import URL + +try: + from json.decoder import JSONDecodeError +except ImportError: + JSONDecodeError = ValueError + +logger = logging.getLogger("pubnub") + + +class AsyncAiohttpRequestHandler(BaseRequestHandler): + """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + ENDPOINT_THREAD_COUNTER: int = 0 + _connector: aiohttp.TCPConnector = None + _session: aiohttp.ClientSession = None + + def __init__(self, pubnub): + self.pubnub = pubnub + self._connector = aiohttp.TCPConnector(verify_ssl=True, loop=self.pubnub.event_loop) + + async def create_session(self): + if not self._session: + self._session = aiohttp.ClientSession( + loop=self.pubnub.event_loop, + timeout=aiohttp.ClientTimeout(connect=self.pubnub.config.connect_timeout), + connector=self._connector + ) + + async def close_session(self): + if self._session is not None: + await self._session.close() + + async def set_connector(self, connector): + await self._session.aclose() + self._connector = connector + await self.create_session() + + def sync_request(self, **_): + raise NotImplementedError("sync_request is not implemented for asyncio handler") + + async def threaded_request(self, **_): + raise NotImplementedError("threaded_request is not implemented for asyncio handler") + + async def async_request(self, options_func, cancellation_event): + """ + Query string should be provided as a manually serialized and encoded string. + + :param options_func: + :param cancellation_event: + :return: + """ + if cancellation_event is not None: + assert isinstance(cancellation_event, Event) + + options = options_func() + assert isinstance(options, RequestOptions) + + create_response = options.create_response + create_status = options.create_status + create_exception = options.create_exception + + params_to_merge_in = {} + + if options.operation_type == PNOperationType.PNPublishOperation: + params_to_merge_in['seqn'] = await self.pubnub._publish_sequence_manager.get_next_sequence() + + options.merge_params_in(params_to_merge_in) + + if options.use_base_path: + url = utils.build_url(self.pubnub.config.scheme(), self.pubnub.base_origin, options.path, + options.query_string) + else: + url = utils.build_url(scheme="", origin="", path=options.path, params=options.query_string) + + url = URL(url, encoded=True) + logger.debug("%s %s %s" % (options.method_string, url, options.data)) + + if options.request_headers: + request_headers = {**self.pubnub.headers, **options.request_headers} + else: + request_headers = self.pubnub.headers + + try: + if not self._session: + await self.create_session() + start_timestamp = time.time() + response = await asyncio.wait_for( + self._session.request( + options.method_string, + url, + headers=request_headers, + data=options.data if options.data else None, + allow_redirects=options.allow_redirects + ), + options.request_timeout + ) + except (asyncio.TimeoutError, asyncio.CancelledError): + raise + except Exception as e: + logger.error("session.request exception: %s" % str(e)) + raise + + if not options.non_json_response: + body = await response.text() + else: + if isinstance(response.content, bytes): + body = response.content # TODO: simplify this logic within the v5 release + else: + body = await response.read() + + if cancellation_event is not None and cancellation_event.is_set(): + return + + response_info = None + status_category = PNStatusCategory.PNUnknownCategory + + if response: + request_url = urllib.parse.urlparse(str(response.url)) + query = urllib.parse.parse_qs(request_url.query) + uuid = None + auth_key = None + + if 'uuid' in query and len(query['uuid']) > 0: + uuid = query['uuid'][0] + + if 'auth_key' in query and len(query['auth_key']) > 0: + auth_key = query['auth_key'][0] + + response_info = ResponseInfo( + status_code=response.status, + tls_enabled='https' == request_url.scheme, + origin=request_url.hostname, + uuid=uuid, + auth_key=auth_key, + client_request=None, + client_response=response + ) + + # if body is not None and len(body) > 0 and not options.non_json_response: + if body is not None and len(body) > 0: + if options.non_json_response: + data = body + else: + try: + data = json.loads(body) + except ValueError: + if response.status == 599 and len(body) > 0: + data = body + else: + raise + except TypeError: + try: + data = json.loads(body.decode("utf-8")) + except ValueError: + raise create_exception( + category=status_category, + response=response, + response_info=response_info, + exception=PubNubException( + pn_error=PNERR_JSON_DECODING_FAILED, + errormsg='json decode error', + ) + ) + else: + data = "N/A" + + logger.debug(data) + + if response.status not in (200, 307, 204): + + if response.status >= 500: + err = PNERR_SERVER_ERROR + else: + err = PNERR_CLIENT_ERROR + + if response.status == 403: + status_category = PNStatusCategory.PNAccessDeniedCategory + + if response.status == 400: + status_category = PNStatusCategory.PNBadRequestCategory + + raise create_exception( + category=status_category, + response=data, + response_info=response_info, + exception=PubNubException( + errormsg=data, + pn_error=err, + status_code=response.status + ) + ) + else: + self.pubnub._telemetry_manager.store_latency(time.time() - start_timestamp, options.operation_type) + + return AsyncioEnvelope( + result=create_response(data) if not options.non_json_response else create_response(response, data), + status=create_status( + PNStatusCategory.PNAcknowledgmentCategory, + data, + response_info, + None + ) + ) diff --git a/pubnub/request_handlers/async_httpx.py b/pubnub/request_handlers/async_httpx.py new file mode 100644 index 00000000..dc43eaa5 --- /dev/null +++ b/pubnub/request_handlers/async_httpx.py @@ -0,0 +1,228 @@ +from asyncio import Event +import asyncio +import logging +import time +import httpx +import json # noqa # pylint: disable=W0611 +import urllib + +from pubnub import utils +from pubnub.enums import PNOperationType, PNStatusCategory +from pubnub.errors import PNERR_CLIENT_ERROR, PNERR_JSON_DECODING_FAILED, PNERR_SERVER_ERROR +from pubnub.exceptions import PubNubException +from pubnub.models.envelopes import AsyncioEnvelope +from pubnub.request_handlers.base import BaseRequestHandler +from pubnub.structures import RequestOptions, ResponseInfo + +logger = logging.getLogger("pubnub") + + +class PubNubAsyncHTTPTransport(httpx.AsyncHTTPTransport): + is_closed = False + + def close(self): + self.is_closed = True + asyncio.create_task(super().aclose()) + + +class AsyncHttpxRequestHandler(BaseRequestHandler): + """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + ENDPOINT_THREAD_COUNTER: int = 0 + _connector: httpx.AsyncHTTPTransport = None + _session: httpx.AsyncClient = None + + def __init__(self, pubnub): + self.pubnub = pubnub + self._connector = PubNubAsyncHTTPTransport(verify=True, http2=True) + + async def create_session(self): + self._session = httpx.AsyncClient( + timeout=httpx.Timeout(self.pubnub.config.connect_timeout), + transport=self._connector + ) + + async def close_session(self): + if self._session is not None: + self._connector.close() + await self._session.aclose() + + async def set_connector(self, connector): + await self._session.aclose() + self._connector = connector + await self.create_session() + + def sync_request(self, **_): + raise NotImplementedError("sync_request is not implemented for asyncio handler") + + def threaded_request(self, **_): + raise NotImplementedError("threaded_request is not implemented for asyncio handler") + + async def async_request(self, options_func, cancellation_event): + """ + Query string should be provided as a manually serialized and encoded string. + + :param options_func: + :param cancellation_event: + :return: + """ + if self._connector and self._connector.is_closed: + raise RuntimeError('Session is closed') + if cancellation_event is not None: + assert isinstance(cancellation_event, Event) + + options = options_func() + assert isinstance(options, RequestOptions) + + create_response = options.create_response + create_status = options.create_status + create_exception = options.create_exception + + params_to_merge_in = {} + + if options.operation_type == PNOperationType.PNPublishOperation: + params_to_merge_in['seqn'] = await self.pubnub._publish_sequence_manager.get_next_sequence() + + options.merge_params_in(params_to_merge_in) + + if options.use_base_path: + url = utils.build_url(self.pubnub.config.scheme(), self.pubnub.base_origin, options.path, + options.query_string) + else: + url = utils.build_url(scheme="", origin="", path=options.path, params=options.query_string) + + full_url = httpx.URL(url, query=options.query_string.encode('utf-8')) + + logger.debug("%s %s %s" % (options.method_string, url, options.data)) + + if options.request_headers: + request_headers = {**self.pubnub.headers, **options.request_headers} + else: + request_headers = self.pubnub.headers + + request_arguments = { + 'method': options.method_string, + 'headers': request_headers, + 'url': full_url, + 'follow_redirects': options.allow_redirects, + 'timeout': (options.connect_timeout, options.request_timeout), + } + if options.is_post() or options.is_patch(): + request_arguments['content'] = options.data + request_arguments['files'] = options.files + + try: + if not self._session: + await self.create_session() + start_timestamp = time.time() + response = await asyncio.wait_for( + self._session.request(**request_arguments), + options.request_timeout + ) + except (asyncio.TimeoutError, asyncio.CancelledError): + raise + except Exception as e: + logger.error("session.request exception: %s" % str(e)) + raise + + response_body = response.read() + if not options.non_json_response: + body = response_body + else: + if isinstance(response.content, bytes): + body = response.content # TODO: simplify this logic within the v5 release + else: + body = response_body + + if cancellation_event is not None and cancellation_event.is_set(): + return + + response_info = None + status_category = PNStatusCategory.PNUnknownCategory + + if response: + request_url = urllib.parse.urlparse(str(response.url)) + query = urllib.parse.parse_qs(request_url.query) + uuid = None + auth_key = None + + if 'uuid' in query and len(query['uuid']) > 0: + uuid = query['uuid'][0] + + if 'auth_key' in query and len(query['auth_key']) > 0: + auth_key = query['auth_key'][0] + + response_info = ResponseInfo( + status_code=response.status_code, + tls_enabled='https' == request_url.scheme, + origin=request_url.hostname, + uuid=uuid, + auth_key=auth_key, + client_request=None, + client_response=response + ) + + # if body is not None and len(body) > 0 and not options.non_json_response: + if body is not None and len(body) > 0: + if options.non_json_response: + data = body + else: + try: + data = json.loads(body) + except ValueError: + if response.status == 599 and len(body) > 0: + data = body + else: + raise + except TypeError: + try: + data = json.loads(body.decode("utf-8")) + except ValueError: + raise create_exception( + category=status_category, + response=response, + response_info=response_info, + exception=PubNubException( + pn_error=PNERR_JSON_DECODING_FAILED, + errormsg='json decode error', + ) + ) + else: + data = "N/A" + + logger.debug(data) + + if response.status_code not in (200, 307, 204): + + if response.status_code >= 500: + err = PNERR_SERVER_ERROR + else: + err = PNERR_CLIENT_ERROR + + if response.status_code == 403: + status_category = PNStatusCategory.PNAccessDeniedCategory + + if response.status_code == 400: + status_category = PNStatusCategory.PNBadRequestCategory + + raise create_exception( + category=status_category, + response=data, + response_info=response_info, + exception=PubNubException( + errormsg=data, + pn_error=err, + status_code=response.status_code + ) + ) + else: + self.pubnub._telemetry_manager.store_latency(time.time() - start_timestamp, options.operation_type) + + return AsyncioEnvelope( + result=create_response(data) if not options.non_json_response else create_response(response, data), + status=create_status( + PNStatusCategory.PNAcknowledgmentCategory, + data, + response_info, + None + ) + ) diff --git a/pubnub/request_handlers/base.py b/pubnub/request_handlers/base.py index e5476bea..b8712992 100644 --- a/pubnub/request_handlers/base.py +++ b/pubnub/request_handlers/base.py @@ -9,5 +9,9 @@ def sync_request(self, platform_options, endpoint_call_options): pass @abstractmethod - def async_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): + def threaded_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): + pass + + @abstractmethod + async def async_request(self, options_func, cancellation_event): pass diff --git a/pubnub/request_handlers/httpx.py b/pubnub/request_handlers/httpx.py index aee0a84d..e02389a9 100644 --- a/pubnub/request_handlers/httpx.py +++ b/pubnub/request_handlers/httpx.py @@ -32,10 +32,13 @@ def __init__(self, pubnub): self.pubnub = pubnub + async def async_request(self, options_func, cancellation_event): + raise NotImplementedError("async_request is not implemented for synchronous handler") + def sync_request(self, platform_options, endpoint_call_options): return self._build_envelope(platform_options, endpoint_call_options) - def async_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): + def threaded_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): call = Call() if cancellation_event is None: diff --git a/pubnub/request_handlers/requests.py b/pubnub/request_handlers/requests.py index 1b29068d..31bc04c1 100644 --- a/pubnub/request_handlers/requests.py +++ b/pubnub/request_handlers/requests.py @@ -39,10 +39,13 @@ def __init__(self, pubnub): self.pubnub = pubnub + async def async_request(self, options_func, cancellation_event): + raise NotImplementedError("async_request is not implemented for synchronous handler") + def sync_request(self, platform_options, endpoint_call_options): return self._build_envelope(platform_options, endpoint_call_options) - def async_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): + def threaded_request(self, endpoint_name, platform_options, endpoint_call_options, callback, cancellation_event): call = Call() if cancellation_event is None: diff --git a/setup.py b/setup.py index afbd1e8e..57f16a26 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ install_requires=[ 'pycryptodomex>=3.3', 'httpx>=0.28', - 'httpx>=0.28', + 'h2>=4.1', 'requests>=2.4', 'aiohttp', 'cbor2>=5.6' diff --git a/tests/integrational/asyncio/test_change_uuid.py b/tests/integrational/asyncio/test_change_uuid.py index 3247cbf0..90c38ed9 100644 --- a/tests/integrational/asyncio/test_change_uuid.py +++ b/tests/integrational/asyncio/test_change_uuid.py @@ -3,7 +3,8 @@ from pubnub.models.consumer.signal import PNSignalResult from pubnub.models.consumer.common import PNStatus from pubnub.pnconfiguration import PNConfiguration -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope +from pubnub.pubnub_asyncio import PubNubAsyncio +from pubnub.models.envelopes import AsyncioEnvelope from tests.integrational.vcr_helper import pn_vcr from tests.helper import pnconf_demo_copy diff --git a/tests/integrational/asyncio/test_fire.py b/tests/integrational/asyncio/test_fire.py index 2b31a5d8..1bd60e51 100644 --- a/tests/integrational/asyncio/test_fire.py +++ b/tests/integrational/asyncio/test_fire.py @@ -2,7 +2,8 @@ from tests.helper import pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope +from pubnub.pubnub_asyncio import PubNubAsyncio +from pubnub.models.envelopes import AsyncioEnvelope from pubnub.models.consumer.pubsub import PNFireResult from pubnub.models.consumer.common import PNStatus diff --git a/tests/integrational/asyncio/test_invocations.py b/tests/integrational/asyncio/test_invocations.py index 13053e7c..534d776b 100644 --- a/tests/integrational/asyncio/test_invocations.py +++ b/tests/integrational/asyncio/test_invocations.py @@ -5,7 +5,9 @@ from pubnub.exceptions import PubNubException from pubnub.models.consumer.pubsub import PNPublishResult -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope, PubNubAsyncioException +from pubnub.pubnub_asyncio import PubNubAsyncio +from pubnub.models.envelopes import AsyncioEnvelope +from pubnub.exceptions import PubNubAsyncioException from tests.helper import pnconf_copy from tests.integrational.vcr_helper import pn_vcr diff --git a/tests/integrational/asyncio/test_message_count.py b/tests/integrational/asyncio/test_message_count.py index 67171f18..1d5be198 100644 --- a/tests/integrational/asyncio/test_message_count.py +++ b/tests/integrational/asyncio/test_message_count.py @@ -1,6 +1,7 @@ import pytest -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope +from pubnub.pubnub_asyncio import PubNubAsyncio +from pubnub.models.envelopes import AsyncioEnvelope from pubnub.models.consumer.message_count import PNMessageCountResult from pubnub.models.consumer.common import PNStatus from tests.helper import pnconf_mc_copy diff --git a/tests/integrational/asyncio/test_publish.py b/tests/integrational/asyncio/test_publish.py index f77f4e94..ee00d0a3 100644 --- a/tests/integrational/asyncio/test_publish.py +++ b/tests/integrational/asyncio/test_publish.py @@ -5,10 +5,11 @@ import pubnub as pn from unittest.mock import patch -from pubnub.exceptions import PubNubException +from pubnub.exceptions import PubNubAsyncioException, PubNubException from pubnub.models.consumer.common import PNStatus from pubnub.models.consumer.pubsub import PNPublishResult -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope, PubNubAsyncioException +from pubnub.models.envelopes import AsyncioEnvelope +from pubnub.pubnub_asyncio import PubNubAsyncio from tests.helper import pnconf_enc_env_copy, pnconf_pam_env_copy, pnconf_env_copy from tests.integrational.vcr_helper import pn_vcr diff --git a/tests/integrational/asyncio/test_signal.py b/tests/integrational/asyncio/test_signal.py index eb58be69..b152f891 100644 --- a/tests/integrational/asyncio/test_signal.py +++ b/tests/integrational/asyncio/test_signal.py @@ -2,7 +2,8 @@ from pubnub.models.consumer.signal import PNSignalResult from pubnub.models.consumer.common import PNStatus -from pubnub.pubnub_asyncio import PubNubAsyncio, AsyncioEnvelope +from pubnub.pubnub_asyncio import PubNubAsyncio +from pubnub.models.envelopes import AsyncioEnvelope from tests.integrational.vcr_helper import pn_vcr from tests.helper import pnconf_demo diff --git a/tests/integrational/asyncio/test_subscribe.py b/tests/integrational/asyncio/test_subscribe.py index 9e29bfe3..54dce334 100644 --- a/tests/integrational/asyncio/test_subscribe.py +++ b/tests/integrational/asyncio/test_subscribe.py @@ -7,7 +7,8 @@ from pubnub.callbacks import SubscribeCallback from pubnub.models.consumer.common import PNStatus from pubnub.models.consumer.pubsub import PNMessageResult -from pubnub.pubnub_asyncio import AsyncioSubscriptionManager, PubNubAsyncio, AsyncioEnvelope, SubscribeListener +from pubnub.models.envelopes import AsyncioEnvelope +from pubnub.pubnub_asyncio import AsyncioSubscriptionManager, PubNubAsyncio, SubscribeListener from tests.helper import gen_channel, pnconf_enc_env_copy, pnconf_env_copy, pnconf_sub_copy from tests.integrational.vcr_asyncio_sleeper import VCR599Listener, VCR599ReconnectionManager from pubnub.enums import PNReconnectionPolicy, PNStatusCategory diff --git a/tests/integrational/native_sync/test_file_upload.py b/tests/integrational/native_sync/test_file_upload.py index cad6c475..e90cf4cf 100644 --- a/tests/integrational/native_sync/test_file_upload.py +++ b/tests/integrational/native_sync/test_file_upload.py @@ -69,10 +69,10 @@ def test_list_files(file_upload_test_data): assert file_upload_test_data["UPLOADED_FILENAME"] == envelope.result.data[0]["name"] -@pn_vcr.use_cassette( - "tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json", - filter_query_parameters=('pnsdk',), serializer="pn_json" -) +# @pn_vcr.use_cassette( +# "tests/integrational/fixtures/native_sync/file_upload/send_and_download_file_using_bytes_object.json", +# filter_query_parameters=('pnsdk',), serializer="pn_json" +# ) def test_send_and_download_file_using_bytes_object(file_for_upload, file_upload_test_data): envelope = send_file(file_for_upload, pass_binary=True) @@ -228,8 +228,12 @@ def test_publish_file_message_with_overriding_time_token(): .ttl(222).sync() assert isinstance(envelope.result, PNPublishFileMessageResult) - - assert "ptto" in urllib.parse.parse_qs(envelope.status.client_request.url.query.decode()) + # note: for requests url is string, for httpx is object + if hasattr(envelope.status.client_request.url, 'query'): + query = urllib.parse.parse_qs(envelope.status.client_request.url.query.decode()) + else: + query = urllib.parse.parse_qs(urllib.parse.urlsplit(envelope.status.client_request.url).query) + assert "ptto" in query # @pn_vcr.use_cassette( diff --git a/tests/integrational/native_sync/test_publish.py b/tests/integrational/native_sync/test_publish.py index b7911905..7a81f244 100644 --- a/tests/integrational/native_sync/test_publish.py +++ b/tests/integrational/native_sync/test_publish.py @@ -329,8 +329,13 @@ def test_publish_with_ptto_and_replicate(self): .sync() assert isinstance(env.result, PNPublishResult) - assert "ptto" in urllib.parse.parse_qs(env.status.client_request.url.query.decode()) - assert "norep" in urllib.parse.parse_qs(env.status.client_request.url.query.decode()) + # note: for requests url is string, for httpx is object + if hasattr(env.status.client_request.url, 'query'): + query = urllib.parse.parse_qs(env.status.client_request.url.query.decode()) + else: + query = urllib.parse.parse_qs(urllib.parse.urlsplit(env.status.client_request.url).query) + assert "ptto" in query + assert "norep" in query @pn_vcr.use_cassette( 'tests/integrational/fixtures/native_sync/publish/publish_with_single_quote_message.yaml', From f2d76aaecf4964c7a32a89ed3a722423166a0999 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Mon, 6 Jan 2025 16:12:51 +0100 Subject: [PATCH 10/16] missing required package --- pubnub/event_engine/effects.py | 5 ++++- requirements-dev.txt | 1 + tests/acceptance/subscribe/steps/then_steps.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pubnub/event_engine/effects.py b/pubnub/event_engine/effects.py index ae8fd2ad..b475eea2 100644 --- a/pubnub/event_engine/effects.py +++ b/pubnub/event_engine/effects.py @@ -218,12 +218,15 @@ async def delayed_reconnect_async(self, delay, attempt): elif response.status.error: self.logger.warning(f'Reconnect failed: {response.status.error_data.__dict__}') self.failure(response.status.error_data, attempt, self.get_timetoken()) - else: + elif 't' in response.result: cursor = response.result['t'] timetoken = int(self.invocation.timetoken) if self.invocation.timetoken else cursor['t'] region = cursor['r'] messages = response.result['m'] self.success(timetoken=timetoken, region=region, messages=messages) + else: + self.logger.warning(f'Reconnect failed: Invalid response {str(response)}') + self.failure(str(response), attempt, self.get_timetoken()) def stop(self): self.logger.debug(f'stop called on {self.__class__.__name__}') diff --git a/requirements-dev.txt b/requirements-dev.txt index 70d1959c..e6dce764 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,6 +5,7 @@ flake8 pytest pytest-asyncio httpx +h2 requests aiohttp cbor2 diff --git a/tests/acceptance/subscribe/steps/then_steps.py b/tests/acceptance/subscribe/steps/then_steps.py index c66d37c0..4d78ebcd 100644 --- a/tests/acceptance/subscribe/steps/then_steps.py +++ b/tests/acceptance/subscribe/steps/then_steps.py @@ -125,7 +125,7 @@ async def step_impl(ctx): @async_run_until_complete async def step_impl(context, channel1, channel2): context.pubnub.unsubscribe().channels([channel1, channel2]).execute() - await asyncio.sleep(0.5) + await asyncio.sleep(3) @then(u'I don\'t observe any Events and Invocations of the Presence EE') From 63e3cf15e8dcd8b9986ac72a3fa901e1beebbbe5 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Tue, 7 Jan 2025 16:57:39 +0100 Subject: [PATCH 11/16] Debug... --- tests/acceptance/subscribe/environment.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/acceptance/subscribe/environment.py b/tests/acceptance/subscribe/environment.py index 8f4740a3..eb0e2a16 100644 --- a/tests/acceptance/subscribe/environment.py +++ b/tests/acceptance/subscribe/environment.py @@ -1,8 +1,10 @@ import asyncio import requests +import logging from behave.runner import Context from io import StringIO +from httpx import HTTPError from pubnub.pubnub import PubNub from pubnub.pnconfiguration import PNConfiguration from pubnub.pubnub_asyncio import SubscribeCallback @@ -51,6 +53,10 @@ def after_scenario(context: Context, feature): loop.run_until_complete(task) except asyncio.CancelledError: pass + except HTTPError as e: + logger = logging.getLogger("pubnub") + logger.error(f"HTTPError: {e}") + loop.run_until_complete(asyncio.sleep(1.5)) del context.pubnub From b314882451c2aea6aa8966056b4b27915c6c7e71 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Thu, 9 Jan 2025 14:31:20 +0100 Subject: [PATCH 12/16] Added import of AsyncioEnvelope to keep old path compatible --- pubnub/pubnub_asyncio.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index 5d1e00fd..2e4ab0d0 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -26,6 +26,9 @@ from pubnub.errors import PNERR_REQUEST_CANCELLED, PNERR_CLIENT_TIMEOUT from pubnub.exceptions import PubNubAsyncioException, PubNubException +# flake8: noqa +from pubnub.models.envelopes import AsyncioEnvelope + logger = logging.getLogger("pubnub") From 5ca0f090773e37bc72bdd7f485fe2121fb31ff4b Mon Sep 17 00:00:00 2001 From: Mateusz Wiktor <39187473+techwritermat@users.noreply.github.com> Date: Fri, 10 Jan 2025 09:48:24 +0100 Subject: [PATCH 13/16] Update requests.py --- pubnub/request_handlers/requests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubnub/request_handlers/requests.py b/pubnub/request_handlers/requests.py index 31bc04c1..dac0042e 100644 --- a/pubnub/request_handlers/requests.py +++ b/pubnub/request_handlers/requests.py @@ -26,7 +26,7 @@ class RequestsRequestHandler(BaseRequestHandler): - """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + """ PubNub Python SDK synchronous requests handler based on `requests` HTTP library. """ ENDPOINT_THREAD_COUNTER: int = 0 def __init__(self, pubnub): From e959574e9aee56db88593532185dc86e8068bdb0 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Mon, 13 Jan 2025 12:26:08 +0100 Subject: [PATCH 14/16] Update pubnub/request_handlers/httpx.py Co-authored-by: Mateusz Wiktor <39187473+techwritermat@users.noreply.github.com> --- pubnub/request_handlers/httpx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubnub/request_handlers/httpx.py b/pubnub/request_handlers/httpx.py index e02389a9..8da2da74 100644 --- a/pubnub/request_handlers/httpx.py +++ b/pubnub/request_handlers/httpx.py @@ -24,7 +24,7 @@ class HttpxRequestHandler(BaseRequestHandler): - """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + """ PubNub Python SDK synchronous requests handler based on `httpx` HTTP library. """ ENDPOINT_THREAD_COUNTER: int = 0 def __init__(self, pubnub): From f8a4bb062691b9b1a137c0c6ad480fde1d091039 Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Mon, 13 Jan 2025 12:26:14 +0100 Subject: [PATCH 15/16] Update pubnub/request_handlers/async_httpx.py Co-authored-by: Mateusz Wiktor <39187473+techwritermat@users.noreply.github.com> --- pubnub/request_handlers/async_httpx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubnub/request_handlers/async_httpx.py b/pubnub/request_handlers/async_httpx.py index dc43eaa5..ea1d5149 100644 --- a/pubnub/request_handlers/async_httpx.py +++ b/pubnub/request_handlers/async_httpx.py @@ -26,7 +26,7 @@ def close(self): class AsyncHttpxRequestHandler(BaseRequestHandler): - """ PubNub Python SDK Native requests handler based on `requests` HTTP library. """ + """ PubNub Python SDK asychronous requests handler based on the `httpx` HTTP library. """ ENDPOINT_THREAD_COUNTER: int = 0 _connector: httpx.AsyncHTTPTransport = None _session: httpx.AsyncClient = None From 9e6bda0782b73e19e0556d3dda73b032fd7c848c Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:21:50 +0000 Subject: [PATCH 16/16] PubNub SDK 10.0.0 release. --- .pubnub.yml | 13 +++++++++---- CHANGELOG.md | 6 ++++++ pubnub/pubnub_core.py | 2 +- setup.py | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index ce691879..485c9548 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,5 +1,5 @@ name: python -version: 9.1.0 +version: 10.0.0 schema: 1 scm: github.com/pubnub/python sdks: @@ -18,7 +18,7 @@ sdks: distributions: - distribution-type: library distribution-repository: package - package-name: pubnub-9.1.0 + package-name: pubnub-10.0.0 location: https://pypi.org/project/pubnub/ supported-platforms: supported-operating-systems: @@ -91,8 +91,8 @@ sdks: - distribution-type: library distribution-repository: git release - package-name: pubnub-9.1.0 - location: https://github.com/pubnub/python/releases/download/v9.1.0/pubnub-9.1.0.tar.gz + package-name: pubnub-10.0.0 + location: https://github.com/pubnub/python/releases/download/10.0.0/pubnub-10.0.0.tar.gz supported-platforms: supported-operating-systems: Linux: @@ -163,6 +163,11 @@ sdks: license-url: https://github.com/encode/httpx/blob/master/LICENSE.md is-required: Required changelog: + - date: 2025-01-13 + version: 10.0.0 + changes: + - type: feature + text: "Introduced configurable request handler with HTTP/2 support." - date: 2024-11-19 version: v9.1.0 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index edf3f722..2e47ca5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 10.0.0 +January 13 2025 + +#### Added +- Introduced configurable request handler with HTTP/2 support. + ## v9.1.0 November 19 2024 diff --git a/pubnub/pubnub_core.py b/pubnub/pubnub_core.py index 90dc215d..36f064d3 100644 --- a/pubnub/pubnub_core.py +++ b/pubnub/pubnub_core.py @@ -94,7 +94,7 @@ class PubNubCore: """A base class for PubNub Python API implementations""" - SDK_VERSION = "9.1.0" + SDK_VERSION = "10.0.0" SDK_NAME = "PubNub-Python" TIMESTAMP_DIVIDER = 1000 diff --git a/setup.py b/setup.py index 57f16a26..fa5a9ee6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='pubnub', - version='9.1.0', + version='10.0.0', description='PubNub Real-time push service in the cloud', author='PubNub', author_email='support@pubnub.com',