Commit Graph

9881 Commits

Author SHA1 Message Date
Shreya Malviya d190f220f7 Common: Modify PyPubSubEventQueue to pass publisher in constructor 2022-08-09 14:31:44 +05:30
Shreya Malviya 00b62dc1a9 UT: Modify PyPubSubEventQueue's tests based on changes 2022-08-09 11:56:15 +05:30
Shreya Malviya 3cef54c09c Common: Change IEventQueue and PyPubSubEventQueue's subscribe_types() -> subscribe_type() 2022-08-09 11:53:03 +05:30
Shreya Malviya ae666d3dd3 Common: Change IEventQueue and PyPubSubEventQueue's subscribe_tags() -> subscribe_tag() 2022-08-09 11:50:31 +05:30
Shreya Malviya e92d67bfe8 Common: Fix type hints in IEventQueue and PyPubSubEventQueue 2022-08-09 11:46:19 +05:30
Shreya Malviya 9210023876 UT: Replace EventQueue with PyPubSubEventQueue 2022-08-09 11:43:37 +05:30
Shreya Malviya d346e63a26 Common: Rename EventQueue -> PyPubSubEventQueue 2022-08-09 11:42:57 +05:30
Shreya Malviya ae2ba0e068 UT: Remove event queue's unsubscribing tests 2022-08-09 11:39:43 +05:30
Shreya Malviya f3ef99db64 Common: Remove unsubscribing methods from IEventQueue and EventQueue 2022-08-09 11:37:21 +05:30
Shreya Malviya 77ea3e554d UT: Replace PypubsubEventQueue -> EventQueue and test_pypubsub_event_queue.py -> test_event_queue.py 2022-08-09 00:06:24 +05:30
Shreya Malviya 23d3f179a2 Common: Rename PypubsubEventQueue -> EventQueue and pypubsub_event_queue.py -> event_queue.py 2022-08-09 00:05:07 +05:30
Shreya Malviya 1a2a4d165a Common: Add tests for PypubsubEventQueue
All the unsubscribing tests fails for some reason right now. The
subscriber is unsubscribed from the specified topics but the subscriber
is still called when an event with that topic is published.
2022-08-08 23:57:15 +05:30
Shreya Malviya b1017e2222 Common: Fix import in common/events/__init__.py 2022-08-08 23:54:29 +05:30
Shreya Malviya 9c5bbfe35c Common: Fix some logic in PypubsubEventQueue 2022-08-08 23:54:01 +05:30
Mike Salvatore b2fa790db8
Merge pull request #2178 from guardicore/2169-icredentialstore-renaming
2169 ICredentialStore renaming
2022-08-08 11:27:29 -04:00
Mike Salvatore aa32b5059a Agent: Remove superfluous types from IPropCredRepo docstrings 2022-08-08 10:58:20 -04:00
vakarisz 223474d983 Island: Document IPropagationRepository and child classes 2022-08-08 17:20:27 +03:00
vakarisz 9c5a81105f Island: Sort imports in representations.py 2022-08-08 16:54:40 +03:00
vakarisz 022daf762b Agent: Improve documentation of credential repository 2022-08-08 16:09:59 +03:00
vakarisz 4f6500ad83 Island: Use python json encoder instead of flask
Flask json acts strange and doesn't trigger the "default" method when it encounters CredentialTypeEnum, even though it can't serialize it
2022-08-08 15:41:45 +03:00
vakarisz eb6b06e6a2 Agent: Rename credential_store to credential_repository 2022-08-08 15:34:53 +03:00
Mike Salvatore 5e369f338a
Merge pull request #2175 from guardicore/di-container-quality-improvements
Di container quality improvements
2022-08-08 08:14:30 -04:00
Mike Salvatore b2d32697e3 Common: Use suppress (not pass) in DIContainer.resolve() 2022-08-08 07:00:49 -04:00
Shreya Malviya b78282ef20 Common: Implement unsubscribing functions in PypubsubEventQueue 2022-08-08 13:42:55 +05:30
Shreya Malviya 0578a6fcc8 Common: Add unsubscribing functions to IEventQueue 2022-08-08 13:38:27 +05:30
Shreya Malviya 84c800b815 Common: Remove MRO logic from PypubsubEventQueue
This isn't needed. The Agent's responsibility is to just declare what it
did in the form of events.

