dmart 1.4.35__py3-none-any.whl → 1.4.37__py3-none-any.whl

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 (298) hide show
  1. dmart/__init__.py +7 -0
  2. dmart/alembic/README +1 -0
  3. dmart/alembic/notes.txt +11 -0
  4. dmart/alembic/script.py.mako +28 -0
  5. dmart/alembic.ini +117 -0
  6. dmart/config.env.sample +27 -0
  7. dmart/conftest.py +13 -0
  8. dmart/curl.sh +196 -0
  9. cxb/assets/EntryRenderer-25YDhRen.js → dmart/cxb/assets/EntryRenderer-DwSsr_qX.js +1 -1
  10. cxb/assets/ListView-BpAycA2h.js → dmart/cxb/assets/ListView-DDE5x83t.js +1 -1
  11. cxb/assets/_module-CEW0D5oI.js → dmart/cxb/assets/_module-BNXXWMkB.js +1 -1
  12. cxb/assets/_module-Bfk8MiCs.js → dmart/cxb/assets/_module-_Y_1Ib3l.js +1 -1
  13. cxb/assets/index-CTxJ-lDp.js → dmart/cxb/assets/index-Br_OAS0Q.js +1 -1
  14. cxb/assets/index-iYkH7C67.js → dmart/cxb/assets/index-DwORvtKk.js +1 -1
  15. cxb/assets/index-Cd-F5j_k.js → dmart/cxb/assets/index-NksiCXM3.js +1 -1
  16. cxb/assets/index-C6cPO4op.js → dmart/cxb/assets/index-WkeaPz7c.js +1 -1
  17. cxb/assets/index-ac-Buu_H.js → dmart/cxb/assets/index-ZWZ_PIBi.js +2 -2
  18. cxb/assets/index-D742rwaM.js → dmart/cxb/assets/index-skKdyGa2.js +1 -1
  19. {cxb → dmart/cxb}/index.html +1 -1
  20. dmart.py → dmart/dmart.py +4 -7
  21. dmart/hypercorn_config.toml +3 -0
  22. dmart/info.json +1 -0
  23. dmart/login_creds.sh +7 -0
  24. dmart/login_creds.sh.sample +7 -0
  25. dmart/manifest.sh +12 -0
  26. dmart/plugins/action_log/config.json +13 -0
  27. dmart/plugins/admin_notification_sender/config.json +13 -0
  28. dmart/plugins/ldap_manager/config.json +12 -0
  29. dmart/plugins/ldap_manager/dmart.schema +146 -0
  30. dmart/plugins/ldap_manager/slapd.conf +53 -0
  31. dmart/plugins/local_notification/config.json +13 -0
  32. dmart/plugins/realtime_updates_notifier/config.json +12 -0
  33. dmart/plugins/redis_db_update/config.json +13 -0
  34. dmart/plugins/resource_folders_creation/config.json +12 -0
  35. dmart/plugins/system_notification_sender/config.json +13 -0
  36. dmart/plugins/update_access_controls/config.json +12 -0
  37. dmart/publish.sh +57 -0
  38. dmart/pylint.sh +16 -0
  39. dmart/pyrightconfig.json +7 -0
  40. dmart/redis_connections.sh +13 -0
  41. dmart/reload.sh +56 -0
  42. dmart/run.sh +3 -0
  43. dmart/test_utils.py +34 -0
  44. {utils → dmart/utils}/settings.py +50 -5
  45. {dmart-1.4.35.dist-info → dmart-1.4.37.dist-info}/METADATA +1 -1
  46. dmart-1.4.37.dist-info/RECORD +285 -0
  47. dmart-1.4.37.dist-info/entry_points.txt +2 -0
  48. dmart-1.4.37.dist-info/top_level.txt +1 -0
  49. dmart-1.4.35.dist-info/RECORD +0 -264
  50. dmart-1.4.35.dist-info/entry_points.txt +0 -2
  51. dmart-1.4.35.dist-info/top_level.txt +0 -24
  52. pytests/api_user_models_erros_test.py +0 -16
  53. pytests/api_user_models_requests_test.py +0 -98
  54. pytests/archive_test.py +0 -72
  55. pytests/base_test.py +0 -300
  56. pytests/get_settings_test.py +0 -14
  57. pytests/json_to_db_migration_test.py +0 -237
  58. pytests/service_test.py +0 -26
  59. pytests/test_info.py +0 -55
  60. pytests/test_status.py +0 -15
  61. utils/__init__.py +0 -0
  62. {alembic → dmart/alembic}/__init__.py +0 -0
  63. {alembic → dmart/alembic}/env.py +0 -0
  64. {alembic → dmart/alembic}/scripts/__init__.py +0 -0
  65. {alembic → dmart/alembic}/scripts/calculate_checksums.py +0 -0
  66. {alembic → dmart/alembic}/scripts/migration_f7a4949eed19.py +0 -0
  67. {alembic → dmart/alembic}/versions/0f3d2b1a7c21_add_authz_materialized_views.py +0 -0
  68. {alembic → dmart/alembic}/versions/10d2041b94d4_last_checksum_history.py +0 -0
  69. {alembic → dmart/alembic}/versions/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.py +0 -0
  70. {alembic → dmart/alembic}/versions/26bfe19b49d4_rm_failedloginattempts.py +0 -0
  71. {alembic → dmart/alembic}/versions/3c8bca2219cc_add_otp_table.py +0 -0
  72. {alembic → dmart/alembic}/versions/6675fd9dfe42_remove_unique_from_sessions_table.py +0 -0
  73. {alembic → dmart/alembic}/versions/71bc1df82e6a_adding_user_last_login_at.py +0 -0
  74. {alembic → dmart/alembic}/versions/74288ccbd3b5_initial.py +0 -0
  75. {alembic → dmart/alembic}/versions/7520a89a8467_rm_activesession_table.py +0 -0
  76. {alembic → dmart/alembic}/versions/848b623755a4_make_created_nd_updated_at_required.py +0 -0
  77. {alembic → dmart/alembic}/versions/8640dcbebf85_add_notes_to_users.py +0 -0
  78. {alembic → dmart/alembic}/versions/91c94250232a_adding_fk_on_owner_shortname.py +0 -0
  79. {alembic → dmart/alembic}/versions/98ecd6f56f9a_ext_meta_with_owner_group_shortname.py +0 -0
  80. {alembic → dmart/alembic}/versions/9aae9138c4ef_indexing_created_at_updated_at.py +0 -0
  81. {alembic → dmart/alembic}/versions/__init__.py +0 -0
  82. {alembic → dmart/alembic}/versions/b53f916b3f6d_json_to_jsonb.py +0 -0
  83. {alembic → dmart/alembic}/versions/eb5f1ec65156_adding_user_locked_to_device.py +0 -0
  84. {alembic → dmart/alembic}/versions/f7a4949eed19_adding_query_policies_to_meta.py +0 -0
  85. {api → dmart/api}/__init__.py +0 -0
  86. {api → dmart/api}/info/__init__.py +0 -0
  87. {api → dmart/api}/info/router.py +0 -0
  88. {api → dmart/api}/managed/__init__.py +0 -0
  89. {api → dmart/api}/managed/router.py +0 -0
  90. {api → dmart/api}/managed/utils.py +0 -0
  91. {api → dmart/api}/public/__init__.py +0 -0
  92. {api → dmart/api}/public/router.py +0 -0
  93. {api → dmart/api}/qr/__init__.py +0 -0
  94. {api → dmart/api}/qr/router.py +0 -0
  95. {api → dmart/api}/user/__init__.py +0 -0
  96. {api → dmart/api}/user/model/__init__.py +0 -0
  97. {api → dmart/api}/user/model/errors.py +0 -0
  98. {api → dmart/api}/user/model/requests.py +0 -0
  99. {api → dmart/api}/user/model/responses.py +0 -0
  100. {api → dmart/api}/user/router.py +0 -0
  101. {api → dmart/api}/user/service.py +0 -0
  102. /bundler.py → /dmart/bundler.py +0 -0
  103. {config → dmart/config}/__init__.py +0 -0
  104. {config → dmart/config}/channels.json +0 -0
  105. {config → dmart/config}/notification.json +0 -0
  106. {cxb → dmart/cxb}/__init__.py +0 -0
  107. {cxb → dmart/cxb}/assets/@codemirror-Rn7_6DkE.js +0 -0
  108. {cxb → dmart/cxb}/assets/@edraj-CS4NwVbD.js +0 -0
  109. {cxb → dmart/cxb}/assets/@floating-ui-BwwcF-xh.js +0 -0
  110. {cxb → dmart/cxb}/assets/@formatjs-yKEsAtjs.js +0 -0
  111. {cxb → dmart/cxb}/assets/@fortawesome-DRW1UCdr.js +0 -0
  112. {cxb → dmart/cxb}/assets/@jsonquerylang-laKNoFFq.js +0 -0
  113. {cxb → dmart/cxb}/assets/@lezer-za4Q-8Ew.js +0 -0
  114. {cxb → dmart/cxb}/assets/@marijn-DXwl3gUT.js +0 -0
  115. {cxb → dmart/cxb}/assets/@popperjs-l0sNRNKZ.js +0 -0
  116. {cxb → dmart/cxb}/assets/@replit--ERk53eB.js +0 -0
  117. {cxb → dmart/cxb}/assets/@roxi-CGMFK4i8.js +0 -0
  118. {cxb → dmart/cxb}/assets/@typewriter-cCzskkIv.js +0 -0
  119. {cxb → dmart/cxb}/assets/@zerodevx-BlBZjKxu.js +0 -0
  120. {cxb → dmart/cxb}/assets/@zerodevx-CVEpe6WZ.css +0 -0
  121. {cxb → dmart/cxb}/assets/BreadCrumbLite-DAhOx38v.js +0 -0
  122. {cxb → dmart/cxb}/assets/EntryRenderer-DXytdFp9.css +0 -0
  123. {cxb → dmart/cxb}/assets/ListView-U8of-_c-.css +0 -0
  124. {cxb → dmart/cxb}/assets/Prism--hMplq-p.js +0 -0
  125. {cxb → dmart/cxb}/assets/Prism-Uh6uStUw.css +0 -0
  126. {cxb → dmart/cxb}/assets/Table2Cols-BsbwicQm.js +0 -0
  127. {cxb → dmart/cxb}/assets/_..-BvT6vdHa.css +0 -0
  128. {cxb → dmart/cxb}/assets/_...404_-fuLH_rX9.js +0 -0
  129. {cxb → dmart/cxb}/assets/_...fallback_-Ba_NLmAE.js +0 -0
  130. {cxb → dmart/cxb}/assets/_module-Dgq0ZVtz.js +0 -0
  131. {cxb → dmart/cxb}/assets/ajv-Cpj98o6Y.js +0 -0
  132. {cxb → dmart/cxb}/assets/axios-CG2WSiiR.js +0 -0
  133. {cxb → dmart/cxb}/assets/clsx-B-dksMZM.js +0 -0
  134. {cxb → dmart/cxb}/assets/codemirror-wrapped-line-indent-DPhKvljI.js +0 -0
  135. {cxb → dmart/cxb}/assets/compare-C3AjiGFR.js +0 -0
  136. {cxb → dmart/cxb}/assets/compute-scroll-into-view-Bl8rNFhg.js +0 -0
  137. {cxb → dmart/cxb}/assets/consolite-DlCuI0F9.js +0 -0
  138. {cxb → dmart/cxb}/assets/crelt-C8TCjufn.js +0 -0
  139. {cxb → dmart/cxb}/assets/date-fns-l0sNRNKZ.js +0 -0
  140. {cxb → dmart/cxb}/assets/deepmerge-rn4rBaHU.js +0 -0
  141. {cxb → dmart/cxb}/assets/dmart_services-AL6-IdDE.js +0 -0
  142. {cxb → dmart/cxb}/assets/downloadFile-D08i0YDh.js +0 -0
  143. {cxb → dmart/cxb}/assets/easy-signal-BiPFIK3O.js +0 -0
  144. {cxb → dmart/cxb}/assets/esm-env-rsSWfq8L.js +0 -0
  145. {cxb → dmart/cxb}/assets/export-OF_rTiXu.js +0 -0
  146. {cxb → dmart/cxb}/assets/fast-deep-equal-l0sNRNKZ.js +0 -0
  147. {cxb → dmart/cxb}/assets/fast-diff-C-IidNf4.js +0 -0
  148. {cxb → dmart/cxb}/assets/fast-uri-l0sNRNKZ.js +0 -0
  149. {cxb → dmart/cxb}/assets/flowbite-svelte-BLvjb-sa.js +0 -0
  150. {cxb → dmart/cxb}/assets/flowbite-svelte-CD54FDqW.css +0 -0
  151. {cxb → dmart/cxb}/assets/flowbite-svelte-icons-BI8GVhw_.js +0 -0
  152. {cxb → dmart/cxb}/assets/github-slugger-CQ4oX9Ud.js +0 -0
  153. {cxb → dmart/cxb}/assets/global-igKv-1g9.js +0 -0
  154. {cxb → dmart/cxb}/assets/hookar-BMRD9G9H.js +0 -0
  155. {cxb → dmart/cxb}/assets/immutable-json-patch-DtRO2E_S.js +0 -0
  156. {cxb → dmart/cxb}/assets/import-1vE3gBat.js +0 -0
  157. {cxb → dmart/cxb}/assets/index-B-eTh-ZX.js +0 -0
  158. {cxb → dmart/cxb}/assets/index-BVyxzKtH.js +0 -0
  159. {cxb → dmart/cxb}/assets/index-BdeNM69f.js +0 -0
  160. {cxb → dmart/cxb}/assets/index-CC-A1ipE.js +0 -0
  161. {cxb → dmart/cxb}/assets/index-DTfhnhwd.js +0 -0
  162. {cxb → dmart/cxb}/assets/index-DdXRK7n9.js +0 -0
  163. {cxb → dmart/cxb}/assets/index-DtiCmB4o.js +0 -0
  164. {cxb → dmart/cxb}/assets/index-NBrXBlLA.css +0 -0
  165. {cxb → dmart/cxb}/assets/info-B986lRiM.js +0 -0
  166. {cxb → dmart/cxb}/assets/intl-messageformat-Dc5UU-HB.js +0 -0
  167. {cxb → dmart/cxb}/assets/jmespath-l0sNRNKZ.js +0 -0
  168. {cxb → dmart/cxb}/assets/json-schema-traverse-l0sNRNKZ.js +0 -0
  169. {cxb → dmart/cxb}/assets/json-source-map-DRgZidqy.js +0 -0
  170. {cxb → dmart/cxb}/assets/jsonpath-plus-l0sNRNKZ.js +0 -0
  171. {cxb → dmart/cxb}/assets/jsonrepair-B30Dx381.js +0 -0
  172. {cxb → dmart/cxb}/assets/lodash-es-DZVAA2ox.js +0 -0
  173. {cxb → dmart/cxb}/assets/marked-DKjyhwJX.js +0 -0
  174. {cxb → dmart/cxb}/assets/marked-gfm-heading-id-U5zO829x.js +0 -0
  175. {cxb → dmart/cxb}/assets/marked-mangle-CDMeiHC6.js +0 -0
  176. {cxb → dmart/cxb}/assets/memoize-one-BdPwpGay.js +0 -0
  177. {cxb → dmart/cxb}/assets/natural-compare-lite-Bg2Xcf-o.js +0 -0
  178. {cxb → dmart/cxb}/assets/pagination-svelte-D5CyoiE_.js +0 -0
  179. {cxb → dmart/cxb}/assets/pagination-svelte-v10nAbbM.css +0 -0
  180. {cxb → dmart/cxb}/assets/plantuml-encoder-C47mzt9T.js +0 -0
  181. {cxb → dmart/cxb}/assets/prismjs-DTUiLGJu.js +0 -0
  182. {cxb → dmart/cxb}/assets/profile-BUf-tKMe.js +0 -0
  183. {cxb → dmart/cxb}/assets/query-CNmXTsgf.js +0 -0
  184. {cxb → dmart/cxb}/assets/queryHelpers-C9iBWwqe.js +0 -0
  185. {cxb → dmart/cxb}/assets/scroll-into-view-if-needed-KR58zyjF.js +0 -0
  186. {cxb → dmart/cxb}/assets/spaces-0oyGvpii.js +0 -0
  187. {cxb → dmart/cxb}/assets/style-mod-Bs6eFhZE.js +0 -0
  188. {cxb → dmart/cxb}/assets/svelte-B2XmcTi_.js +0 -0
  189. {cxb → dmart/cxb}/assets/svelte-awesome-COLlx0DN.css +0 -0
  190. {cxb → dmart/cxb}/assets/svelte-awesome-DhnMA6Q_.js +0 -0
  191. {cxb → dmart/cxb}/assets/svelte-datatables-net-CY7LBj6I.js +0 -0
  192. {cxb → dmart/cxb}/assets/svelte-floating-ui-BlS3sOAQ.js +0 -0
  193. {cxb → dmart/cxb}/assets/svelte-i18n-CT2KkQaN.js +0 -0
  194. {cxb → dmart/cxb}/assets/svelte-jsoneditor-BzfX6Usi.css +0 -0
  195. {cxb → dmart/cxb}/assets/svelte-jsoneditor-CUGSvWId.js +0 -0
  196. {cxb → dmart/cxb}/assets/svelte-select-CegQKzqH.css +0 -0
  197. {cxb → dmart/cxb}/assets/svelte-select-CjHAt_85.js +0 -0
  198. {cxb → dmart/cxb}/assets/tailwind-merge-CJvxXMcu.js +0 -0
  199. {cxb → dmart/cxb}/assets/tailwind-variants-Cj20BoQ3.js +0 -0
  200. {cxb → dmart/cxb}/assets/toast-B9WDyfyI.js +0 -0
  201. {cxb → dmart/cxb}/assets/tslib-pJfR_DrR.js +0 -0
  202. {cxb → dmart/cxb}/assets/typewriter-editor-DkTVIJdm.js +0 -0
  203. {cxb → dmart/cxb}/assets/user-DeK_NB5v.js +0 -0
  204. {cxb → dmart/cxb}/assets/vanilla-picker-l5rcX3cq.js +0 -0
  205. {cxb → dmart/cxb}/assets/w3c-keyname-Vcq4gwWv.js +0 -0
  206. {cxb → dmart/cxb}/config.json +0 -0
  207. {cxb → dmart/cxb}/config.sample.json +0 -0
  208. {cxb → dmart/cxb}/favicon.ico +0 -0
  209. {cxb → dmart/cxb}/favicon.png +0 -0
  210. {data_adapters → dmart/data_adapters}/__init__.py +0 -0
  211. {data_adapters → dmart/data_adapters}/adapter.py +0 -0
  212. {data_adapters → dmart/data_adapters}/base_data_adapter.py +0 -0
  213. {data_adapters → dmart/data_adapters}/file/__init__.py +0 -0
  214. {data_adapters → dmart/data_adapters}/file/adapter.py +0 -0
  215. {data_adapters → dmart/data_adapters}/file/adapter_helpers.py +0 -0
  216. {data_adapters → dmart/data_adapters}/file/archive.py +0 -0
  217. {data_adapters → dmart/data_adapters}/file/create_index.py +0 -0
  218. {data_adapters → dmart/data_adapters}/file/create_users_folders.py +0 -0
  219. {data_adapters → dmart/data_adapters}/file/custom_validations.py +0 -0
  220. {data_adapters → dmart/data_adapters}/file/drop_index.py +0 -0
  221. {data_adapters → dmart/data_adapters}/file/health_check.py +0 -0
  222. {data_adapters → dmart/data_adapters}/file/redis_services.py +0 -0
  223. {data_adapters → dmart/data_adapters}/helpers.py +0 -0
  224. {data_adapters → dmart/data_adapters}/sql/__init__.py +0 -0
  225. {data_adapters → dmart/data_adapters}/sql/adapter.py +0 -0
  226. {data_adapters → dmart/data_adapters}/sql/adapter_helpers.py +0 -0
  227. {data_adapters → dmart/data_adapters}/sql/create_tables.py +0 -0
  228. {data_adapters → dmart/data_adapters}/sql/create_users_folders.py +0 -0
  229. {data_adapters → dmart/data_adapters}/sql/db_to_json_migration.py +0 -0
  230. {data_adapters → dmart/data_adapters}/sql/health_check_sql.py +0 -0
  231. {data_adapters → dmart/data_adapters}/sql/json_to_db_migration.py +0 -0
  232. {data_adapters → dmart/data_adapters}/sql/update_query_policies.py +0 -0
  233. /data_generator.py → /dmart/data_generator.py +0 -0
  234. /get_settings.py → /dmart/get_settings.py +0 -0
  235. {languages → dmart/languages}/__init__.py +0 -0
  236. {languages → dmart/languages}/arabic.json +0 -0
  237. {languages → dmart/languages}/english.json +0 -0
  238. {languages → dmart/languages}/kurdish.json +0 -0
  239. {languages → dmart/languages}/loader.py +0 -0
  240. /main.py → /dmart/main.py +0 -0
  241. /migrate.py → /dmart/migrate.py +0 -0
  242. {models → dmart/models}/__init__.py +0 -0
  243. {models → dmart/models}/api.py +0 -0
  244. {models → dmart/models}/core.py +0 -0
  245. {models → dmart/models}/enums.py +0 -0
  246. /password_gen.py → /dmart/password_gen.py +0 -0
  247. {plugins → dmart/plugins}/__init__.py +0 -0
  248. {plugins → dmart/plugins}/action_log/__init__.py +0 -0
  249. {plugins → dmart/plugins}/action_log/plugin.py +0 -0
  250. {plugins → dmart/plugins}/admin_notification_sender/__init__.py +0 -0
  251. {plugins → dmart/plugins}/admin_notification_sender/plugin.py +0 -0
  252. {plugins → dmart/plugins}/ldap_manager/__init__.py +0 -0
  253. {plugins → dmart/plugins}/ldap_manager/plugin.py +0 -0
  254. {plugins → dmart/plugins}/local_notification/__init__.py +0 -0
  255. {plugins → dmart/plugins}/local_notification/plugin.py +0 -0
  256. {plugins → dmart/plugins}/realtime_updates_notifier/__init__.py +0 -0
  257. {plugins → dmart/plugins}/realtime_updates_notifier/plugin.py +0 -0
  258. {plugins → dmart/plugins}/redis_db_update/__init__.py +0 -0
  259. {plugins → dmart/plugins}/redis_db_update/plugin.py +0 -0
  260. {plugins → dmart/plugins}/resource_folders_creation/__init__.py +0 -0
  261. {plugins → dmart/plugins}/resource_folders_creation/plugin.py +0 -0
  262. {plugins → dmart/plugins}/system_notification_sender/__init__.py +0 -0
  263. {plugins → dmart/plugins}/system_notification_sender/plugin.py +0 -0
  264. {plugins → dmart/plugins}/update_access_controls/__init__.py +0 -0
  265. {plugins → dmart/plugins}/update_access_controls/plugin.py +0 -0
  266. /run_notification_campaign.py → /dmart/run_notification_campaign.py +0 -0
  267. /scheduled_notification_handler.py → /dmart/scheduled_notification_handler.py +0 -0
  268. /schema_migration.py → /dmart/schema_migration.py +0 -0
  269. /schema_modulate.py → /dmart/schema_modulate.py +0 -0
  270. /set_admin_passwd.py → /dmart/set_admin_passwd.py +0 -0
  271. /sync.py → /dmart/sync.py +0 -0
  272. {pytests → dmart/utils}/__init__.py +0 -0
  273. {utils → dmart/utils}/access_control.py +0 -0
  274. {utils → dmart/utils}/async_request.py +0 -0
  275. {utils → dmart/utils}/exporter.py +0 -0
  276. {utils → dmart/utils}/firebase_notifier.py +0 -0
  277. {utils → dmart/utils}/generate_email.py +0 -0
  278. {utils → dmart/utils}/helpers.py +0 -0
  279. {utils → dmart/utils}/hypercorn_config.py +0 -0
  280. {utils → dmart/utils}/internal_error_code.py +0 -0
  281. {utils → dmart/utils}/jwt.py +0 -0
  282. {utils → dmart/utils}/logger.py +0 -0
  283. {utils → dmart/utils}/middleware.py +0 -0
  284. {utils → dmart/utils}/notification.py +0 -0
  285. {utils → dmart/utils}/password_hashing.py +0 -0
  286. {utils → dmart/utils}/plugin_manager.py +0 -0
  287. {utils → dmart/utils}/query_policies_helper.py +0 -0
  288. {utils → dmart/utils}/regex.py +0 -0
  289. {utils → dmart/utils}/repository.py +0 -0
  290. {utils → dmart/utils}/router_helper.py +0 -0
  291. {utils → dmart/utils}/sms_notifier.py +0 -0
  292. {utils → dmart/utils}/social_sso.py +0 -0
  293. {utils → dmart/utils}/templates/activation.html.j2 +0 -0
  294. {utils → dmart/utils}/templates/reminder.html.j2 +0 -0
  295. {utils → dmart/utils}/ticket_sys_utils.py +0 -0
  296. {utils → dmart/utils}/web_notifier.py +0 -0
  297. /websocket.py → /dmart/websocket.py +0 -0
  298. {dmart-1.4.35.dist-info → dmart-1.4.37.dist-info}/WHEEL +0 -0
