Commit Graph

9683 Commits

Author SHA1 Message Date
Mike Salvatore 2e70b87ee9 Revert "Island, UI: Handle the case when version couldn't be fetched"
This reverts commit 737070f956.
2022-08-12 10:15:44 -04:00
vakarisz 737070f956 Island, UI: Handle the case when version couldn't be fetched 2022-08-12 09:50:28 +03:00
vakarisz c61737abc0 Island: Send analytics on island startup instead of object creation
This change makes the logic more evident, because sending the analytics is not done during the initialization of an object
2022-08-12 09:32:50 +03:00
vakarisz bec7bef1b3 Island: Return current version number instead of None 2022-08-11 17:57:07 +03:00
vakarisz 5ffec0eb4f Changelog: Add entry about separating version and analytics requests 2022-08-11 17:45:09 +03:00
vakarisz 248cef589a Docs: Change performed queried documentation in the FAQ
Island now performs 2 queries instead of 1(1 for analytics and 1 for update information)
2022-08-11 17:45:08 +03:00
vakarisz 32460bbb3e Island: Send analytics upon island startup 2022-08-11 17:20:56 +03:00
vakarisz 02e719f7b2 Island: Fetch version and download url from new lambda API 2022-08-11 15:14:54 +03:00
Mike Salvatore 21f9b5ad53
Merge pull request #2182 from guardicore/2156-implement-event-queue
Implement EventQueue
2022-08-10 13:22:43 -04:00
Mike Salvatore dcc2717ac8 Common: Fix typo specifed -> specified 2022-08-10 12:47:47 -04:00
Mike Salvatore b1c77b7be8 Common: Fix typo well -> will 2022-08-10 12:47:47 -04:00
Mike Salvatore 8a02305277 Common: Export PyPubSubEventQueue from common.event_queue 2022-08-10 12:47:47 -04:00
Mike Salvatore 4243f9f3ea Common: Export IEventQueue from common.event_queue 2022-08-10 12:47:47 -04:00
Mike Salvatore 2bbe56035d UT: Use UUID for source in test_pypubsub_event_queue.py 2022-08-10 12:47:47 -04:00
Mike Salvatore ac69e7d25b UT: Use frozenset() for tags in test_pypubsub_event_queue.py 2022-08-10 12:47:47 -04:00
Mike Salvatore e36fb9af73 UT: Add type hints to test_pypubsub_event_queue.py 2022-08-10 12:47:47 -04:00
Mike Salvatore 35155c345f Common: Use EventSubscriber for IEventQueue type hints 2022-08-10 12:36:59 -04:00
Mike Salvatore 97a612be2d Common: Add EventSubscriber type 2022-08-10 12:34:06 -04:00
Mike Salvatore 83e09ca957 Common: Fix type hint for IEventQueue.subscribe_type() 2022-08-10 11:35:55 -04:00
Mike Salvatore d151ce12fd Common: Rename _INTERNAL_ALL_EVENT_TYPES_TOPIC -> _ALL_EVENTS_TOPIC 2022-08-10 11:34:48 -04:00
Mike Salvatore a6c24af622 Common: Prevent topic collision between types and tags
If an event tag happened to be the same as an event type, subscribers
could receive event types that they were not prepared to handle,
resulting in difficult-to-diagnose bugs. Prevent tags and types from
being sent to the wrong subscribers by appending unique strings to the
topics.
2022-08-10 11:32:09 -04:00
Mike Salvatore 3384c049a4 UT: Use new Publisher for each test instead of default `pub`
Using the default publisher provided by pypubsub causes state to be
carried over between tests. Unit tests should not depend on eachother or
the order in which they're run.
2022-08-10 11:10:22 -04:00
Mike Salvatore 68dafbfb9d UT: Add event_queue() fixture 2022-08-10 11:09:51 -04:00
Mike Salvatore 2bdc16c286 UT: Refactor test_pypubsub_event_queue.py 2022-08-10 11:07:36 -04:00
Mike Salvatore d6bb56536d UT: Test with instances of AbstractEvent, not classes 2022-08-10 09:37:10 -04:00
Mike Salvatore 4da0cefa7d Common: Publish message to event's class name 2022-08-10 09:34:09 -04:00
Mike Salvatore a461226fec Common: Fix type hint for PyPubSubEventQueue.subscribe_type() 2022-08-10 09:21:54 -04:00
Mike Salvatore c0a9a8cf4d Common: Rename _publish_to_tags_topic{,s}() 2022-08-10 09:18:25 -04:00
Mike Salvatore c26c7403a6 Common: Make INTERNAL_ALL_EVENT_TYPES_TOPIC private to the module 2022-08-10 09:17:14 -04:00
Mike Salvatore 43e45e14ad Common: Remove subscribe_all_event_types()
https://github.com/guardicore/monkey/pull/2182#discussion_r942427831
2022-08-10 09:17:14 -04:00
Mike Salvatore 87cbdd9fb8 Common: Rename subscribe_all() -> subscribe_all_events() 2022-08-10 09:17:13 -04:00
Mike Salvatore 8553cd834c Common: Improve readability of PyPubSubEventQueue.publish() 2022-08-10 08:59:49 -04:00
Mike Salvatore 1d7b498290 Common: Improve readability in PyPubSubEventQueue 2022-08-10 08:59:49 -04:00
Mike Salvatore 7bbecc4d3f Common: Only send event to `subscribe_all()` subscribers once 2022-08-10 08:59:49 -04:00
Shreya Malviya 49a28b9161 UT: Add test for subscribing to all event types in PyPubSubEventQueue 2022-08-10 17:24:12 +05:30
Mike Salvatore d09f743100 Island: Register pypubsub Publisher in the DIContainer 2022-08-10 07:31:43 -04:00
Mike Salvatore 416cb30577 Common: Add type hint ty PyPubSubEventQueue constructor 2022-08-10 07:29:13 -04:00
Shreya Malviya 6ecb2f4d49 UT: Simplify logic in test_pypubsub_event_queue.test_subscribe_types() 2022-08-10 15:45:39 +05:30
Shreya Malviya e905f6eddf UT: Define functions instead of lambda expressions in PyPubSubEventQueue tests since flake8 complains 2022-08-10 15:41:03 +05:30
Shreya Malviya edad0d8cf2 UT: Simplify test logic with fixtures in PyPubSubEventQueue 2022-08-10 15:39:14 +05:30
Shreya Malviya 3aff182d47 UT: Simplify PyPubSubEventQueue's tests 2022-08-10 14:53:46 +05:30
Shreya Malviya 2fd66bc9e2 Common: Add comment about subscribing to all topics in PyPubSubEventQueue 2022-08-10 14:49:31 +05:30
Shreya Malviya f26beb6464 Common: Pass event_data to subscribers when publishing in PyPubSubEventQueue 2022-08-10 14:02:53 +05:30
Shreya Malviya 32efa0f0f2 Common: Don't pass 'data' argument when publishing in PyPubSubEventQueue 2022-08-10 13:27:55 +05:30
Shreya Malviya d154a7989c Common: Don't pass 'data' argument to IEventQueue's publish() 2022-08-10 13:26:01 +05:30
Shreya Malviya 3938e2f377 Project: Add subscribe_all_event_types to Vulture allowlist 2022-08-09 19:00:05 +05:30
Shreya Malviya 8da3abbb5b Common: Add internal all event types topic to PyPubSubEventQueue 2022-08-09 18:54:17 +05:30
Ilija Lazoroski 126f37a1f2 Docs: Change baseURL for production and staging
* Disable canonify
2022-08-09 08:28:52 -04:00
Shreya Malviya 7a77fd82df Project: Add event queue's entries to Vulture allowlist 2022-08-09 17:12:48 +05:30
Shreya Malviya 585b1ca408 Common: Modify IEventQueue to not have any static methods 2022-08-09 15:21:59 +05:30