For example, although CredentialsStolenEvent is a type of SecurityEvent
technically, the Agent doesn't care about this. The Island does, which
is why this should be handled on the pub/sub implementation on the
Island side. The Agent merely conveys the information that it stole
credentials. Whatever is to be done or however that information is to be
handled after that is the Island's responsibility.

I don't see a use case in the Agent where a concrete event is derived
from another concrete event. So, the MRO logic is removed in this
commit.
2022-08-08 13:33:52 +05:30
Shreya Malviya d773bac8c1 Common: Simplify logic in PypubsubEventQueue 2022-08-08 13:11:07 +05:30
Shreya Malviya 8ae451f240 Common: Implement publish() in PypubsubEventQueue 2022-08-08 12:49:21 +05:30
Shreya Malviya 1fbe9e5ad4 Common: Make methods static in PypubsubEventQueue 2022-08-08 12:07:45 +05:30
Shreya Malviya 414e8127ed Common: Implement subscribe_tags() in PypubsubEventQueue 2022-08-08 12:03:17 +05:30
Mike Salvatore 345633b1e3 Common: Document exceptions for DIContainer 2022-08-05 11:43:15 -04:00
Mike Salvatore d8b37553e3 Common: Rename UnregisteredTypeError to UnresolvableDependencyError
When calling `resolve()`, dependencies may be resolved as conventions,
instances, or types. `UnregisteredTypeError` is overly specific and, in
some cases, inaccurate. It makes more sense for `resolve()` to raise an
`UnresolvableDependencyError` if it is unable to resolve a dependency.
2022-08-05 11:40:10 -04:00
Mike Salvatore 34ed72da6b
Merge pull request #2173 from guardicore/2154-refactor-pba-file-upload
2154 refactor pba file upload
2022-08-05 10:43:46 -04:00
Shreya Malviya bb76410bac Common: Create and partially implement PypubsubEventQueue 2022-08-05 19:11:33 +05:30
Mike Salvatore 16d5a74df6 BB: Use put_json() to reset the Island's mode 2022-08-05 09:35:14 -04:00
Shreya Malviya 40219aa5ff Common: Add TODO in IEventQueue 2022-08-05 19:05:07 +05:30
Mike Salvatore 3362959c73 BB: Use put_json() to reset credentials 2022-08-05 09:34:57 -04:00
Mike Salvatore 1568cf8f0a BB: Use put_json() to import configured credentials 2022-08-05 09:21:43 -04:00
Mike Salvatore ea369a5a74 BB: Use put_json() to import config 2022-08-05 09:21:28 -04:00
Shreya Malviya 924fc3f1e2 Common: Make all methods of IEventQueue static 2022-08-05 18:51:07 +05:30
Mike Salvatore 4cb6bdd9cf BB: Add put_json() 2022-08-05 09:20:52 -04:00
Shreya Malviya ac62281c84 Agent: Add pypubsub as a dependency 2022-08-05 18:45:34 +05:30
Shreya Malviya b027686b2f Island: Add pypubsub as a dependency 2022-08-05 18:44:41 +05:30
Shreya Malviya 41ea4a901b Common: Add IEventQueue 2022-08-05 18:25:00 +05:30
Ilija Lazoroski 1991669402 Island: Export {LINUX, WINDOWS}_PBA_TYPE from __init__ 2022-08-05 11:04:58 +02:00
Ilija Lazoroski 51318f7189 Island: Export PBAFileDownload from __init__ 2022-08-05 10:52:06 +02:00
Ilija Lazoroski b874b6a736 Island: Export PBAFileUpload from __init__ 2022-08-05 10:52:06 +02:00
Ilija Lazoroski e4a284b172 Changelog: Add entry for renaming of `api/file-upload` 2022-08-05 10:51:31 +02:00
Ilija Lazoroski 9acc2d8df5 Island: Rename 'api/file-upload' to 'api/pba/upload' 2022-08-05 10:51:31 +02:00
Ilija Lazoroski 0a6fa1e7d7 Island: Rename FileUpload resource to PBAFileUpload 2022-08-05 10:51:31 +02:00