azul-bedrock 9.0.32__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. azul_bedrock-9.0.32/.editorconfig +25 -0
  2. azul_bedrock-9.0.32/.github/CODEOWNERS +1 -0
  3. azul_bedrock-9.0.32/.gitignore +274 -0
  4. azul_bedrock-9.0.32/.golangci.yml +32 -0
  5. azul_bedrock-9.0.32/.mockery.yaml +23 -0
  6. azul_bedrock-9.0.32/PKG-INFO +197 -0
  7. azul_bedrock-9.0.32/README.md +144 -0
  8. azul_bedrock-9.0.32/azul_bedrock/__init__.py +0 -0
  9. azul_bedrock-9.0.32/azul_bedrock/dispatcher.py +698 -0
  10. azul_bedrock-9.0.32/azul_bedrock/dispatcher_params.py +48 -0
  11. azul_bedrock-9.0.32/azul_bedrock/exceptions.py +95 -0
  12. azul_bedrock-9.0.32/azul_bedrock/identify.py +454 -0
  13. azul_bedrock-9.0.32/azul_bedrock/identify.yaml +761 -0
  14. azul_bedrock-9.0.32/azul_bedrock/mock/__init__.py +13 -0
  15. azul_bedrock-9.0.32/azul_bedrock/mock/dp.py +48 -0
  16. azul_bedrock-9.0.32/azul_bedrock/mock/events.py +49 -0
  17. azul_bedrock-9.0.32/azul_bedrock/mock/helper.py +29 -0
  18. azul_bedrock-9.0.32/azul_bedrock/mock/state.py +76 -0
  19. azul_bedrock-9.0.32/azul_bedrock/mock/streams.py +163 -0
  20. azul_bedrock-9.0.32/azul_bedrock/models_api.py +100 -0
  21. azul_bedrock-9.0.32/azul_bedrock/models_auth.py +38 -0
  22. azul_bedrock-9.0.32/azul_bedrock/models_network.py +749 -0
  23. azul_bedrock-9.0.32/azul_bedrock/models_restapi/__init__.py +182 -0
  24. azul_bedrock-9.0.32/azul_bedrock/models_restapi/basic.py +81 -0
  25. azul_bedrock-9.0.32/azul_bedrock/models_restapi/binaries.py +430 -0
  26. azul_bedrock-9.0.32/azul_bedrock/models_restapi/binaries_auto_complete.py +60 -0
  27. azul_bedrock-9.0.32/azul_bedrock/models_restapi/binaries_data.py +68 -0
  28. azul_bedrock-9.0.32/azul_bedrock/models_restapi/features.py +162 -0
  29. azul_bedrock-9.0.32/azul_bedrock/models_restapi/plugins.py +73 -0
  30. azul_bedrock-9.0.32/azul_bedrock/models_restapi/purge.py +21 -0
  31. azul_bedrock-9.0.32/azul_bedrock/models_restapi/sources.py +45 -0
  32. azul_bedrock-9.0.32/azul_bedrock/models_restapi/statistics.py +16 -0
  33. azul_bedrock-9.0.32/azul_bedrock/models_settings.py +111 -0
  34. azul_bedrock-9.0.32/azul_bedrock/test_utils/bucket_storage.py +101 -0
  35. azul_bedrock-9.0.32/azul_bedrock/test_utils/errors.py +30 -0
  36. azul_bedrock-9.0.32/azul_bedrock/test_utils/file_manager.py +277 -0
  37. azul_bedrock-9.0.32/azul_bedrock/test_utils/file_manager_settings.py +37 -0
  38. azul_bedrock-9.0.32/azul_bedrock/trusted_mime.yaml +214 -0
  39. azul_bedrock-9.0.32/azul_bedrock/yara_rules.yar +1177 -0
  40. azul_bedrock-9.0.32/azul_bedrock.egg-info/PKG-INFO +197 -0
  41. azul_bedrock-9.0.32/azul_bedrock.egg-info/SOURCES.txt +307 -0
  42. azul_bedrock-9.0.32/azul_bedrock.egg-info/dependency_links.txt +1 -0
  43. azul_bedrock-9.0.32/azul_bedrock.egg-info/requires.txt +26 -0
  44. azul_bedrock-9.0.32/azul_bedrock.egg-info/top_level.txt +1 -0
  45. azul_bedrock-9.0.32/debian.txt +1 -0
  46. azul_bedrock-9.0.32/docker-compose.yaml +16 -0
  47. azul_bedrock-9.0.32/docs/go-runner.md +229 -0
  48. azul_bedrock-9.0.32/go.mod +74 -0
  49. azul_bedrock-9.0.32/go.sum +163 -0
  50. azul_bedrock-9.0.32/gosrc/cart/cart.go +316 -0
  51. azul_bedrock-9.0.32/gosrc/cart/cart_test.go +69 -0
  52. azul_bedrock-9.0.32/gosrc/client/client.go +98 -0
  53. azul_bedrock-9.0.32/gosrc/client/client_test.go +271 -0
  54. azul_bedrock-9.0.32/gosrc/client/events.go +347 -0
  55. azul_bedrock-9.0.32/gosrc/client/getevents/parameters.go +37 -0
  56. azul_bedrock-9.0.32/gosrc/client/interface.go +34 -0
  57. azul_bedrock-9.0.32/gosrc/client/mock_ClientInterface.go +1117 -0
  58. azul_bedrock-9.0.32/gosrc/client/postevents/parameters.go +11 -0
  59. azul_bedrock-9.0.32/gosrc/client/poststreams/parameters.go +7 -0
  60. azul_bedrock-9.0.32/gosrc/client/streams.go +216 -0
  61. azul_bedrock-9.0.32/gosrc/embeded_files.go +8 -0
  62. azul_bedrock-9.0.32/gosrc/events/avro.go +211 -0
  63. azul_bedrock-9.0.32/gosrc/events/avro_generate_test.go +28 -0
  64. azul_bedrock-9.0.32/gosrc/events/avro_test.go +32 -0
  65. azul_bedrock-9.0.32/gosrc/events/benchmark_test.go +59 -0
  66. azul_bedrock-9.0.32/gosrc/events/event.go +82 -0
  67. azul_bedrock-9.0.32/gosrc/events/event_binary.go +478 -0
  68. azul_bedrock-9.0.32/gosrc/events/event_binary_actions.go +81 -0
  69. azul_bedrock-9.0.32/gosrc/events/event_binary_datastream_labels.go +80 -0
  70. azul_bedrock-9.0.32/gosrc/events/event_binary_feature_types.go +17 -0
  71. azul_bedrock-9.0.32/gosrc/events/event_binary_test.go +368 -0
  72. azul_bedrock-9.0.32/gosrc/events/event_delete.go +169 -0
  73. azul_bedrock-9.0.32/gosrc/events/event_delete_test.go +56 -0
  74. azul_bedrock-9.0.32/gosrc/events/event_download.go +139 -0
  75. azul_bedrock-9.0.32/gosrc/events/event_download_test.go +22 -0
  76. azul_bedrock-9.0.32/gosrc/events/event_insert.go +129 -0
  77. azul_bedrock-9.0.32/gosrc/events/event_insert_test.go +45 -0
  78. azul_bedrock-9.0.32/gosrc/events/event_models.go +69 -0
  79. azul_bedrock-9.0.32/gosrc/events/event_plugin.go +118 -0
  80. azul_bedrock-9.0.32/gosrc/events/event_plugin_test.go +20 -0
  81. azul_bedrock-9.0.32/gosrc/events/event_retrohunt.go +129 -0
  82. azul_bedrock-9.0.32/gosrc/events/event_status.go +118 -0
  83. azul_bedrock-9.0.32/gosrc/events/event_status_test.go +21 -0
  84. azul_bedrock-9.0.32/gosrc/events/event_status_types.go +78 -0
  85. azul_bedrock-9.0.32/gosrc/events/event_status_types_test.go +43 -0
  86. azul_bedrock-9.0.32/gosrc/events/event_test.go +448 -0
  87. azul_bedrock-9.0.32/gosrc/events/schemas/readme.md +29 -0
  88. azul_bedrock-9.0.32/gosrc/events/schemas/v4/0_support.json +93 -0
  89. azul_bedrock-9.0.32/gosrc/events/schemas/v4/1_binary.json +163 -0
  90. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_delete.json +82 -0
  91. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_download.json +34 -0
  92. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_insert.json +34 -0
  93. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_plugin.json +51 -0
  94. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_retrohunt.json +16 -0
  95. azul_bedrock-9.0.32/gosrc/events/schemas/v4/2_status.json +34 -0
  96. azul_bedrock-9.0.32/gosrc/events/schemas/v4/3_collections.json +60 -0
  97. azul_bedrock-9.0.32/gosrc/events/schemas/v4/readme.md +7 -0
  98. azul_bedrock-9.0.32/gosrc/events/schemas/v5/0_support.json +98 -0
  99. azul_bedrock-9.0.32/gosrc/events/schemas/v5/1_binary.json +163 -0
  100. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_delete.json +82 -0
  101. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_download.json +34 -0
  102. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_insert.json +34 -0
  103. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_plugin.json +51 -0
  104. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_retrohunt.json +16 -0
  105. azul_bedrock-9.0.32/gosrc/events/schemas/v5/2_status.json +34 -0
  106. azul_bedrock-9.0.32/gosrc/events/schemas/v5/3_collections.json +67 -0
  107. azul_bedrock-9.0.32/gosrc/events/schemas/v5/readme.md +7 -0
  108. azul_bedrock-9.0.32/gosrc/identify/identify.go +673 -0
  109. azul_bedrock-9.0.32/gosrc/identify/identify_test.go +102 -0
  110. azul_bedrock-9.0.32/gosrc/identify/identify_test.yaml +654 -0
  111. azul_bedrock-9.0.32/gosrc/identify/magic.go +121 -0
  112. azul_bedrock-9.0.32/gosrc/identify/main_test.go +33 -0
  113. azul_bedrock-9.0.32/gosrc/identify/trusted_mime.yaml +214 -0
  114. azul_bedrock-9.0.32/gosrc/identify/yara_rules.yar +1177 -0
  115. azul_bedrock-9.0.32/gosrc/identify.yaml +761 -0
  116. azul_bedrock-9.0.32/gosrc/legacy_identify/legacy_mapper.go +48 -0
  117. azul_bedrock-9.0.32/gosrc/legacy_identify/legacy_mapper_test.go +26 -0
  118. azul_bedrock-9.0.32/gosrc/models/deployed_plugin.go +9 -0
  119. azul_bedrock-9.0.32/gosrc/models/restapi.go +51 -0
  120. azul_bedrock-9.0.32/gosrc/models/restapi_test.go +39 -0
  121. azul_bedrock-9.0.32/gosrc/models/sources.go +101 -0
  122. azul_bedrock-9.0.32/gosrc/models/sources_test.go +63 -0
  123. azul_bedrock-9.0.32/gosrc/msginflight/conversion_avro.go +76 -0
  124. azul_bedrock-9.0.32/gosrc/msginflight/conversion_avro_bulk.go +229 -0
  125. azul_bedrock-9.0.32/gosrc/msginflight/conversion_json.go +73 -0
  126. azul_bedrock-9.0.32/gosrc/msginflight/msg_in_flight.go +92 -0
  127. azul_bedrock-9.0.32/gosrc/msginflight/msg_in_flight_test.go +119 -0
  128. azul_bedrock-9.0.32/gosrc/msginflight/test_data_generator.go +251 -0
  129. azul_bedrock-9.0.32/gosrc/plugin/error_types.go +92 -0
  130. azul_bedrock-9.0.32/gosrc/plugin/job.go +577 -0
  131. azul_bedrock-9.0.32/gosrc/plugin/job_event.go +305 -0
  132. azul_bedrock-9.0.32/gosrc/plugin/job_event_test.go +173 -0
  133. azul_bedrock-9.0.32/gosrc/plugin/job_test.go +337 -0
  134. azul_bedrock-9.0.32/gosrc/plugin/logger.go +39 -0
  135. azul_bedrock-9.0.32/gosrc/plugin/runner.go +415 -0
  136. azul_bedrock-9.0.32/gosrc/plugin/runner_test.go +440 -0
  137. azul_bedrock-9.0.32/gosrc/plugin/runner_test_run_test.go +238 -0
  138. azul_bedrock-9.0.32/gosrc/plugin/settings.go +233 -0
  139. azul_bedrock-9.0.32/gosrc/plugin/settings_test.go +53 -0
  140. azul_bedrock-9.0.32/gosrc/plugin/test_generators.go +111 -0
  141. azul_bedrock-9.0.32/gosrc/plugin/test_template.go +255 -0
  142. azul_bedrock-9.0.32/gosrc/settings/bytes_hook.go +153 -0
  143. azul_bedrock-9.0.32/gosrc/settings/bytes_hook_test.go +51 -0
  144. azul_bedrock-9.0.32/gosrc/settings/init.go +104 -0
  145. azul_bedrock-9.0.32/gosrc/settings/parser.go +101 -0
  146. azul_bedrock-9.0.32/gosrc/settings/parser_test.go +77 -0
  147. azul_bedrock-9.0.32/gosrc/store/parent_stream_closer.go +24 -0
  148. azul_bedrock-9.0.32/gosrc/store/store.go +185 -0
  149. azul_bedrock-9.0.32/gosrc/store/store_azure.go +430 -0
  150. azul_bedrock-9.0.32/gosrc/store/store_azure_test.go +30 -0
  151. azul_bedrock-9.0.32/gosrc/store/store_cache.go +182 -0
  152. azul_bedrock-9.0.32/gosrc/store/store_cache_test.go +158 -0
  153. azul_bedrock-9.0.32/gosrc/store/store_filesystem.go +235 -0
  154. azul_bedrock-9.0.32/gosrc/store/store_filesystem_test.go +48 -0
  155. azul_bedrock-9.0.32/gosrc/store/store_interface_tests.go +391 -0
  156. azul_bedrock-9.0.32/gosrc/store/store_mem.go +150 -0
  157. azul_bedrock-9.0.32/gosrc/store/store_mem_test.go +130 -0
  158. azul_bedrock-9.0.32/gosrc/store/store_mock.go +392 -0
  159. azul_bedrock-9.0.32/gosrc/store/store_s3.go +419 -0
  160. azul_bedrock-9.0.32/gosrc/store/store_s3_auto_ageoff.go +160 -0
  161. azul_bedrock-9.0.32/gosrc/store/store_s3_test.go +132 -0
  162. azul_bedrock-9.0.32/gosrc/store/store_xor.go +235 -0
  163. azul_bedrock-9.0.32/gosrc/store/store_xor_test.go +154 -0
  164. azul_bedrock-9.0.32/gosrc/testdata/testdata.go +62 -0
  165. azul_bedrock-9.0.32/gosrc/testutils/file_manager.go +220 -0
  166. azul_bedrock-9.0.32/gosrc/testutils/file_manager_settings.go +52 -0
  167. azul_bedrock-9.0.32/gosrc/testutils/file_manager_test.go +141 -0
  168. azul_bedrock-9.0.32/gosrc/testutils/storage_client.go +122 -0
  169. azul_bedrock-9.0.32/license.md +9 -0
  170. azul_bedrock-9.0.32/pipeline-mirror.yaml +25 -0
  171. azul_bedrock-9.0.32/pipeline.yaml +37 -0
  172. azul_bedrock-9.0.32/pyproject.toml +39 -0
  173. azul_bedrock-9.0.32/requirements.txt +10 -0
  174. azul_bedrock-9.0.32/requirements_tests.txt +6 -0
  175. azul_bedrock-9.0.32/setup.cfg +4 -0
  176. azul_bedrock-9.0.32/setup.py +48 -0
  177. azul_bedrock-9.0.32/test_integration.sh +21 -0
  178. azul_bedrock-9.0.32/testdata/cart/README.md +13 -0
  179. azul_bedrock-9.0.32/testdata/cart/text-long.txt +795 -0
  180. azul_bedrock-9.0.32/testdata/cart/text-long.txt.cart +0 -0
  181. azul_bedrock-9.0.32/testdata/cart/text.txt +1 -0
  182. azul_bedrock-9.0.32/testdata/cart/text.txt.cart +0 -0
  183. azul_bedrock-9.0.32/testdata/events/api/get_events/valid.events.json +69 -0
  184. azul_bedrock-9.0.32/testdata/events/api/get_events/valid.info.json +6 -0
  185. azul_bedrock-9.0.32/testdata/events/binary/augmented.json +106 -0
  186. azul_bedrock-9.0.32/testdata/events/binary/augmented.json.avro +0 -0
  187. azul_bedrock-9.0.32/testdata/events/binary/augmented_no_extra.json +94 -0
  188. azul_bedrock-9.0.32/testdata/events/binary/augmented_no_extra.json.avro +0 -0
  189. azul_bedrock-9.0.32/testdata/events/binary/bulk.json +179 -0
  190. azul_bedrock-9.0.32/testdata/events/binary/bulk.json.avro +0 -0
  191. azul_bedrock-9.0.32/testdata/events/binary/enriched.json +80 -0
  192. azul_bedrock-9.0.32/testdata/events/binary/enriched.json.avro +0 -0
  193. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_data.json +94 -0
  194. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_data.json.avro +0 -0
  195. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_info_dict.json +83 -0
  196. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_info_dict.json.avro +0 -0
  197. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_info_list.json +81 -0
  198. azul_bedrock-9.0.32/testdata/events/binary/enriched_w_info_list.json.avro +0 -0
  199. azul_bedrock-9.0.32/testdata/events/binary/extracted.json +97 -0
  200. azul_bedrock-9.0.32/testdata/events/binary/extracted.json.avro +0 -0
  201. azul_bedrock-9.0.32/testdata/events/binary/invalid_path.json +80 -0
  202. azul_bedrock-9.0.32/testdata/events/binary/invalid_path.json.avro +0 -0
  203. azul_bedrock-9.0.32/testdata/events/binary/mapped_w_non_content_data.json +64 -0
  204. azul_bedrock-9.0.32/testdata/events/binary/v4/augmented.json +106 -0
  205. azul_bedrock-9.0.32/testdata/events/binary/v4/augmented.json.avro +0 -0
  206. azul_bedrock-9.0.32/testdata/events/binary/v4/augmented_no_extra.json +94 -0
  207. azul_bedrock-9.0.32/testdata/events/binary/v4/augmented_no_extra.json.avro +0 -0
  208. azul_bedrock-9.0.32/testdata/events/binary/v4/bulk.json +179 -0
  209. azul_bedrock-9.0.32/testdata/events/binary/v4/bulk.json.avro +0 -0
  210. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched.json +80 -0
  211. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched.json.avro +0 -0
  212. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_data.json +94 -0
  213. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_data.json.avro +0 -0
  214. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_info_dict.json +83 -0
  215. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_info_dict.json.avro +0 -0
  216. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_info_list.json +81 -0
  217. azul_bedrock-9.0.32/testdata/events/binary/v4/enriched_w_info_list.json.avro +0 -0
  218. azul_bedrock-9.0.32/testdata/events/binary/v4/extracted.json +97 -0
  219. azul_bedrock-9.0.32/testdata/events/binary/v4/extracted.json.avro +0 -0
  220. azul_bedrock-9.0.32/testdata/events/binary/v4/invalid_path.json +80 -0
  221. azul_bedrock-9.0.32/testdata/events/binary/v4/invalid_path.json.avro +0 -0
  222. azul_bedrock-9.0.32/testdata/events/binary/v4/mapped_w_non_content_data.json +64 -0
  223. azul_bedrock-9.0.32/testdata/events/delete/author.json +21 -0
  224. azul_bedrock-9.0.32/testdata/events/delete/author.json.avro +0 -0
  225. azul_bedrock-9.0.32/testdata/events/delete/bulk.json +45 -0
  226. azul_bedrock-9.0.32/testdata/events/delete/bulk.json.avro +0 -0
  227. azul_bedrock-9.0.32/testdata/events/delete/link.json +20 -0
  228. azul_bedrock-9.0.32/testdata/events/delete/link.json.avro +0 -0
  229. azul_bedrock-9.0.32/testdata/events/delete/submission-complex.json +21 -0
  230. azul_bedrock-9.0.32/testdata/events/delete/submission-complex.json.avro +0 -0
  231. azul_bedrock-9.0.32/testdata/events/delete/submission-simple.json +20 -0
  232. azul_bedrock-9.0.32/testdata/events/delete/submission-simple.json.avro +0 -0
  233. azul_bedrock-9.0.32/testdata/events/delete/v4/author.json +21 -0
  234. azul_bedrock-9.0.32/testdata/events/delete/v4/author.json.avro +0 -0
  235. azul_bedrock-9.0.32/testdata/events/delete/v4/bulk.json +45 -0
  236. azul_bedrock-9.0.32/testdata/events/delete/v4/bulk.json.avro +0 -0
  237. azul_bedrock-9.0.32/testdata/events/delete/v4/link.json +20 -0
  238. azul_bedrock-9.0.32/testdata/events/delete/v4/link.json.avro +0 -0
  239. azul_bedrock-9.0.32/testdata/events/delete/v4/submission-complex.json +21 -0
  240. azul_bedrock-9.0.32/testdata/events/delete/v4/submission-complex.json.avro +0 -0
  241. azul_bedrock-9.0.32/testdata/events/delete/v4/submission-simple.json +20 -0
  242. azul_bedrock-9.0.32/testdata/events/delete/v4/submission-simple.json.avro +0 -0
  243. azul_bedrock-9.0.32/testdata/events/download/bulk.json +111 -0
  244. azul_bedrock-9.0.32/testdata/events/download/bulk.json.avro +0 -0
  245. azul_bedrock-9.0.32/testdata/events/download/example1.json +54 -0
  246. azul_bedrock-9.0.32/testdata/events/download/example1.json.avro +0 -0
  247. azul_bedrock-9.0.32/testdata/events/download/v4/bulk.json +111 -0
  248. azul_bedrock-9.0.32/testdata/events/download/v4/bulk.json.avro +0 -0
  249. azul_bedrock-9.0.32/testdata/events/download/v4/example1.json +54 -0
  250. azul_bedrock-9.0.32/testdata/events/download/v4/example1.json.avro +0 -0
  251. azul_bedrock-9.0.32/testdata/events/entityLarge.json +256 -0
  252. azul_bedrock-9.0.32/testdata/events/entitySmall.json +55 -0
  253. azul_bedrock-9.0.32/testdata/events/insert/bulk.json +65 -0
  254. azul_bedrock-9.0.32/testdata/events/insert/bulk.json.avro +0 -0
  255. azul_bedrock-9.0.32/testdata/events/insert/example1.json +30 -0
  256. azul_bedrock-9.0.32/testdata/events/insert/example1.json.avro +0 -0
  257. azul_bedrock-9.0.32/testdata/events/insert/v4/bulk.json +65 -0
  258. azul_bedrock-9.0.32/testdata/events/insert/v4/bulk.json.avro +0 -0
  259. azul_bedrock-9.0.32/testdata/events/insert/v4/example1.json +30 -0
  260. azul_bedrock-9.0.32/testdata/events/insert/v4/example1.json.avro +0 -0
  261. azul_bedrock-9.0.32/testdata/events/plugin/bulk.json +69 -0
  262. azul_bedrock-9.0.32/testdata/events/plugin/bulk.json.avro +0 -0
  263. azul_bedrock-9.0.32/testdata/events/plugin/example1.json +32 -0
  264. azul_bedrock-9.0.32/testdata/events/plugin/example1.json.avro +0 -0
  265. azul_bedrock-9.0.32/testdata/events/plugin/v4/bulk.json +69 -0
  266. azul_bedrock-9.0.32/testdata/events/plugin/v4/bulk.json.avro +0 -0
  267. azul_bedrock-9.0.32/testdata/events/plugin/v4/example1.json +32 -0
  268. azul_bedrock-9.0.32/testdata/events/plugin/v4/example1.json.avro +0 -0
  269. azul_bedrock-9.0.32/testdata/events/retrohunt/bulk.json +81 -0
  270. azul_bedrock-9.0.32/testdata/events/retrohunt/bulk.json.avro +0 -0
  271. azul_bedrock-9.0.32/testdata/events/retrohunt/example1.json +38 -0
  272. azul_bedrock-9.0.32/testdata/events/retrohunt/example1.json.avro +0 -0
  273. azul_bedrock-9.0.32/testdata/events/retrohunt/v4/bulk.json +81 -0
  274. azul_bedrock-9.0.32/testdata/events/retrohunt/v4/bulk.json.avro +0 -0
  275. azul_bedrock-9.0.32/testdata/events/retrohunt/v4/example1.json +38 -0
  276. azul_bedrock-9.0.32/testdata/events/retrohunt/v4/example1.json.avro +0 -0
  277. azul_bedrock-9.0.32/testdata/events/sanity.json +32 -0
  278. azul_bedrock-9.0.32/testdata/events/speed/status.json +197 -0
  279. azul_bedrock-9.0.32/testdata/events/speed/status.json.avro +0 -0
  280. azul_bedrock-9.0.32/testdata/events/speed/v4/status.json +197 -0
  281. azul_bedrock-9.0.32/testdata/events/speed/v4/status.json.avro +0 -0
  282. azul_bedrock-9.0.32/testdata/events/status/bulk.json +367 -0
  283. azul_bedrock-9.0.32/testdata/events/status/bulk.json.avro +0 -0
  284. azul_bedrock-9.0.32/testdata/events/status/example1.json +227 -0
  285. azul_bedrock-9.0.32/testdata/events/status/example1.json.avro +0 -0
  286. azul_bedrock-9.0.32/testdata/events/status/v4/bulk.json +366 -0
  287. azul_bedrock-9.0.32/testdata/events/status/v4/bulk.json.avro +0 -0
  288. azul_bedrock-9.0.32/testdata/events/status/v4/example1.json +227 -0
  289. azul_bedrock-9.0.32/testdata/events/status/v4/example1.json.avro +0 -0
  290. azul_bedrock-9.0.32/testdata/sources/sources1.yaml +163 -0
  291. azul_bedrock-9.0.32/testdata/sources/sources_bad_expiry_inner_spaces.yaml +3 -0
  292. azul_bedrock-9.0.32/testdata/sources/sources_bad_expiry_no_number.yaml +3 -0
  293. azul_bedrock-9.0.32/testdata/sources/sources_bad_expiry_outer_spaces_lead.yaml +3 -0
  294. azul_bedrock-9.0.32/testdata/sources/sources_bad_expiry_outer_spaces_trail.yaml +3 -0
  295. azul_bedrock-9.0.32/testdata/store/random-long-text-file.txt +457 -0
  296. azul_bedrock-9.0.32/tests/__init__.py +0 -0
  297. azul_bedrock-9.0.32/tests/integration/__init__.py +0 -0
  298. azul_bedrock-9.0.32/tests/integration/test_file_manager.py +227 -0
  299. azul_bedrock-9.0.32/tests/unit/__init__.py +0 -0
  300. azul_bedrock-9.0.32/tests/unit/identify_test.yaml +654 -0
  301. azul_bedrock-9.0.32/tests/unit/test_dispatcher.py +823 -0
  302. azul_bedrock-9.0.32/tests/unit/test_exceptions.py +12 -0
  303. azul_bedrock-9.0.32/tests/unit/test_identify.py +139 -0
  304. azul_bedrock-9.0.32/tests/unit/test_models_api.py +8 -0
  305. azul_bedrock-9.0.32/tests/unit/test_models_auth.py +9 -0
  306. azul_bedrock-9.0.32/tests/unit/test_models_network.py +366 -0
  307. azul_bedrock-9.0.32/tests/unit/test_models_network_comms.py +680 -0
  308. azul_bedrock-9.0.32/tests/unit/test_models_settings.py +102 -0
  309. azul_bedrock-9.0.32/tox.ini +79 -0
@@ -0,0 +1,25 @@
1
+ # Check http://editorconfig.org for more information
2
+ # This is the main config file for this project:
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ indent_style = space
10
+ indent_size = 2
11
+ trim_trailing_whitespace = true
12
+
13
+ [*.{py, pyi}]
14
+ indent_style = space
15
+ indent_size = 4
16
+ max_line_length = 119
17
+
18
+ [Makefile]
19
+ indent_style = tab
20
+
21
+ [*.md]
22
+ trim_trailing_whitespace = true
23
+
24
+ [*.{diff,patch}]
25
+ trim_trailing_whitespace = false
@@ -0,0 +1 @@
1
+ * @AustralianCyberSecurityCentre/azul-admins
@@ -0,0 +1,274 @@
1
+ yara/
2
+ # Created by https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode,intellij+all
3
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,vim,visualstudiocode,intellij+all
4
+
5
+ ### Intellij+all ###
6
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8
+
9
+ # User-specific stuff
10
+ .idea/**/workspace.xml
11
+ .idea/**/tasks.xml
12
+ .idea/**/usage.statistics.xml
13
+ .idea/**/dictionaries
14
+ .idea/**/shelf
15
+
16
+ # AWS User-specific
17
+ .idea/**/aws.xml
18
+
19
+ # Generated files
20
+ .idea/**/contentModel.xml
21
+
22
+ # Sensitive or high-churn files
23
+ .idea/**/dataSources/
24
+ .idea/**/dataSources.ids
25
+ .idea/**/dataSources.local.xml
26
+ .idea/**/sqlDataSources.xml
27
+ .idea/**/dynamic.xml
28
+ .idea/**/uiDesigner.xml
29
+ .idea/**/dbnavigator.xml
30
+
31
+ # Gradle
32
+ .idea/**/gradle.xml
33
+ .idea/**/libraries
34
+
35
+ # Gradle and Maven with auto-import
36
+ # When using Gradle or Maven with auto-import, you should exclude module files,
37
+ # since they will be recreated, and may cause churn. Uncomment if using
38
+ # auto-import.
39
+ # .idea/artifacts
40
+ # .idea/compiler.xml
41
+ # .idea/jarRepositories.xml
42
+ # .idea/modules.xml
43
+ # .idea/*.iml
44
+ # .idea/modules
45
+ # *.iml
46
+ # *.ipr
47
+
48
+ # CMake
49
+ cmake-build-*/
50
+
51
+ # Mongo Explorer plugin
52
+ .idea/**/mongoSettings.xml
53
+
54
+ # File-based project format
55
+ *.iws
56
+
57
+ # IntelliJ
58
+ out/
59
+
60
+ # mpeltonen/sbt-idea plugin
61
+ .idea_modules/
62
+
63
+ # JIRA plugin
64
+ atlassian-ide-plugin.xml
65
+
66
+ # Cursive Clojure plugin
67
+ .idea/replstate.xml
68
+
69
+ # Crashlytics plugin (for Android Studio and IntelliJ)
70
+ com_crashlytics_export_strings.xml
71
+ crashlytics.properties
72
+ crashlytics-build.properties
73
+ fabric.properties
74
+
75
+ # Editor-based Rest Client
76
+ .idea/httpRequests
77
+
78
+ # Android studio 3.1+ serialized cache file
79
+ .idea/caches/build_file_checksums.ser
80
+
81
+ ### Intellij+all Patch ###
82
+ # Ignores the whole .idea folder and all .iml files
83
+ # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
84
+
85
+ .idea/
86
+
87
+ # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
88
+
89
+ *.iml
90
+ modules.xml
91
+ .idea/misc.xml
92
+ *.ipr
93
+
94
+ # Sonarlint plugin
95
+ .idea/sonarlint
96
+
97
+ ### Python ###
98
+ # Byte-compiled / optimized / DLL files
99
+ __pycache__/
100
+ *.py[cod]
101
+ *$py.class
102
+
103
+ # C extensions
104
+ *.so
105
+
106
+ # Distribution / packaging
107
+ .Python
108
+ build/
109
+ develop-eggs/
110
+ dist/
111
+ downloads/
112
+ eggs/
113
+ .eggs/
114
+ lib/
115
+ lib64/
116
+ parts/
117
+ sdist/
118
+ var/
119
+ wheels/
120
+ share/python-wheels/
121
+ *.egg-info/
122
+ .installed.cfg
123
+ *.egg
124
+ MANIFEST
125
+
126
+ # PyInstaller
127
+ # Usually these files are written by a python script from a template
128
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
129
+ *.manifest
130
+ *.spec
131
+
132
+ # Installer logs
133
+ pip-log.txt
134
+ pip-delete-this-directory.txt
135
+
136
+ # Unit test / coverage reports
137
+ htmlcov/
138
+ .tox/
139
+ .nox/
140
+ .coverage
141
+ .coverage.*
142
+ .cache
143
+ nosetests.xml
144
+ coverage.xml
145
+ *.cover
146
+ *.py,cover
147
+ .hypothesis/
148
+ .pytest_cache/
149
+ cover/
150
+
151
+ # Translations
152
+ *.mo
153
+ *.pot
154
+
155
+ # Django stuff:
156
+ *.log
157
+ local_settings.py
158
+ db.sqlite3
159
+ db.sqlite3-journal
160
+
161
+ # Flask stuff:
162
+ instance/
163
+ .webassets-cache
164
+
165
+ # Scrapy stuff:
166
+ .scrapy
167
+
168
+ # Sphinx documentation
169
+ docs/_build/
170
+
171
+ # PyBuilder
172
+ .pybuilder/
173
+ target/
174
+
175
+ # Jupyter Notebook
176
+ .ipynb_checkpoints
177
+
178
+ # IPython
179
+ profile_default/
180
+ ipython_config.py
181
+
182
+ # pyenv
183
+ # For a library or package, you might want to ignore these files since the code is
184
+ # intended to run in multiple environments; otherwise, check them in:
185
+ # .python-version
186
+
187
+ # pipenv
188
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
189
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
190
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
191
+ # install all needed dependencies.
192
+ #Pipfile.lock
193
+
194
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
195
+ __pypackages__/
196
+
197
+ # Celery stuff
198
+ celerybeat-schedule
199
+ celerybeat.pid
200
+
201
+ # SageMath parsed files
202
+ *.sage.py
203
+
204
+ # Environments
205
+ .env
206
+ .venv
207
+ env/
208
+ venv/
209
+ ENV/
210
+ env.bak/
211
+ venv.bak/
212
+
213
+ # Spyder project settings
214
+ .spyderproject
215
+ .spyproject
216
+
217
+ # Rope project settings
218
+ .ropeproject
219
+
220
+ # mkdocs documentation
221
+ /site
222
+
223
+ # mypy
224
+ .mypy_cache/
225
+ .dmypy.json
226
+ dmypy.json
227
+
228
+ # Pyre type checker
229
+ .pyre/
230
+
231
+ # pytype static type analyzer
232
+ .pytype/
233
+
234
+ # Cython debug symbols
235
+ cython_debug/
236
+
237
+ ### Vim ###
238
+ # Swap
239
+ [._]*.s[a-v][a-z]
240
+ !*.svg # comment out if you don't need vector files
241
+ [._]*.sw[a-p]
242
+ [._]s[a-rt-v][a-z]
243
+ [._]ss[a-gi-z]
244
+ [._]sw[a-p]
245
+
246
+ # Session
247
+ Session.vim
248
+ Sessionx.vim
249
+
250
+ # Temporary
251
+ .netrwhist
252
+ *~
253
+ # Auto-generated tag files
254
+ tags
255
+ # Persistent undo
256
+ [._]*.un~
257
+
258
+ ### VisualStudioCode ###
259
+ .vscode/*
260
+ #!.vscode/settings.json
261
+ #!.vscode/tasks.json
262
+ #!.vscode/launch.json
263
+ #!.vscode/extensions.json
264
+ *.code-workspace
265
+
266
+ # Local History for Visual Studio Code
267
+ .history/
268
+
269
+ ### VisualStudioCode Patch ###
270
+ # Ignore all local history of files
271
+ .history
272
+ .ionide
273
+
274
+ # End of https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode,intellij+all
@@ -0,0 +1,32 @@
1
+ version: "2"
2
+ run:
3
+ tests: false
4
+ linters:
5
+ exclusions:
6
+ generated: lax
7
+ presets:
8
+ - comments
9
+ - common-false-positives
10
+ - legacy
11
+ - std-error-handling
12
+ paths:
13
+ - third_party$
14
+ - builtin$
15
+ - examples$
16
+ rules:
17
+ # Ignore forcing switch statements everywhere there is an if else statement
18
+ - linters:
19
+ - staticcheck
20
+ text: "QF1003:"
21
+ formatters:
22
+ exclusions:
23
+ generated: lax
24
+ paths:
25
+ - third_party$
26
+ - builtin$
27
+ - examples$
28
+ enable:
29
+ # - gci
30
+ - gofmt
31
+ # - gofumpt
32
+ - goimports
@@ -0,0 +1,23 @@
1
+ with-expecter: true
2
+ packages:
3
+ github.com/AustralianCyberSecurityCentre/azul-bedrock/v9/gosrc/store:
4
+ # place your package-specific config here
5
+ config:
6
+ inpackage: true
7
+ dir: "{{.InterfaceDir}}"
8
+ interfaces:
9
+ # select the interfaces you want mocked
10
+ FileStorage:
11
+ # Modify package-level config for this specific interface (if applicable)
12
+ config:
13
+ filename: store_mock.go
14
+ github.com/AustralianCyberSecurityCentre/azul-bedrock/v9/gosrc/client:
15
+ # place your package-specific config here
16
+ config:
17
+ inpackage: true
18
+ dir: "{{.InterfaceDir}}"
19
+ interfaces:
20
+ # select the interfaces you want mocked
21
+ ClientInterface:
22
+ # Modify package-level config for this specific interface (if applicable)
23
+ config:
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.4
2
+ Name: azul-bedrock
3
+ Version: 9.0.32
4
+ Summary: Shared library for Azul models and operations.
5
+ Home-page: https://www.asd.gov.au/
6
+ Author: Azul
7
+ Author-email: azul@asd.gov.au
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: cachetools
20
+ Requires-Dist: fastapi
21
+ Requires-Dist: httpx
22
+ Requires-Dist: multipart
23
+ Requires-Dist: pendulum
24
+ Requires-Dist: pydantic
25
+ Requires-Dist: python-magic>=0.4.15
26
+ Requires-Dist: pyyaml
27
+ Requires-Dist: starlette
28
+ Requires-Dist: yara-python
29
+ Provides-Extra: mock
30
+ Requires-Dist: cart; extra == "mock"
31
+ Requires-Dist: fastapi[all]>=0.60.0; extra == "mock"
32
+ Requires-Dist: azure-storage-blob; extra == "mock"
33
+ Requires-Dist: pytest; extra == "mock"
34
+ Requires-Dist: tox; extra == "mock"
35
+ Requires-Dist: urllib3; extra == "mock"
36
+ Provides-Extra: test-utils
37
+ Requires-Dist: cart; extra == "test-utils"
38
+ Requires-Dist: fastapi[all]>=0.60.0; extra == "test-utils"
39
+ Requires-Dist: azure-storage-blob; extra == "test-utils"
40
+ Requires-Dist: pytest; extra == "test-utils"
41
+ Requires-Dist: tox; extra == "test-utils"
42
+ Requires-Dist: urllib3; extra == "test-utils"
43
+ Dynamic: author
44
+ Dynamic: author-email
45
+ Dynamic: classifier
46
+ Dynamic: description
47
+ Dynamic: description-content-type
48
+ Dynamic: home-page
49
+ Dynamic: provides-extra
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+ # Azul Restapi Common
55
+
56
+ Shared library for Azul models and operations.
57
+
58
+ ## Design
59
+
60
+ The models are not in a nested folder as this gives nicer import names.
61
+
62
+ e.g.
63
+
64
+ ```python
65
+ # much clearer naming of models on import, prevents confusion
66
+ from azul_thingo import api
67
+ from azul_bedrock import model_api
68
+
69
+ api.send_thingo(model_api.Thingo())
70
+
71
+ # annoying and depends on developer, likely will fragment into different names on import
72
+ from azul_thingo import api
73
+ from azul_bedrock.models import api as mapi
74
+
75
+ api.send_thingo(mapi.Thingo())
76
+ ```
77
+
78
+ ## Requirements
79
+
80
+ ### libmagic
81
+
82
+ # default libmagic for debian can get out of date
83
+ contains a number of bugs for office and archive file types
84
+
85
+ ```bash
86
+ git clone --depth 1 --branch FILE5_46 https://github.com/file/file
87
+ cd file/
88
+ autoreconf -f -i
89
+ ./configure --disable-silent-rules
90
+ make -j4
91
+ sudo make install
92
+ sudo cp ./magic/magic.mgc /etc/magic
93
+ cd -
94
+ # check it worked
95
+ file --version
96
+ ```
97
+
98
+ ### yara
99
+
100
+ ```bash
101
+ sudo apt-get install automake libtool make gcc pkg-config git flex bison -y
102
+ mkdir -p ./yara
103
+ git clone --branch v4.3.2 https://github.com/VirusTotal/yara ./yara
104
+ cd ./yara
105
+ ./bootstrap.sh
106
+ ./configure
107
+ make
108
+ sudo make install
109
+ cd -
110
+ ## check it worked
111
+ yara -v
112
+ ```
113
+
114
+ ```bash
115
+ # you should put this in bashrc
116
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
117
+ ```
118
+
119
+ ## Install
120
+
121
+ ```bash
122
+ pip install azul-bedrock
123
+ ```
124
+
125
+ ## Mocks
126
+
127
+ Using Mockery to generate mocks for golang client.
128
+
129
+ This is for use in upstream packages.
130
+
131
+ ```bash
132
+ go install github.com/vektra/mockery/v2@v2.53.5
133
+ mockery
134
+ ```
135
+
136
+ ## Test Files
137
+
138
+ To run tests based off of bedrock you will need to set environment variables to allow you to download and use test files.
139
+
140
+ This requires you to be able to download files from Virustotal.
141
+ To save on download quotas files are also cached to an S3 cluster and your local file system.
142
+
143
+ The full set of environment variables for configuring this setup are here:
144
+
145
+ ```bash
146
+ # Timeout for requests made by the file manager.
147
+ export file_manager_request_timeout: int = 30
148
+ # The URL to Virustotal's V3 API (guarantee no trailing slash).
149
+ export file_manager_virustotal_api_url="https://www.virustotal.com/api/v3"
150
+ # Virustotal API key used to download files from Virustotal
151
+ export file_manager_virustotal_api_key = ""
152
+ # whether to attempt to download files from virustotal or not.
153
+ export file_manager_virustotal_enabled="True"
154
+ # Directory where files are cached on the local file system when downloaded. (stored as carts)
155
+ export file_manager_file_cache_dir="/var/tmp/azul"
156
+ # Flag used to enable/disable the caching of test files.
157
+ export file_manager_file_caching_enabled="True"
158
+ # URL from Azure storage blob (storage account name address)
159
+ export file_manager_azure_storage_account_address=""
160
+ # Storage account Access key. (SAS key) used to access the azure storage.
161
+ export file_manager_azure_storage_access_key=""
162
+ # Name of the storage container within the blob storage.
163
+ export file_manager_azure_container_name="azul-test-file-cache"
164
+ # Flag used to enable/disable bucket caching.
165
+ export file_manager_azure_blob_cache_enabled="True"
166
+ ```
167
+
168
+ It is recommended when you set these environment variables you add them to your `~/.bashrc` as it makes it easier when running tests.
169
+
170
+ ## Avro Schema changes
171
+
172
+ If you modify the Avro schema you need to ensure you consider legal schema changes to maintain backwards compatibility.
173
+
174
+ Refer here for a guide: https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types
175
+
176
+ Azul must maintain BACKWARD_TRANSITIVE compatibility at all times with it's avro models.
177
+ This means fields can be deleted from the schema and OPTIONAL fields added.
178
+
179
+ If this is not achievable for a change the model version must be incremented and an upgrade path for old events needs to
180
+ be added to `msginflight/conversion_avro.go` for the model type that has been upgraded.
181
+
182
+ Test cases for the upgrade path will needed to be added.
183
+
184
+ Also if enough old versions build up the following release of Azul will need to require a kafka reprocess to be run
185
+ and assuming that has been run the old upgrade code and previous schemas could then be cleared.
186
+
187
+ ## Integration tests
188
+
189
+ To run the golang integration test suite the docker-compose.yaml file must first be used to stand up,
190
+ a minio pod to act as an S3 datastore.
191
+
192
+ With the command:
193
+
194
+ ` docker compose up`
195
+
196
+ Integration tests should be run with the script `test_integration.sh` with the
197
+ missing environment variables set to run the azure storage related tests.
@@ -0,0 +1,144 @@
1
+ # Azul Restapi Common
2
+
3
+ Shared library for Azul models and operations.
4
+
5
+ ## Design
6
+
7
+ The models are not in a nested folder as this gives nicer import names.
8
+
9
+ e.g.
10
+
11
+ ```python
12
+ # much clearer naming of models on import, prevents confusion
13
+ from azul_thingo import api
14
+ from azul_bedrock import model_api
15
+
16
+ api.send_thingo(model_api.Thingo())
17
+
18
+ # annoying and depends on developer, likely will fragment into different names on import
19
+ from azul_thingo import api
20
+ from azul_bedrock.models import api as mapi
21
+
22
+ api.send_thingo(mapi.Thingo())
23
+ ```
24
+
25
+ ## Requirements
26
+
27
+ ### libmagic
28
+
29
+ # default libmagic for debian can get out of date
30
+ contains a number of bugs for office and archive file types
31
+
32
+ ```bash
33
+ git clone --depth 1 --branch FILE5_46 https://github.com/file/file
34
+ cd file/
35
+ autoreconf -f -i
36
+ ./configure --disable-silent-rules
37
+ make -j4
38
+ sudo make install
39
+ sudo cp ./magic/magic.mgc /etc/magic
40
+ cd -
41
+ # check it worked
42
+ file --version
43
+ ```
44
+
45
+ ### yara
46
+
47
+ ```bash
48
+ sudo apt-get install automake libtool make gcc pkg-config git flex bison -y
49
+ mkdir -p ./yara
50
+ git clone --branch v4.3.2 https://github.com/VirusTotal/yara ./yara
51
+ cd ./yara
52
+ ./bootstrap.sh
53
+ ./configure
54
+ make
55
+ sudo make install
56
+ cd -
57
+ ## check it worked
58
+ yara -v
59
+ ```
60
+
61
+ ```bash
62
+ # you should put this in bashrc
63
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
64
+ ```
65
+
66
+ ## Install
67
+
68
+ ```bash
69
+ pip install azul-bedrock
70
+ ```
71
+
72
+ ## Mocks
73
+
74
+ Using Mockery to generate mocks for golang client.
75
+
76
+ This is for use in upstream packages.
77
+
78
+ ```bash
79
+ go install github.com/vektra/mockery/v2@v2.53.5
80
+ mockery
81
+ ```
82
+
83
+ ## Test Files
84
+
85
+ To run tests based off of bedrock you will need to set environment variables to allow you to download and use test files.
86
+
87
+ This requires you to be able to download files from Virustotal.
88
+ To save on download quotas files are also cached to an S3 cluster and your local file system.
89
+
90
+ The full set of environment variables for configuring this setup are here:
91
+
92
+ ```bash
93
+ # Timeout for requests made by the file manager.
94
+ export file_manager_request_timeout: int = 30
95
+ # The URL to Virustotal's V3 API (guarantee no trailing slash).
96
+ export file_manager_virustotal_api_url="https://www.virustotal.com/api/v3"
97
+ # Virustotal API key used to download files from Virustotal
98
+ export file_manager_virustotal_api_key = ""
99
+ # whether to attempt to download files from virustotal or not.
100
+ export file_manager_virustotal_enabled="True"
101
+ # Directory where files are cached on the local file system when downloaded. (stored as carts)
102
+ export file_manager_file_cache_dir="/var/tmp/azul"
103
+ # Flag used to enable/disable the caching of test files.
104
+ export file_manager_file_caching_enabled="True"
105
+ # URL from Azure storage blob (storage account name address)
106
+ export file_manager_azure_storage_account_address=""
107
+ # Storage account Access key. (SAS key) used to access the azure storage.
108
+ export file_manager_azure_storage_access_key=""
109
+ # Name of the storage container within the blob storage.
110
+ export file_manager_azure_container_name="azul-test-file-cache"
111
+ # Flag used to enable/disable bucket caching.
112
+ export file_manager_azure_blob_cache_enabled="True"
113
+ ```
114
+
115
+ It is recommended when you set these environment variables you add them to your `~/.bashrc` as it makes it easier when running tests.
116
+
117
+ ## Avro Schema changes
118
+
119
+ If you modify the Avro schema you need to ensure you consider legal schema changes to maintain backwards compatibility.
120
+
121
+ Refer here for a guide: https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types
122
+
123
+ Azul must maintain BACKWARD_TRANSITIVE compatibility at all times with it's avro models.
124
+ This means fields can be deleted from the schema and OPTIONAL fields added.
125
+
126
+ If this is not achievable for a change the model version must be incremented and an upgrade path for old events needs to
127
+ be added to `msginflight/conversion_avro.go` for the model type that has been upgraded.
128
+
129
+ Test cases for the upgrade path will needed to be added.
130
+
131
+ Also if enough old versions build up the following release of Azul will need to require a kafka reprocess to be run
132
+ and assuming that has been run the old upgrade code and previous schemas could then be cleared.
133
+
134
+ ## Integration tests
135
+
136
+ To run the golang integration test suite the docker-compose.yaml file must first be used to stand up,
137
+ a minio pod to act as an S3 datastore.
138
+
139
+ With the command:
140
+
141
+ ` docker compose up`
142
+
143
+ Integration tests should be run with the script `test_integration.sh` with the
144
+ missing environment variables set to run the azure storage related tests.
File without changes