Commit Graph

9693 Commits

Author SHA1 Message Date
Kekoa Kaaikala 16798bdd91 Agent: Update type hints in control.py 2022-08-11 17:53:06 +00:00
Kekoa Kaaikala af9d4ac49a Agent: Remove call to urllib3.disable_warnings() 2022-08-11 14:02:18 +00:00
Kekoa Kaaikala 72d1703b48 Agent: Fix typing errors in control.py 2022-08-11 14:02:18 +00:00
Kekoa Kaaikala 92333d6be2 Agent: Add docstrings to commands.py 2022-08-11 14:02:18 +00:00
Kekoa Kaaikala f091c1c83d Agent: Update type hints in commands.py 2022-08-11 14:02:18 +00:00
Kekoa Kaaikala 48797397f6 Project: Add mypy to commit hooks 2022-08-11 14:02:18 +00:00
Kekoa Kaaikala 5558d075be Agent: Fix credential repository import
Fix a failed import that prevented the agent from running.

Resolves PR #2186
2022-08-11 09:14:22 -04:00
Mike Salvatore 5c7b2d713b
Merge pull request #2185 from guardicore/2141-gcp-machines-to-bb-tests
BB: Gather enabled tests and select GCP machines needed for the speci…
2022-08-11 08:26:49 -04:00
Mike Salvatore 016048abca Merge pull request #2184 from guardicore/2146-replace-guardicore-links 2022-08-11 07:14:09 -04:00
Mike Salvatore 52ca082e87 Project: Update job post in README.md 2022-08-11 07:03:19 -04:00
Mike Salvatore ae82578ae0 BB: Rename list_machines -> gcp_machines_to_start 2022-08-10 14:23:16 -04:00
Mike Salvatore ea81226c2a BB: Simplify list_machines() 2022-08-10 14:18:23 -04: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
Ilija Lazoroski 736e779f4c BB: Gather enabled tests and select GCP machines needed for the specific tests 2022-08-10 17:32:39 +02: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
Ilija Lazoroski 4da0b5fcff Docs, Island: Replace broken links with wayback machine links
These needs to be changed when we have live ones from Akamai.
2022-08-10 14:34:13 +02:00
Ilija Lazoroski 53c2a1d5c4 Project: Replace Guardicore links with Akamai links
Fix one link in ISSUE template
2022-08-10 14:15:59 +02:00
Ilija Lazoroski 2f7a32efb1 Docs: Replace Guardicore links with Akamai links 2022-08-10 14:14:47 +02:00
Ilija Lazoroski 32634ce164 Island: Replace Guardicore links with Akamai links 2022-08-10 14:14:19 +02:00
Ilija Lazoroski 4535c26a5c Agent: Change Guardicore link in ransowmare readme 2022-08-10 14:13:42 +02: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