@@ -0,0 +1,53 @@
1
+ include /etc/openldap/schema/core.schema
2
+ include /etc/openldap/schema/cosine.schema
3
+ include /etc/openldap/schema/inetorgperson.schema
4
+ #include /etc/openldap/schema/openldap.schema
5
+ #include /etc/openldap/schema/nis.schema
6
+ include /etc/openldap/schema/dmart.schema
7
+
8
+ #pidfile /var/lib/openldap/run/slapd.pid
9
+ #argsfile /var/lib/openldap/run/slapd.args
10
+
11
+ modulepath /usr/lib/openldap
12
+ moduleload back_mdb.so
13
+ #moduleload accesslog.so
14
+ # moduleload memberof.so
15
+
16
+ loglevel conns filter acl config stats stats2
17
+ # loglevel 0
18
+ disallow bind_anon
19
+
20
+ security ssf=1 update_ssf=112 simple_bind=64
21
+
22
+ # TLSCertificateFile /etc/ssl/ipa_imx_sh.crt
23
+ # TLSCertificateKeyFile /etc/ssl/private/ipa_imx_sh.key
24
+ # TLSCACertificateFile /etc/ssl/ipa_imx_sh.ca-bundle
25
+
26
+ # TLSCertificateFile /etc/openldap/certs/cert.pem
27
+ # TLSCertificateKeyFile /etc/openldap/certs/key.pem
28
+
29
+ access to *
30
+ by self write
31
+ by users read
32
+ by anonymous auth
33
+ by * none
34
+
35
+
36
+ database mdb
37
+ maxsize 1073741824
38
+ suffix "dc=dmart"
39
+ rootdn "cn=root,dc=dmart"
40
+ # Generate by running ... slappasswd -h {SSHA}
41
+ rootpw
42
+ # directory /var/lib/openldap/openldap-data
43
+ directory /var/lib/ldap
44
+ checkpoint 256 5
45
+ index objectClass eq
46
+ index cn eq,sub
47
+ #overlay accesslog
48
+ #logdb cn=log
49
+ #logops writes reads
50
+ #logold (objectclass=freexUser)
51
+ # overlay memberof
52
+
53
+
@@ -0,0 +1,13 @@
1
+ {
2
+ "shortname": "local_notification",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["ticket", "reaction", "comment"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "progress_ticket"]
9
+ },
10
+ "type": "hook",
11
+ "ordinal": 1,
12
+ "listen_time": "after"
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "shortname": "realtime_updates_notifier",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["__ALL__"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "delete", "progress_ticket", "attach", "move", "lock", "unlock"]
9
+ },
10
+ "type": "hook",
11
+ "listen_time": "after"
12
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "shortname": "redis_db_update",
3
+ "is_active": false,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["content", "ticket", "permission", "role", "group", "user", "schema", "notification", "folder", "comment", "json", "lock", "media", "alteration", "Relationship"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "delete", "move","progress_ticket"]
9
+ },
10
+ "type": "hook",
11
+ "ordinal": 2,
12
+ "listen_time": "after"
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "shortname": "resource_folders_creation",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["user", "space"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create"]
9
+ },
10
+ "type": "hook",
11
+ "listen_time": "after"
12
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "shortname": "system_notification_sender",
3
+ "is_active": false,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["__ALL__"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["progress_ticket", "view", "create", "update", "delete", "attach", "move"]
9
+ },
10
+ "type": "hook",
11
+ "ordinal": 1,
12
+ "listen_time": "after"
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "shortname": "update_access_controls",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["roles", "groups", "permissions", "users"],
6
+ "resource_types": ["group", "role", "permission", "user"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "delete"]
9
+ },
10
+ "type": "hook",
11
+ "listen_time": "after"
12
+ }
dmart/publish.sh ADDED
@@ -0,0 +1,57 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ cd "$(dirname "$0")"
5
+
6
+ echo "Cleaning up dist/, build/, and temporary files..."
7
+ rm -rf dist/ build/ *.egg-info dmart info.json
8
+
9
+ echo "Building CXB..."
10
+ CXB_DIR="../cxb"
11
+ if [ -d "$CXB_DIR" ]; then
12
+ if [ -f "config.json" ]; then
13
+ cp "config.json" "$CXB_DIR/public/config.json"
14
+ elif [ -f "../config.json" ]; then
15
+ cp "../config.json" "$CXB_DIR/public/config.json"
16
+ elif [ ! -f "$CXB_DIR/public/config.json" ] && [ -f "$CXB_DIR/public/config.sample.json" ]; then
17
+ cp "$CXB_DIR/public/config.sample.json" "$CXB_DIR/public/config.json"
18
+ fi
19
+ pushd "$CXB_DIR"
20
+ yarn install
21
+ yarn build
22
+ popd
23
+
24
+ rm -rf cxb
25
+ cp -r "$CXB_DIR/dist/client" cxb
26
+ touch cxb/__init__.py
27
+ else
28
+ echo "CXB directory not found at $CXB_DIR"
29
+ exit 1
30
+ fi
31
+
32
+ echo "Installing dependencies..."
33
+ python3 -m pip install --upgrade pip build twine
34
+ python3 -m pip install .
35
+ if [ -d "requirements" ]; then
36
+ for req in requirements/*.txt; do
37
+ if [ -f "$req" ] && [[ "$req" != *"test.txt" ]]; then
38
+ python3 -m pip install -r "$req"
39
+ fi
40
+ done
41
+ fi
42
+
43
+ echo "Creating standalone bundle..."
44
+ python3 bundler.py
45
+
46
+ echo "Building dmart wheel and sdist..."
47
+ python3 -m build
48
+
49
+ rm -rf cxb
50
+ ln -s "../cxb/dist/client" cxb
51
+
52
+ if [ -f "dmart" ]; then
53
+ mv dmart dist/
54
+ fi
55
+
56
+ echo "Uploading to PyPI..."
57
+ twine upload --non-interactive dist/*.whl
dmart/pylint.sh ADDED
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ declare -i RESULT=0
4
+ export PYRIGHT_PYTHON_FORCE_VERSION=latest
5
+ echo "Pyright ..."
6
+ python -m pyright .
7
+ RESULT+=$?
8
+ echo "Ruff ..."
9
+ python -m ruff check --exclude pytests --exclude alembic .
10
+ RESULT+=$?
11
+ echo "Mypy ..."
12
+ python -m mypy --explicit-package-bases --warn-return-any --check-untyped-defs --exclude loadtest --exclude pytests --exclude alembic .
13
+ RESULT+=$?
14
+
15
+ echo "Result : $RESULT"
16
+ exit $RESULT
@@ -0,0 +1,7 @@
1
+ {
2
+ "exclude": [
3
+ "alembic",
4
+ "loadtest",
5
+ "pytests"
6
+ ]
7
+ }
@@ -0,0 +1,13 @@
1
+ REDIS_HOST="$(./get_settings.py | jq -r .redis_host)"
2
+ RESULT+=$?
3
+ REDIS_PORT="$(./get_settings.py | jq -r .redis_port)"
4
+ RESULT+=$?
5
+ REDIS_PASSWORD="$(./get_settings.py | jq -r .redis_password)"
6
+ [ -z $REDIS_PASSWORD ] || REDIS_PASSWORD="--no-auth-warning -a $REDIS_PASSWORD"
7
+
8
+ while true
9
+ do
10
+ redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} ${REDIS_PASSWORD} info | grep connected_clients
11
+ redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} ${REDIS_PASSWORD} info | grep blocked_clients
12
+ sleep 1
13
+ done
dmart/reload.sh ADDED
@@ -0,0 +1,56 @@
1
+ #!/bin/bash
2
+
3
+ declare -i RESULT=0
4
+ source ./login_creds.sh
5
+ RESULT+=$?
6
+ CHECK_MODE="$(./get_settings.py | jq -r .active_data_db)"
7
+
8
+ RESULT+=$?
9
+ PORT="$(./get_settings.py | jq -r .listening_port)"
10
+ RESULT+=$?
11
+ # APP_URL="$(./get_settings.py | jq -r .app_url)"
12
+ APP_URL="http://localhost:$PORT"
13
+
14
+ if [[ "$CHECK_MODE" == "file" ]]; then
15
+ REDIS_HOST="$(./get_settings.py | jq -r .redis_host)"
16
+ RESULT+=$?
17
+ REDIS_PORT="$(./get_settings.py | jq -r .redis_port)"
18
+ RESULT+=$?
19
+ REDIS_PASSWORD="$(./get_settings.py | jq -r .redis_password)"
20
+ [ -z $REDIS_PASSWORD ] || REDIS_PASSWORD="--no-auth-warning -a $REDIS_PASSWORD"
21
+ time ./create_index.py --flushall
22
+ RESULT+=$?
23
+ fi
24
+
25
+ (which systemctl > /dev/null && systemctl --user list-unit-files dmart.service > /dev/null && systemctl --user restart dmart.service) || \
26
+ ( [[ -x "/etc/init.d/dmart" ]] && /etc/init.d/dmart restart )
27
+ RESULT+=$?
28
+ sleep 2
29
+ # RESP=$(curl --write-out '%{http_code}' --silent --output /dev/null "${APP_URL}")
30
+ RESP="000"
31
+ COUNTER=0
32
+ while [ $RESP -ne "200" ]; do
33
+ sleep 1
34
+ COUNTER=$((COUNTER+1))
35
+ echo "Waiting for the server to come up ${RESP} ${COUNTER} seconds"
36
+ RESP=$(curl --write-out '%{http_code}' --silent --connect-timeout 0.5 --output /dev/null "${APP_URL}")
37
+ [[ $COUNTER -ge 30 ]] && break
38
+ done
39
+ sleep 2
40
+
41
+ TOKEN=$(curl -s "${APP_URL}/user/login" -H 'Content-Type: application/json' -d "${SUPERMAN}" | jq -r '.records[0].attributes.access_token')
42
+ curl -s -H "Authorization: Bearer ${TOKEN}" -H "$CT" $APP_URL/user/profile | jq -r '.status'
43
+ RESULT+=$?
44
+
45
+ sleep 1
46
+ curl -s -H "Authorization: Bearer ${TOKEN}" "${APP_URL}/user/profile" | jq '.records[0].attributes.roles'
47
+ RESULT+=$?
48
+ if [[ "$CHECK_MODE" == "file" ]]; then
49
+ sleep 1
50
+ redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} ${REDIS_PASSWORD} JSON.GET users_permissions_dmart | jq -R '.|fromjson|keys|length'
51
+ # RESULT+=$?
52
+ fi
53
+
54
+
55
+ echo "Sum of exist codes = $RESULT"
56
+ exit $RESULT
dmart/run.sh ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ python -m hypercorn main:app --config file:utils/hypercorn_config.py
dmart/test_utils.py ADDED
@@ -0,0 +1,34 @@
1
+ from fastapi import status
2
+
3
+
4
+ def check_repeated_shortname(response):
5
+ json_response = response.json()
6
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
7
+ assert "failed" == json_response.get("status")
8
+ assert "request" == json_response.get("error", {}).get("type")
9
+
10
+
11
+ def check_not_found(response):
12
+ json_response = response.json()
13
+ assert response.status_code == status.HTTP_404_NOT_FOUND
14
+ assert "failed" == json_response.get("status")
15
+ assert "db" == json_response.get("error").get("type")
16
+
17
+
18
+ def check_unauthorized(response):
19
+ json_response = response.json()
20
+ assert response.status_code == status.HTTP_401_UNAUTHORIZED
21
+ assert "failed" == json_response.get("status")
22
+ assert "auth" == json_response.get("error", {}).get("type")
23
+
24
+
25
+ def assert_code_and_status_success(response):
26
+ if response.status_code != status.HTTP_200_OK:
27
+ print(
28
+ "\n\n\n\n\n========================= ERROR RESPONSE: =========================n:",
29
+ response.json(),
30
+ "\n\n\n\n\n",
31
+ )
32
+ assert response.status_code == status.HTTP_200_OK
33
+ json_response = response.json()
34
+ assert json_response["status"] == "success"
@@ -2,15 +2,62 @@
2
2
 
3
3
  import json
4
4
  import os
5
+ import random
5
6
  import re
6
7
  import string
7
- import random
8
+ import secrets
8
9
  from venv import logger
9
10
 
10
11
  from pydantic import Field
11
12
  from pydantic_settings import BaseSettings, SettingsConfigDict
12
13
  from pathlib import Path
13
14
 
15
+ def get_env_file():
16
+ env_file = os.getenv("BACKEND_ENV")
17
+
18
+ if env_file and os.path.exists(env_file):
19
+ return env_file
20
+
21
+ if not env_file or env_file == "config.env":
22
+ if os.path.exists("config.env"):
23
+ return "config.env"
24
+
25
+ dmart_home = Path.home() / ".dmart"
26
+ home_config = dmart_home / "config.env"
27
+
28
+ if not home_config.exists():
29
+ if not (os.path.exists(".git") or os.path.exists("setup.py")):
30
+ try:
31
+ dmart_home.mkdir(parents=True, exist_ok=True)
32
+ (dmart_home / "logs").mkdir(parents=True, exist_ok=True)
33
+ (dmart_home / "spaces").mkdir(parents=True, exist_ok=True)
34
+
35
+ jwt_secret = secrets.token_urlsafe(32)
36
+
37
+ config_content = f"""# dmart configuration
38
+ JWT_SECRET="{jwt_secret}"
39
+ JWT_ALGORITHM="HS256"
40
+ LOG_FILE="{dmart_home / 'logs' / 'dmart.ljson.log'}"
41
+ WS_LOG_FILE="{dmart_home / 'logs' / 'websocket.ljson.log'}"
42
+
43
+ # Database configuration
44
+ ACTIVE_DATA_DB="file"
45
+ SPACES_FOLDER="{dmart_home / 'spaces'}"
46
+ DATABASE_DRIVER="sqlite+pysqlite"
47
+ DATABASE_NAME="{dmart_home / 'dmart.db'}"
48
+
49
+ # Server configuration
50
+ LISTENING_HOST="0.0.0.0"
51
+ LISTENING_PORT=8282
52
+ """
53
+ home_config.write_text(config_content)
54
+ except Exception:
55
+ pass
56
+
57
+ if home_config.exists():
58
+ return str(home_config)
59
+
60
+ return env_file or "config.env"
14
61
 
15
62
  class Settings(BaseSettings):
16
63
  """Main settings class"""
@@ -113,10 +160,8 @@ class Settings(BaseSettings):
113
160
 
114
161
 
115
162
  model_config = SettingsConfigDict(
116
- env_file=os.getenv(
117
- "BACKEND_ENV",
118
- str(Path(__file__).resolve().parent.parent.parent / "config.env") if __file__.endswith(".pyc") else "config.env"
119
- ), env_file_encoding="utf-8"
163
+ env_file=get_env_file(),
164
+ env_file_encoding="utf-8"
120
165
  )
121
166
 
122
167
  def load_config_files(self) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.35
3
+ Version: 1.4.37
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic