dmart 1.4.33__py3-none-any.whl → 1.4.36__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 +8 -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. dmart.py → dmart/dmart.py +47 -40
  10. dmart/hypercorn_config.toml +3 -0
  11. dmart/info.json +1 -0
  12. dmart/login_creds.sh +7 -0
  13. dmart/login_creds.sh.sample +7 -0
  14. main.py → dmart/main.py +4 -1
  15. dmart/manifest.sh +12 -0
  16. dmart/plugins/action_log/config.json +13 -0
  17. dmart/plugins/admin_notification_sender/config.json +13 -0
  18. dmart/plugins/ldap_manager/config.json +12 -0
  19. dmart/plugins/ldap_manager/dmart.schema +146 -0
  20. dmart/plugins/ldap_manager/slapd.conf +53 -0
  21. dmart/plugins/local_notification/config.json +13 -0
  22. dmart/plugins/realtime_updates_notifier/config.json +12 -0
  23. dmart/plugins/redis_db_update/config.json +13 -0
  24. dmart/plugins/resource_folders_creation/config.json +12 -0
  25. dmart/plugins/system_notification_sender/config.json +13 -0
  26. dmart/plugins/update_access_controls/config.json +12 -0
  27. dmart/publish.sh +57 -0
  28. dmart/pylint.sh +16 -0
  29. dmart/pyrightconfig.json +7 -0
  30. dmart/redis_connections.sh +13 -0
  31. dmart/reload.sh +56 -0
  32. dmart/run.sh +3 -0
  33. dmart/test_utils.py +34 -0
  34. {dmart-1.4.33.dist-info → dmart-1.4.36.dist-info}/METADATA +1 -1
  35. dmart-1.4.36.dist-info/RECORD +285 -0
  36. dmart-1.4.36.dist-info/entry_points.txt +2 -0
  37. dmart-1.4.36.dist-info/top_level.txt +1 -0
  38. dmart-1.4.33.dist-info/RECORD +0 -264
  39. dmart-1.4.33.dist-info/entry_points.txt +0 -2
  40. dmart-1.4.33.dist-info/top_level.txt +0 -24
  41. pytests/api_user_models_erros_test.py +0 -16
  42. pytests/api_user_models_requests_test.py +0 -98
  43. pytests/archive_test.py +0 -72
  44. pytests/base_test.py +0 -300
  45. pytests/get_settings_test.py +0 -14
  46. pytests/json_to_db_migration_test.py +0 -237
  47. pytests/service_test.py +0 -26
  48. pytests/test_info.py +0 -55
  49. pytests/test_status.py +0 -15
  50. utils/__init__.py +0 -0
  51. {alembic → dmart/alembic}/__init__.py +0 -0
  52. {alembic → dmart/alembic}/env.py +0 -0
  53. {alembic → dmart/alembic}/scripts/__init__.py +0 -0
  54. {alembic → dmart/alembic}/scripts/calculate_checksums.py +0 -0
  55. {alembic → dmart/alembic}/scripts/migration_f7a4949eed19.py +0 -0
  56. {alembic → dmart/alembic}/versions/0f3d2b1a7c21_add_authz_materialized_views.py +0 -0
  57. {alembic → dmart/alembic}/versions/10d2041b94d4_last_checksum_history.py +0 -0
  58. {alembic → dmart/alembic}/versions/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.py +0 -0
  59. {alembic → dmart/alembic}/versions/26bfe19b49d4_rm_failedloginattempts.py +0 -0
  60. {alembic → dmart/alembic}/versions/3c8bca2219cc_add_otp_table.py +0 -0
  61. {alembic → dmart/alembic}/versions/6675fd9dfe42_remove_unique_from_sessions_table.py +0 -0
  62. {alembic → dmart/alembic}/versions/71bc1df82e6a_adding_user_last_login_at.py +0 -0
  63. {alembic → dmart/alembic}/versions/74288ccbd3b5_initial.py +0 -0
  64. {alembic → dmart/alembic}/versions/7520a89a8467_rm_activesession_table.py +0 -0
  65. {alembic → dmart/alembic}/versions/848b623755a4_make_created_nd_updated_at_required.py +0 -0
  66. {alembic → dmart/alembic}/versions/8640dcbebf85_add_notes_to_users.py +0 -0
  67. {alembic → dmart/alembic}/versions/91c94250232a_adding_fk_on_owner_shortname.py +0 -0
  68. {alembic → dmart/alembic}/versions/98ecd6f56f9a_ext_meta_with_owner_group_shortname.py +0 -0
  69. {alembic → dmart/alembic}/versions/9aae9138c4ef_indexing_created_at_updated_at.py +0 -0
  70. {alembic → dmart/alembic}/versions/__init__.py +0 -0
  71. {alembic → dmart/alembic}/versions/b53f916b3f6d_json_to_jsonb.py +0 -0
  72. {alembic → dmart/alembic}/versions/eb5f1ec65156_adding_user_locked_to_device.py +0 -0
  73. {alembic → dmart/alembic}/versions/f7a4949eed19_adding_query_policies_to_meta.py +0 -0
  74. {api → dmart/api}/__init__.py +0 -0
  75. {api → dmart/api}/info/__init__.py +0 -0
  76. {api → dmart/api}/info/router.py +0 -0
  77. {api → dmart/api}/managed/__init__.py +0 -0
  78. {api → dmart/api}/managed/router.py +0 -0
  79. {api → dmart/api}/managed/utils.py +0 -0
  80. {api → dmart/api}/public/__init__.py +0 -0
  81. {api → dmart/api}/public/router.py +0 -0
  82. {api → dmart/api}/qr/__init__.py +0 -0
  83. {api → dmart/api}/qr/router.py +0 -0
  84. {api → dmart/api}/user/__init__.py +0 -0
  85. {api → dmart/api}/user/model/__init__.py +0 -0
  86. {api → dmart/api}/user/model/errors.py +0 -0
  87. {api → dmart/api}/user/model/requests.py +0 -0
  88. {api → dmart/api}/user/model/responses.py +0 -0
  89. {api → dmart/api}/user/router.py +0 -0
  90. {api → dmart/api}/user/service.py +0 -0
  91. /bundler.py → /dmart/bundler.py +0 -0
  92. {config → dmart/config}/__init__.py +0 -0
  93. {config → dmart/config}/channels.json +0 -0
  94. {config → dmart/config}/notification.json +0 -0
  95. {cxb → dmart/cxb}/__init__.py +0 -0
  96. {cxb/client → dmart/cxb}/assets/@codemirror-Rn7_6DkE.js +0 -0
  97. {cxb/client → dmart/cxb}/assets/@edraj-CS4NwVbD.js +0 -0
  98. {cxb/client → dmart/cxb}/assets/@floating-ui-BwwcF-xh.js +0 -0
  99. {cxb/client → dmart/cxb}/assets/@formatjs-yKEsAtjs.js +0 -0
  100. {cxb/client → dmart/cxb}/assets/@fortawesome-DRW1UCdr.js +0 -0
  101. {cxb/client → dmart/cxb}/assets/@jsonquerylang-laKNoFFq.js +0 -0
  102. {cxb/client → dmart/cxb}/assets/@lezer-za4Q-8Ew.js +0 -0
  103. {cxb/client → dmart/cxb}/assets/@marijn-DXwl3gUT.js +0 -0
  104. {cxb/client → dmart/cxb}/assets/@popperjs-l0sNRNKZ.js +0 -0
  105. {cxb/client → dmart/cxb}/assets/@replit--ERk53eB.js +0 -0
  106. {cxb/client → dmart/cxb}/assets/@roxi-CGMFK4i8.js +0 -0
  107. {cxb/client → dmart/cxb}/assets/@typewriter-cCzskkIv.js +0 -0
  108. {cxb/client → dmart/cxb}/assets/@zerodevx-BlBZjKxu.js +0 -0
  109. {cxb/client → dmart/cxb}/assets/@zerodevx-CVEpe6WZ.css +0 -0
  110. {cxb/client → dmart/cxb}/assets/BreadCrumbLite-DAhOx38v.js +0 -0
  111. {cxb/client → dmart/cxb}/assets/EntryRenderer-25YDhRen.js +0 -0
  112. {cxb/client → dmart/cxb}/assets/EntryRenderer-DXytdFp9.css +0 -0
  113. {cxb/client → dmart/cxb}/assets/ListView-BpAycA2h.js +0 -0
  114. {cxb/client → dmart/cxb}/assets/ListView-U8of-_c-.css +0 -0
  115. {cxb/client → dmart/cxb}/assets/Prism--hMplq-p.js +0 -0
  116. {cxb/client → dmart/cxb}/assets/Prism-Uh6uStUw.css +0 -0
  117. {cxb/client → dmart/cxb}/assets/Table2Cols-BsbwicQm.js +0 -0
  118. {cxb/client → dmart/cxb}/assets/_..-BvT6vdHa.css +0 -0
  119. {cxb/client → dmart/cxb}/assets/_...404_-fuLH_rX9.js +0 -0
  120. {cxb/client → dmart/cxb}/assets/_...fallback_-Ba_NLmAE.js +0 -0
  121. {cxb/client → dmart/cxb}/assets/_module-Bfk8MiCs.js +0 -0
  122. {cxb/client → dmart/cxb}/assets/_module-CEW0D5oI.js +0 -0
  123. {cxb/client → dmart/cxb}/assets/_module-Dgq0ZVtz.js +0 -0
  124. {cxb/client → dmart/cxb}/assets/ajv-Cpj98o6Y.js +0 -0
  125. {cxb/client → dmart/cxb}/assets/axios-CG2WSiiR.js +0 -0
  126. {cxb/client → dmart/cxb}/assets/clsx-B-dksMZM.js +0 -0
  127. {cxb/client → dmart/cxb}/assets/codemirror-wrapped-line-indent-DPhKvljI.js +0 -0
  128. {cxb/client → dmart/cxb}/assets/compare-C3AjiGFR.js +0 -0
  129. {cxb/client → dmart/cxb}/assets/compute-scroll-into-view-Bl8rNFhg.js +0 -0
  130. {cxb/client → dmart/cxb}/assets/consolite-DlCuI0F9.js +0 -0
  131. {cxb/client → dmart/cxb}/assets/crelt-C8TCjufn.js +0 -0
  132. {cxb/client → dmart/cxb}/assets/date-fns-l0sNRNKZ.js +0 -0
  133. {cxb/client → dmart/cxb}/assets/deepmerge-rn4rBaHU.js +0 -0
  134. {cxb/client → dmart/cxb}/assets/dmart_services-AL6-IdDE.js +0 -0
  135. {cxb/client → dmart/cxb}/assets/downloadFile-D08i0YDh.js +0 -0
  136. {cxb/client → dmart/cxb}/assets/easy-signal-BiPFIK3O.js +0 -0
  137. {cxb/client → dmart/cxb}/assets/esm-env-rsSWfq8L.js +0 -0
  138. {cxb/client → dmart/cxb}/assets/export-OF_rTiXu.js +0 -0
  139. {cxb/client → dmart/cxb}/assets/fast-deep-equal-l0sNRNKZ.js +0 -0
  140. {cxb/client → dmart/cxb}/assets/fast-diff-C-IidNf4.js +0 -0
  141. {cxb/client → dmart/cxb}/assets/fast-uri-l0sNRNKZ.js +0 -0
  142. {cxb/client → dmart/cxb}/assets/flowbite-svelte-BLvjb-sa.js +0 -0
  143. {cxb/client → dmart/cxb}/assets/flowbite-svelte-CD54FDqW.css +0 -0
  144. {cxb/client → dmart/cxb}/assets/flowbite-svelte-icons-BI8GVhw_.js +0 -0
  145. {cxb/client → dmart/cxb}/assets/github-slugger-CQ4oX9Ud.js +0 -0
  146. {cxb/client → dmart/cxb}/assets/global-igKv-1g9.js +0 -0
  147. {cxb/client → dmart/cxb}/assets/hookar-BMRD9G9H.js +0 -0
  148. {cxb/client → dmart/cxb}/assets/immutable-json-patch-DtRO2E_S.js +0 -0
  149. {cxb/client → dmart/cxb}/assets/import-1vE3gBat.js +0 -0
  150. {cxb/client → dmart/cxb}/assets/index-B-eTh-ZX.js +0 -0
  151. {cxb/client → dmart/cxb}/assets/index-BVyxzKtH.js +0 -0
  152. {cxb/client → dmart/cxb}/assets/index-BdeNM69f.js +0 -0
  153. {cxb/client → dmart/cxb}/assets/index-C6cPO4op.js +0 -0
  154. {cxb/client → dmart/cxb}/assets/index-CC-A1ipE.js +0 -0
  155. {cxb/client → dmart/cxb}/assets/index-CTxJ-lDp.js +0 -0
  156. {cxb/client → dmart/cxb}/assets/index-Cd-F5j_k.js +0 -0
  157. {cxb/client → dmart/cxb}/assets/index-D742rwaM.js +0 -0
  158. {cxb/client → dmart/cxb}/assets/index-DTfhnhwd.js +0 -0
  159. {cxb/client → dmart/cxb}/assets/index-DdXRK7n9.js +0 -0
  160. {cxb/client → dmart/cxb}/assets/index-DtiCmB4o.js +0 -0
  161. {cxb/client → dmart/cxb}/assets/index-NBrXBlLA.css +0 -0
  162. {cxb/client → dmart/cxb}/assets/index-ac-Buu_H.js +0 -0
  163. {cxb/client → dmart/cxb}/assets/index-iYkH7C67.js +0 -0
  164. {cxb/client → dmart/cxb}/assets/info-B986lRiM.js +0 -0
  165. {cxb/client → dmart/cxb}/assets/intl-messageformat-Dc5UU-HB.js +0 -0
  166. {cxb/client → dmart/cxb}/assets/jmespath-l0sNRNKZ.js +0 -0
  167. {cxb/client → dmart/cxb}/assets/json-schema-traverse-l0sNRNKZ.js +0 -0
  168. {cxb/client → dmart/cxb}/assets/json-source-map-DRgZidqy.js +0 -0
  169. {cxb/client → dmart/cxb}/assets/jsonpath-plus-l0sNRNKZ.js +0 -0
  170. {cxb/client → dmart/cxb}/assets/jsonrepair-B30Dx381.js +0 -0
  171. {cxb/client → dmart/cxb}/assets/lodash-es-DZVAA2ox.js +0 -0
  172. {cxb/client → dmart/cxb}/assets/marked-DKjyhwJX.js +0 -0
  173. {cxb/client → dmart/cxb}/assets/marked-gfm-heading-id-U5zO829x.js +0 -0
  174. {cxb/client → dmart/cxb}/assets/marked-mangle-CDMeiHC6.js +0 -0
  175. {cxb/client → dmart/cxb}/assets/memoize-one-BdPwpGay.js +0 -0
  176. {cxb/client → dmart/cxb}/assets/natural-compare-lite-Bg2Xcf-o.js +0 -0
  177. {cxb/client → dmart/cxb}/assets/pagination-svelte-D5CyoiE_.js +0 -0
  178. {cxb/client → dmart/cxb}/assets/pagination-svelte-v10nAbbM.css +0 -0
  179. {cxb/client → dmart/cxb}/assets/plantuml-encoder-C47mzt9T.js +0 -0
  180. {cxb/client → dmart/cxb}/assets/prismjs-DTUiLGJu.js +0 -0
  181. {cxb/client → dmart/cxb}/assets/profile-BUf-tKMe.js +0 -0
  182. {cxb/client → dmart/cxb}/assets/query-CNmXTsgf.js +0 -0
  183. {cxb/client → dmart/cxb}/assets/queryHelpers-C9iBWwqe.js +0 -0
  184. {cxb/client → dmart/cxb}/assets/scroll-into-view-if-needed-KR58zyjF.js +0 -0
  185. {cxb/client → dmart/cxb}/assets/spaces-0oyGvpii.js +0 -0
  186. {cxb/client → dmart/cxb}/assets/style-mod-Bs6eFhZE.js +0 -0
  187. {cxb/client → dmart/cxb}/assets/svelte-B2XmcTi_.js +0 -0
  188. {cxb/client → dmart/cxb}/assets/svelte-awesome-COLlx0DN.css +0 -0
  189. {cxb/client → dmart/cxb}/assets/svelte-awesome-DhnMA6Q_.js +0 -0
  190. {cxb/client → dmart/cxb}/assets/svelte-datatables-net-CY7LBj6I.js +0 -0
  191. {cxb/client → dmart/cxb}/assets/svelte-floating-ui-BlS3sOAQ.js +0 -0
  192. {cxb/client → dmart/cxb}/assets/svelte-i18n-CT2KkQaN.js +0 -0
  193. {cxb/client → dmart/cxb}/assets/svelte-jsoneditor-BzfX6Usi.css +0 -0
  194. {cxb/client → dmart/cxb}/assets/svelte-jsoneditor-CUGSvWId.js +0 -0
  195. {cxb/client → dmart/cxb}/assets/svelte-select-CegQKzqH.css +0 -0
  196. {cxb/client → dmart/cxb}/assets/svelte-select-CjHAt_85.js +0 -0
  197. {cxb/client → dmart/cxb}/assets/tailwind-merge-CJvxXMcu.js +0 -0
  198. {cxb/client → dmart/cxb}/assets/tailwind-variants-Cj20BoQ3.js +0 -0
  199. {cxb/client → dmart/cxb}/assets/toast-B9WDyfyI.js +0 -0
  200. {cxb/client → dmart/cxb}/assets/tslib-pJfR_DrR.js +0 -0
  201. {cxb/client → dmart/cxb}/assets/typewriter-editor-DkTVIJdm.js +0 -0
  202. {cxb/client → dmart/cxb}/assets/user-DeK_NB5v.js +0 -0
  203. {cxb/client → dmart/cxb}/assets/vanilla-picker-l5rcX3cq.js +0 -0
  204. {cxb/client → dmart/cxb}/assets/w3c-keyname-Vcq4gwWv.js +0 -0
  205. {cxb/client → dmart/cxb}/config.json +0 -0
  206. {cxb/client → dmart/cxb}/config.sample.json +0 -0
  207. {cxb/client → dmart/cxb}/favicon.ico +0 -0
  208. {cxb/client → dmart/cxb}/favicon.png +0 -0
  209. {cxb/client → dmart/cxb}/index.html +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. /migrate.py → /dmart/migrate.py +0 -0
  241. {models → dmart/models}/__init__.py +0 -0
  242. {models → dmart/models}/api.py +0 -0
  243. {models → dmart/models}/core.py +0 -0
  244. {models → dmart/models}/enums.py +0 -0
  245. /password_gen.py → /dmart/password_gen.py +0 -0
  246. {plugins → dmart/plugins}/__init__.py +0 -0
  247. {plugins → dmart/plugins}/action_log/__init__.py +0 -0
  248. {plugins → dmart/plugins}/action_log/plugin.py +0 -0
  249. {plugins → dmart/plugins}/admin_notification_sender/__init__.py +0 -0
  250. {plugins → dmart/plugins}/admin_notification_sender/plugin.py +0 -0
  251. {plugins → dmart/plugins}/ldap_manager/__init__.py +0 -0
  252. {plugins → dmart/plugins}/ldap_manager/plugin.py +0 -0
  253. {plugins → dmart/plugins}/local_notification/__init__.py +0 -0
  254. {plugins → dmart/plugins}/local_notification/plugin.py +0 -0
  255. {plugins → dmart/plugins}/realtime_updates_notifier/__init__.py +0 -0
  256. {plugins → dmart/plugins}/realtime_updates_notifier/plugin.py +0 -0
  257. {plugins → dmart/plugins}/redis_db_update/__init__.py +0 -0
  258. {plugins → dmart/plugins}/redis_db_update/plugin.py +0 -0
  259. {plugins → dmart/plugins}/resource_folders_creation/__init__.py +0 -0
  260. {plugins → dmart/plugins}/resource_folders_creation/plugin.py +0 -0
  261. {plugins → dmart/plugins}/system_notification_sender/__init__.py +0 -0
  262. {plugins → dmart/plugins}/system_notification_sender/plugin.py +0 -0
  263. {plugins → dmart/plugins}/update_access_controls/__init__.py +0 -0
  264. {plugins → dmart/plugins}/update_access_controls/plugin.py +0 -0
  265. /run_notification_campaign.py → /dmart/run_notification_campaign.py +0 -0
  266. /scheduled_notification_handler.py → /dmart/scheduled_notification_handler.py +0 -0
  267. /schema_migration.py → /dmart/schema_migration.py +0 -0
  268. /schema_modulate.py → /dmart/schema_modulate.py +0 -0
  269. /set_admin_passwd.py → /dmart/set_admin_passwd.py +0 -0
  270. /sync.py → /dmart/sync.py +0 -0
  271. {pytests → dmart/utils}/__init__.py +0 -0
  272. {utils → dmart/utils}/access_control.py +0 -0
  273. {utils → dmart/utils}/async_request.py +0 -0
  274. {utils → dmart/utils}/exporter.py +0 -0
  275. {utils → dmart/utils}/firebase_notifier.py +0 -0
  276. {utils → dmart/utils}/generate_email.py +0 -0
  277. {utils → dmart/utils}/helpers.py +0 -0
  278. {utils → dmart/utils}/hypercorn_config.py +0 -0
  279. {utils → dmart/utils}/internal_error_code.py +0 -0
  280. {utils → dmart/utils}/jwt.py +0 -0
  281. {utils → dmart/utils}/logger.py +0 -0
  282. {utils → dmart/utils}/middleware.py +0 -0
  283. {utils → dmart/utils}/notification.py +0 -0
  284. {utils → dmart/utils}/password_hashing.py +0 -0
  285. {utils → dmart/utils}/plugin_manager.py +0 -0
  286. {utils → dmart/utils}/query_policies_helper.py +0 -0
  287. {utils → dmart/utils}/regex.py +0 -0
  288. {utils → dmart/utils}/repository.py +0 -0
  289. {utils → dmart/utils}/router_helper.py +0 -0
  290. {utils → dmart/utils}/settings.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.33.dist-info → dmart-1.4.36.dist-info}/WHEEL +0 -0
dmart/manifest.sh ADDED
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+
3
+ source ./login_creds.sh
4
+
5
+ APP_URL="http://localhost:8282"
6
+
7
+
8
+ TOKEN=$(curl -s "${APP_URL}/user/login" -H 'Content-Type: application/json' -d "${SUPERMAN}" | jq -r '.records[0].attributes.access_token')
9
+ # curl -s -H "Authorization: Bearer ${TOKEN}" "${APP_URL}/managed/reload-security-data" | jq .
10
+ # curl -s -H "Authorization: Bearer ${TOKEN}" "${APP_URL}/info/me" | jq .
11
+ curl -s -H "Authorization: Bearer ${TOKEN}" "${APP_URL}/info/manifest" | jq .
12
+ # curl -s -H "Authorization: Bearer ${TOKEN}" "${APP_URL}/info/settings" | jq .
@@ -0,0 +1,13 @@
1
+ {
2
+ "shortname": "action_log",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["__ALL__"],
6
+ "resource_types": ["__ALL__"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "delete", "progress_ticket"]
9
+ },
10
+ "type": "hook",
11
+ "listen_time": "after",
12
+ "dependencies": []
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "shortname": "admin_notification_sender",
3
+ "is_active": true,
4
+ "filters": {
5
+ "subpaths": ["notifications/admin"],
6
+ "resource_types": ["content"],
7
+ "schema_shortnames": ["admin_notification_request"],
8
+ "actions": ["create"]
9
+ },
10
+ "type": "hook",
11
+ "ordinal": 1,
12
+ "listen_time": "after"
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "shortname": "ldap_manager",
3
+ "is_active": false,
4
+ "filters": {
5
+ "subpaths": ["users"],
6
+ "resource_types": ["user"],
7
+ "schema_shortnames": ["__ALL__"],
8
+ "actions": ["create", "update", "delete", "move"]
9
+ },
10
+ "type": "hook",
11
+ "listen_time": "after"
12
+ }
@@ -0,0 +1,146 @@
1
+
2
+
3
+ attributetype ( 1.1.2.1.1
4
+ NAME 'isActive'
5
+ DESC 'Account activation status : true = active, false = disabled'
6
+ EQUALITY booleanMatch
7
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
8
+ SINGLE-VALUE
9
+ )
10
+
11
+ attributetype ( 1.1.2.1.2
12
+ NAME 'mailAlias'
13
+ DESC 'Email alias, another name by which the user can receive emails to'
14
+ SUP mail
15
+ )
16
+
17
+ attributetype ( 1.1.2.1.3
18
+ NAME 'mailForward'
19
+ DESC 'Email forward'
20
+ SUP mail
21
+ )
22
+
23
+ attributetype ( 1.1.2.1.4
24
+ NAME 'authorizedService'
25
+ DESC 'Allowed service name'
26
+ EQUALITY caseIgnoreMatch
27
+ ORDERING caseIgnoreOrderingMatch
28
+ SUBSTR caseIgnoreSubstringsMatch
29
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
30
+ )
31
+
32
+ # validation must be removed when the email or mobile are changed.
33
+ attributetype ( 1.1.2.1.5
34
+ NAME 'validation'
35
+ DESC 'Validation of user'
36
+ EQUALITY caseIgnoreMatch
37
+ ORDERING caseIgnoreOrderingMatch
38
+ SUBSTR caseIgnoreSubstringsMatch
39
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
40
+ )
41
+
42
+ attributetype ( 1.1.2.1.6
43
+ NAME 'changePasswordRequired'
44
+ EQUALITY booleanMatch
45
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
46
+ SINGLE-VALUE
47
+ )
48
+
49
+ attributetype ( 1.1.2.1.7
50
+ NAME ( 'dob' 'dateOfBirth' )
51
+ DESC 'Date of Birth'
52
+ EQUALITY generalizedTimeMatch
53
+ ORDERING generalizedTimeOrderingMatch
54
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
55
+ SINGLE-VALUE
56
+ )
57
+
58
+ attributetype ( 1.1.2.1.13
59
+ NAME ( 'lastLogin' )
60
+ DESC 'last log in'
61
+ EQUALITY generalizedTimeMatch
62
+ ORDERING generalizedTimeOrderingMatch
63
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
64
+ SINGLE-VALUE
65
+ )
66
+
67
+
68
+
69
+ # attributetype ( 1.1.2.1.7
70
+ # NAME 'dateOfBirth'
71
+ # DESC 'Date of Birth'
72
+ # EQUALITY integerMatch
73
+ # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
74
+ # SINGLE-VALUE
75
+ # )
76
+
77
+
78
+ attributetype ( 1.1.2.1.8
79
+ NAME 'secretQuestion'
80
+ DESC 'Secret Question, 128 bytes'
81
+ EQUALITY caseIgnoreMatch
82
+ SUBSTR caseIgnoreSubstringsMatch
83
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128}
84
+ SINGLE-VALUE
85
+ )
86
+
87
+ attributetype ( 1.1.2.1.9
88
+ NAME 'secretAnswer'
89
+ DESC 'Secret Question, 128 bytes'
90
+ EQUALITY caseIgnoreMatch
91
+ SUBSTR caseIgnoreSubstringsMatch
92
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128}
93
+ SINGLE-VALUE
94
+ )
95
+
96
+ attributetype ( 1.1.2.1.10
97
+ NAME 'cityName'
98
+ EQUALITY caseIgnoreMatch
99
+ ORDERING caseIgnoreOrderingMatch
100
+ SUBSTR caseIgnoreSubstringsMatch
101
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
102
+ SINGLE-VALUE
103
+ )
104
+
105
+ attributetype ( 1.1.2.1.11
106
+ NAME 'gender'
107
+ EQUALITY booleanMatch
108
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
109
+ SINGLE-VALUE
110
+ )
111
+
112
+
113
+ attributetype ( 1.1.2.1.12
114
+ NAME 'memberEmail'
115
+ SUP mail
116
+ )
117
+
118
+ objectclass (1.1.2.2.1
119
+ NAME 'dmartPerson'
120
+ DESC 'dmart Person'
121
+ SUP inetOrgPerson
122
+ STRUCTURAL
123
+ MUST ( commonName )
124
+ MAY ( surname $ givenName $ countryName $ telephoneNumber $ homeTelephoneNumber $
125
+ mobileTelephoneNumber $ displayName $ mail $ description $ postalAddress $
126
+ streetAddress $ labeledURI $ jpegPhoto $ preferredLanguage $
127
+ organizationName $ homePostalAddress $ cityName $ dateOfBirth $ gender )
128
+ )
129
+
130
+ objectclass ( 1.1.2.2.2
131
+ NAME 'dmartUser'
132
+ DESC 'dmart User'
133
+ SUP dmartPerson
134
+ STRUCTURAL
135
+ MUST ( userPassword )
136
+ MAY ( mailAlias $ mailForward $ authorizedService $ isActive $ title $ validation $ changePasswordRequired $ secretQuestion $ secretAnswer $ lastLogin )
137
+ )
138
+
139
+ objectclass ( 1.1.2.2.3
140
+ NAME 'dmartGroup'
141
+ DESC 'dmart Group'
142
+ STRUCTURAL
143
+ MUST ( cn )
144
+ MAY ( isActive $ mailAlias $ mailForward $ memberEmail $ description )
145
+ )
146
+
@@ -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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.33
3
+ Version: 1.4.36
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic