cmdbox 0.5.3.1__py3-none-any.whl → 0.6.0__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.

Potentially problematic release.


This version of cmdbox might be problematic. Click here for more details.

Files changed (188) hide show
  1. cmdbox/app/auth/__init__.py +0 -0
  2. cmdbox/app/auth/azure_signin.py +38 -0
  3. cmdbox/app/auth/azure_signin_saml.py +12 -0
  4. cmdbox/app/auth/github_signin.py +38 -0
  5. cmdbox/app/auth/google_signin.py +32 -0
  6. cmdbox/app/auth/signin.py +490 -287
  7. cmdbox/app/auth/signin_saml.py +61 -0
  8. cmdbox/app/common.py +48 -3
  9. cmdbox/app/edge.py +182 -213
  10. cmdbox/app/edge_tool.py +177 -0
  11. cmdbox/app/feature.py +10 -10
  12. cmdbox/app/features/cli/agent_base.py +477 -0
  13. cmdbox/app/features/cli/audit_base.py +1 -1
  14. cmdbox/app/features/cli/cmdbox_audit_search.py +24 -1
  15. cmdbox/app/features/cli/cmdbox_client_file_download.py +1 -1
  16. cmdbox/app/features/cli/cmdbox_cmd_list.py +105 -0
  17. cmdbox/app/features/cli/cmdbox_cmd_load.py +104 -0
  18. cmdbox/app/features/cli/cmdbox_edge_config.py +21 -7
  19. cmdbox/app/features/cli/cmdbox_edge_start.py +1 -1
  20. cmdbox/app/features/cli/cmdbox_gui_start.py +9 -132
  21. cmdbox/app/features/cli/cmdbox_gui_stop.py +4 -21
  22. cmdbox/app/features/cli/cmdbox_server_start.py +1 -1
  23. cmdbox/app/features/cli/cmdbox_web_apikey_add.py +1 -1
  24. cmdbox/app/features/cli/cmdbox_web_apikey_del.py +1 -1
  25. cmdbox/app/features/cli/cmdbox_web_genpass.py +0 -3
  26. cmdbox/app/features/cli/cmdbox_web_group_add.py +1 -1
  27. cmdbox/app/features/cli/cmdbox_web_group_del.py +1 -1
  28. cmdbox/app/features/cli/cmdbox_web_group_edit.py +1 -1
  29. cmdbox/app/features/cli/cmdbox_web_group_list.py +1 -1
  30. cmdbox/app/features/cli/cmdbox_web_start.py +119 -104
  31. cmdbox/app/features/cli/cmdbox_web_stop.py +1 -1
  32. cmdbox/app/features/cli/cmdbox_web_user_add.py +4 -4
  33. cmdbox/app/features/cli/cmdbox_web_user_del.py +1 -1
  34. cmdbox/app/features/cli/cmdbox_web_user_edit.py +4 -4
  35. cmdbox/app/features/cli/cmdbox_web_user_list.py +1 -1
  36. cmdbox/app/features/web/cmdbox_web_agent.py +250 -0
  37. cmdbox/app/features/web/cmdbox_web_do_signin.py +79 -103
  38. cmdbox/app/features/web/cmdbox_web_exec_cmd.py +8 -3
  39. cmdbox/app/features/web/cmdbox_web_signin.py +26 -4
  40. cmdbox/app/features/web/cmdbox_web_users.py +2 -0
  41. cmdbox/app/options.py +55 -2
  42. cmdbox/app/web.py +155 -27
  43. cmdbox/extensions/features.yml +18 -0
  44. cmdbox/extensions/sample_project/sample/app/features/cli/__init__.py +0 -0
  45. cmdbox/extensions/sample_project/sample/app/features/web/__init__.py +0 -0
  46. cmdbox/extensions/sample_project/sample/extensions/features.yml +23 -0
  47. cmdbox/extensions/sample_project/sample/extensions/user_list.yml +40 -6
  48. cmdbox/extensions/user_list.yml +37 -6
  49. cmdbox/licenses/{LICENSE.starlette.0.41.3(BSD License).txt → LICENSE.Authlib.1.5.2(BSD License).txt } +3 -1
  50. cmdbox/licenses/{LICENSE.pydantic_core.2.33.0(MIT License).txt → LICENSE.Deprecated.1.2.18(MIT License).txt } +2 -2
  51. cmdbox/licenses/{LICENSE.more-itertools.10.6.0(MIT License).txt → LICENSE.SQLAlchemy.2.0.40(MIT License).txt } +1 -1
  52. cmdbox/licenses/LICENSE.aiohttp.3.11.18(Apache Software License).txt +13 -0
  53. cmdbox/licenses/LICENSE.aiosignal.1.3.2(Apache Software License).txt +201 -0
  54. cmdbox/licenses/LICENSE.async-timeout.5.0.1(Apache Software License).txt +13 -0
  55. cmdbox/licenses/{LICENSE.watchfiles.1.0.0(MIT License).txt → LICENSE.attrs.25.3.0(UNKNOWN).txt} +1 -1
  56. cmdbox/licenses/{LICENSE.anyio.4.6.2.post1(MIT License).txt → LICENSE.cachetools.5.5.2(MIT License).txt } +1 -1
  57. cmdbox/licenses/LICENSE.distro.1.9.0(Apache Software License).txt +202 -0
  58. cmdbox/licenses/{LICENSE.pydantic_core.2.33.1(MIT License).txt → LICENSE.docstring_parser.0.16(MIT License).txt } +1 -1
  59. cmdbox/licenses/LICENSE.filelock.3.18.0(The Unlicense (Unlicense)).txt +24 -0
  60. cmdbox/licenses/LICENSE.frozenlist.1.6.0(Apache-2.0).txt +201 -0
  61. cmdbox/licenses/{LICENSE.starlette.0.46.1(BSD License).txt → LICENSE.fsspec.2025.3.2(BSD License).txt } +3 -1
  62. cmdbox/licenses/{LICENSE.argcomplete.3.6.1(Apache Software License).txt → LICENSE.google-adk.0.5.0(Apache Software License).txt } +25 -0
  63. cmdbox/licenses/LICENSE.google-api-python-client.2.169.0(Apache Software License).txt +201 -0
  64. cmdbox/licenses/LICENSE.google-auth-httplib2.0.2.0(Apache Software License).txt +201 -0
  65. cmdbox/licenses/LICENSE.google-auth.2.40.1(Apache Software License).txt +201 -0
  66. cmdbox/licenses/LICENSE.google-cloud-aiplatform.1.92.0(Apache 2.0).txt +202 -0
  67. cmdbox/licenses/LICENSE.google-cloud-bigquery.3.31.0(Apache Software License).txt +202 -0
  68. cmdbox/licenses/LICENSE.google-cloud-core.2.4.3(Apache Software License).txt +202 -0
  69. cmdbox/licenses/LICENSE.google-cloud-resource-manager.1.14.2(Apache Software License).txt +202 -0
  70. cmdbox/licenses/LICENSE.google-cloud-secret-manager.2.23.3(Apache Software License).txt +202 -0
  71. cmdbox/licenses/LICENSE.google-cloud-speech.2.32.0(Apache Software License).txt +202 -0
  72. cmdbox/licenses/LICENSE.google-cloud-storage.2.19.0(Apache Software License).txt +202 -0
  73. cmdbox/licenses/LICENSE.google-cloud-trace.1.16.1(Apache Software License).txt +202 -0
  74. cmdbox/licenses/LICENSE.google-crc32c.1.7.1(Apache 2.0).txt +202 -0
  75. cmdbox/licenses/LICENSE.google-genai.1.14.0(Apache Software License).txt +202 -0
  76. cmdbox/licenses/LICENSE.google-resumable-media.2.7.2(Apache Software License).txt +202 -0
  77. cmdbox/licenses/LICENSE.googleapis-common-protos.1.70.0(Apache Software License).txt +202 -0
  78. cmdbox/licenses/{LICENSE.fastapi.0.115.5(MIT License).txt → LICENSE.graphviz.0.20.3(MIT License).txt } +1 -1
  79. cmdbox/licenses/LICENSE.grpc-google-iam-v1.0.14.2(Apache Software License).txt +202 -0
  80. cmdbox/licenses/LICENSE.grpcio-status.1.71.0(Apache Software License).txt +610 -0
  81. cmdbox/licenses/LICENSE.grpcio.1.71.0(Apache Software License).txt +610 -0
  82. cmdbox/licenses/{LICENSE.uvicorn.0.34.0(BSD License).txt → LICENSE.httpcore.1.0.9(BSD License).txt } +1 -1
  83. cmdbox/licenses/LICENSE.httplib2.0.22.0(MIT License).txt +23 -0
  84. cmdbox/licenses/{LICENSE.tomli.2.1.0(MIT License).txt → LICENSE.httpx-sse.0.4.0(MIT).txt} +1 -1
  85. cmdbox/licenses/LICENSE.httpx.0.28.1(BSD License).txt +12 -0
  86. cmdbox/licenses/LICENSE.huggingface-hub.0.31.1(Apache Software License).txt +201 -0
  87. cmdbox/licenses/{LICENSE.charset-normalizer.3.4.0(MIT License).txt → LICENSE.jsonschema-specifications.2025.4.1(UNKNOWN).txt} +5 -7
  88. cmdbox/licenses/LICENSE.jsonschema.4.23.0(MIT License).txt +19 -0
  89. cmdbox/licenses/{LICENSE.pkginfo.1.10.0(MIT License).txt → LICENSE.litellm.1.69.0(MIT License).txt } +6 -1
  90. cmdbox/licenses/{LICENSE.redis.5.2.1(MIT License).txt → LICENSE.mcp.1.8.0(MIT License).txt } +1 -1
  91. cmdbox/licenses/LICENSE.multidict.6.4.3(Apache Software License).txt +13 -0
  92. cmdbox/licenses/{LICENSE.argcomplete.3.5.1(Apache Software License).txt → LICENSE.openai.1.75.0(Apache Software License).txt } +25 -1
  93. cmdbox/licenses/LICENSE.opentelemetry-api.1.33.0(Apache Software License).txt +201 -0
  94. cmdbox/licenses/LICENSE.opentelemetry-exporter-gcp-trace.1.9.0(Apache Software License).txt +201 -0
  95. cmdbox/licenses/LICENSE.opentelemetry-resourcedetector-gcp.1.9.0a0(Apache Software License).txt +201 -0
  96. cmdbox/licenses/LICENSE.opentelemetry-sdk.1.33.0(Apache Software License).txt +201 -0
  97. cmdbox/licenses/LICENSE.opentelemetry-semantic-conventions.0.54b0(Apache Software License).txt +201 -0
  98. cmdbox/licenses/LICENSE.propcache.0.3.1(Apache Software License).txt +202 -0
  99. cmdbox/licenses/LICENSE.proto-plus.1.26.1(Apache Software License).txt +202 -0
  100. cmdbox/licenses/{LICENSE.Pygments.2.18.0(BSD License).txt → LICENSE.protobuf.5.29.4(3-Clause BSD License).txt } +15 -8
  101. cmdbox/licenses/LICENSE.pyasn1.0.6.1(BSD License).txt +24 -0
  102. cmdbox/licenses/LICENSE.pyasn1_modules.0.4.2(BSD License).txt +24 -0
  103. cmdbox/licenses/LICENSE.pydantic-settings.2.9.1(MIT License).txt +21 -0
  104. cmdbox/licenses/{LICENSE.gevent.25.4.1(MIT).txt → LICENSE.pyparsing.3.2.3(MIT License).txt } +5 -12
  105. cmdbox/licenses/LICENSE.python-dateutil.2.9.0.post0(Apache Software License; BSD License).txt +54 -0
  106. cmdbox/licenses/LICENSE.referencing.0.36.2(UNKNOWN).txt +19 -0
  107. cmdbox/licenses/LICENSE.regex.2024.11.6(Apache Software License).txt +208 -0
  108. cmdbox/licenses/LICENSE.rpds-py.0.24.0(MIT).txt +19 -0
  109. cmdbox/licenses/{LICENSE.python-multipart.0.0.17(Apache Software License).txt → LICENSE.rsa.4.9.1(Apache Software License).txt } +1 -2
  110. cmdbox/licenses/{LICENSE.sphinx-intl.2.3.0(BSD License).txt → LICENSE.shapely.2.1.0(BSD License).txt } +6 -2
  111. cmdbox/licenses/LICENSE.sse-starlette.2.3.4(BSD License).txt +27 -0
  112. cmdbox/licenses/LICENSE.tiktoken.0.9.0(MIT License).txt +21 -0
  113. cmdbox/licenses/LICENSE.tokenizers.0.21.1(Apache Software License).txt +1 -0
  114. cmdbox/licenses/{LICENSE.six.1.16.0(MIT License).txt → LICENSE.tqdm.4.67.1(MIT License; Mozilla Public License 2.0 (MPL 2.0)).txt } +32 -1
  115. cmdbox/licenses/{LICENSE.rich.13.9.4(MIT License).txt → LICENSE.tzlocal.5.3.1(MIT License).txt } +3 -3
  116. cmdbox/licenses/LICENSE.uritemplate.4.1.1(Apache Software License; BSD License).txt +3 -0
  117. cmdbox/licenses/LICENSE.wrapt.1.17.2(BSD License).txt +24 -0
  118. cmdbox/licenses/LICENSE.yarl.1.20.0(Apache Software License).txt +202 -0
  119. cmdbox/licenses/files.txt +111 -17
  120. cmdbox/logconf_agent.yml +38 -0
  121. cmdbox/logconf_audit.yml +13 -5
  122. cmdbox/logconf_client.yml +13 -5
  123. cmdbox/logconf_cmdbox.yml +13 -5
  124. cmdbox/logconf_edge.yml +13 -5
  125. cmdbox/logconf_gui.yml +13 -5
  126. cmdbox/logconf_server.yml +13 -5
  127. cmdbox/logconf_web.yml +13 -5
  128. cmdbox/version.py +3 -2
  129. cmdbox/web/agent.html +263 -0
  130. cmdbox/web/assets/cmdbox/agent.js +335 -0
  131. cmdbox/web/assets/cmdbox/common.js +1111 -1020
  132. cmdbox/web/assets/cmdbox/signin.js +16 -3
  133. cmdbox/web/assets/cmdbox/users.js +1 -1
  134. cmdbox/web/assets/filer/filer.js +4 -2
  135. cmdbox/web/signin.html +10 -6
  136. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/METADATA +132 -35
  137. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/RECORD +161 -123
  138. cmdbox/app/features/web/cmdbox_web_load_pin.py +0 -43
  139. cmdbox/app/features/web/cmdbox_web_save_pin.py +0 -42
  140. cmdbox/licenses/LICENSE.Jinja2.3.1.4(BSD License).txt +0 -28
  141. cmdbox/licenses/LICENSE.Sphinx.8.1.3(BSD License).txt +0 -31
  142. cmdbox/licenses/LICENSE.babel.2.16.0(BSD License).txt +0 -27
  143. cmdbox/licenses/LICENSE.certifi.2025.1.31(Mozilla Public License 2.0 (MPL 2.0)).txt +0 -20
  144. cmdbox/licenses/LICENSE.click.8.1.8(BSD License).txt +0 -28
  145. cmdbox/licenses/LICENSE.cryptography.44.0.2(Apache Software License; BSD License).txt +0 -3
  146. cmdbox/licenses/LICENSE.greenlet.3.2.0(MIT AND Python-2.0).txt +0 -30
  147. cmdbox/licenses/LICENSE.keyring.25.5.0(MIT License).txt +0 -17
  148. cmdbox/licenses/LICENSE.numpy.2.2.4(BSD License).txt +0 -950
  149. cmdbox/licenses/LICENSE.pillow.11.0.0(CMU License (MIT-CMU)).txt +0 -1226
  150. cmdbox/licenses/LICENSE.pillow.11.1.0(CMU License (MIT-CMU)).txt +0 -1213
  151. cmdbox/licenses/LICENSE.prettytable.3.12.0(BSD License).txt +0 -30
  152. cmdbox/licenses/LICENSE.prompt_toolkit.3.0.50(BSD License).txt +0 -27
  153. cmdbox/licenses/LICENSE.psycopg.3.2.6(GNU Lesser General Public License v3 (LGPLv3)).txt +0 -165
  154. cmdbox/licenses/LICENSE.pydantic.2.11.1(MIT License).txt +0 -21
  155. cmdbox/licenses/LICENSE.pydantic.2.11.3(MIT License).txt +0 -21
  156. cmdbox/licenses/LICENSE.python-dotenv.1.0.1(BSD License).txt +0 -27
  157. cmdbox/licenses/LICENSE.twine.5.1.1(Apache Software License).txt +0 -174
  158. cmdbox/licenses/LICENSE.typing_extensions.4.13.0(UNKNOWN).txt +0 -279
  159. cmdbox/licenses/LICENSE.urllib3.2.2.3(MIT License).txt +0 -21
  160. cmdbox/licenses/LICENSE.urllib3.2.3.0(MIT License).txt +0 -21
  161. cmdbox/licenses/LICENSE.uvicorn.0.34.1(BSD License).txt +0 -27
  162. cmdbox/licenses/LICENSE.watchfiles.1.0.4(MIT License).txt +0 -21
  163. cmdbox/licenses/LICENSE.websockets.14.1(BSD License).txt +0 -24
  164. cmdbox/licenses/LICENSE.zope.interface.7.1.1(Zope Public License).txt +0 -44
  165. /cmdbox/licenses/{LICENSE.typing_extensions.4.12.2(Python Software Foundation License).txt → LICENSE.aiohappyeyeballs.2.6.1(Python Software Foundation License).txt} +0 -0
  166. /cmdbox/licenses/{LICENSE.certifi.2024.8.30(Mozilla Public License 2.0 (MPL 2.0)).txt → LICENSE.certifi.2025.4.26(Mozilla Public License 2.0 (MPL 2.0)).txt} +0 -0
  167. /cmdbox/licenses/{LICENSE.charset-normalizer.3.4.1(MIT License).txt → LICENSE.charset-normalizer.3.4.2(MIT License).txt} +0 -0
  168. /cmdbox/licenses/{LICENSE.click.8.1.7(BSD License).txt → LICENSE.click.8.2.0(UNKNOWN).txt} +0 -0
  169. /cmdbox/licenses/{LICENSE.cryptography.43.0.3(Apache Software License; BSD License).txt → LICENSE.cryptography.44.0.3(Apache Software License; BSD License).txt} +0 -0
  170. /cmdbox/licenses/{LICENSE.gevent.24.11.1(MIT License).txt → LICENSE.gevent.25.4.2(MIT).txt} +0 -0
  171. /cmdbox/licenses/{LICENSE.importlib_metadata.8.5.0(Apache Software License).txt → LICENSE.google-api-core.2.24.2(Apache Software License).txt} +0 -0
  172. /cmdbox/licenses/{LICENSE.greenlet.3.1.1(MIT License).txt → LICENSE.greenlet.3.2.2(MIT AND Python-2.0).txt} +0 -0
  173. /cmdbox/licenses/{LICENSE.h11.0.14.0(MIT License).txt → LICENSE.h11.0.16.0(MIT License).txt} +0 -0
  174. /cmdbox/licenses/{LICENSE.nh3.0.2.18(MIT).txt → LICENSE.jiter.0.9.0(MIT License).txt} +0 -0
  175. /cmdbox/licenses/{LICENSE.more-itertools.10.5.0(MIT License).txt → LICENSE.more-itertools.10.7.0(MIT License).txt} +0 -0
  176. /cmdbox/licenses/{LICENSE.numpy.2.1.3(BSD License).txt → LICENSE.numpy.2.2.5(BSD License).txt} +0 -0
  177. /cmdbox/licenses/{LICENSE.packaging.24.2(Apache Software License; BSD License).txt → LICENSE.packaging.25.0(Apache Software License; BSD License).txt} +0 -0
  178. /cmdbox/licenses/{LICENSE.psycopg-binary.3.2.6(GNU Lesser General Public License v3 (LGPLv3)).txt → LICENSE.psycopg-binary.3.2.7(GNU Lesser General Public License v3 (LGPLv3)).txt} +0 -0
  179. /cmdbox/licenses/{LICENSE.psycopg-pool.3.2.6(GNU Lesser General Public License v3 (LGPLv3)).txt → LICENSE.psycopg.3.2.7(GNU Lesser General Public License v3 (LGPLv3)).txt} +0 -0
  180. /cmdbox/licenses/{LICENSE.pydantic.2.10.2(MIT License).txt → LICENSE.pydantic.2.11.4(MIT License).txt} +0 -0
  181. /cmdbox/licenses/{LICENSE.pydantic_core.2.27.1(MIT License).txt → LICENSE.pydantic_core.2.33.2(MIT License).txt} +0 -0
  182. /cmdbox/licenses/{LICENSE.redis.5.2.0(MIT License).txt → LICENSE.redis.6.0.0(MIT License).txt} +0 -0
  183. /cmdbox/licenses/{LICENSE.snowballstemmer.2.2.0(BSD License).txt → LICENSE.snowballstemmer.3.0.1(BSD License).txt} +0 -0
  184. /cmdbox/licenses/{LICENSE.uvicorn.0.32.1(BSD License).txt → LICENSE.uvicorn.0.34.2(BSD License).txt} +0 -0
  185. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/LICENSE +0 -0
  186. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/WHEEL +0 -0
  187. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/entry_points.txt +0 -0
  188. {cmdbox-0.5.3.1.dist-info → cmdbox-0.6.0.dist-info}/top_level.txt +0 -0
@@ -59,17 +59,22 @@ $(() => {
59
59
  const btn_google = $('.btn-google');
60
60
  const btn_github = $('.btn-github');
61
61
  const btn_azure = $('.btn-azure');
62
+ const btn_saml_azure = $('.btn-saml-azure');
62
63
  btn_google.off('click').on('click', async (event) => {
63
64
  const path = window.location.pathname.replace('/signin', '');
64
- window.location.href = `../oauth2/google${path}?n=${cmdbox.randam_string(8)}`;
65
+ window.location.href = `../oauth2/google${path}?n=${cmdbox.random_string(8)}`;
65
66
  });
66
67
  btn_github.off('click').on('click', async (event) => {
67
68
  const path = window.location.pathname.replace('/signin', '');
68
- window.location.href = `../oauth2/github${path}?n=${cmdbox.randam_string(8)}`;
69
+ window.location.href = `../oauth2/github${path}?n=${cmdbox.random_string(8)}`;
69
70
  });
70
71
  btn_azure.off('click').on('click', async (event) => {
71
72
  const path = window.location.pathname.replace('/signin', '');
72
- window.location.href = `../oauth2/azure${path}?n=${cmdbox.randam_string(8)}`;
73
+ window.location.href = `../oauth2/azure${path}?n=${cmdbox.random_string(8)}`;
74
+ });
75
+ btn_saml_azure.off('click').on('click', async (event) => {
76
+ const path = window.location.pathname.replace('/signin', '');
77
+ window.location.href = `../saml/azure${path}?n=${cmdbox.random_string(8)}`;
73
78
  });
74
79
  oauth2_enabled().then((res) => {
75
80
  if (res.google) btn_google.show();
@@ -79,6 +84,10 @@ $(() => {
79
84
  if (res.azure) btn_azure.show();
80
85
  else btn_azure.hide();
81
86
  });
87
+ saml_enabled().then((res) => {
88
+ if (res.azure) btn_saml_azure.show();
89
+ else btn_saml_azure.hide();
90
+ });
82
91
  });
83
92
  const get_client_data = async () => {
84
93
  const res = await fetch('gui/get_client_data', {method: 'GET'});
@@ -91,4 +100,8 @@ const bbforce_cmd = async () => {
91
100
  const oauth2_enabled = async () => {
92
101
  const res = await fetch('../oauth2/enabled', {method: 'GET'});
93
102
  return await res.json();
103
+ }
104
+ const saml_enabled = async () => {
105
+ const res = await fetch('../saml/enabled', {method: 'GET'});
106
+ return await res.json();
94
107
  }
@@ -63,7 +63,7 @@ users.users_list = async () => {
63
63
  const row = $(modal.find('.row_content_template_choice').html()).appendTo(row_content);
64
64
  row_content.find('.row_content_template_title').removeClass('row_content_template_title').text(col);
65
65
  const select = row_content.find('.row_content_template_select').removeClass('row_content_template_select');
66
- for (const h of ['', 'oauth2', 'plain', 'md5', 'sha1', 'sha256']) {
66
+ for (const h of ['', 'oauth2', 'saml', 'plain', 'md5', 'sha1', 'sha256']) {
67
67
  $('<option>').text(h).val(h).appendTo(select);
68
68
  }
69
69
  select.attr('name', col).val(user && user[col] ? user[col] : '');
@@ -145,7 +145,8 @@ fsapi.filer = (svpath, is_local) => {
145
145
  opt['capture_maxsize'] = 1024**3*10;
146
146
  //opt['svpath'] = event.originalEvent.dataTransfer.getData('path');
147
147
  jobs.push(cmdbox.sv_exec_cmd(opt).then(async res => {
148
- if(!res[0] || !res[0]['success']) {
148
+ if (res && res['success']) res = [res];
149
+ if (!res[0] || !res[0]['success']) {
149
150
  fsapi.download_now ++;
150
151
  cmdbox.progress(0, list_downloads.length, fsapi.download_now, '', true, false)
151
152
  cmdbox.message(res);
@@ -276,6 +277,7 @@ fsapi.tree = (target, svpath, current_ul_elem, is_local) => {
276
277
  res[0]['success']['_'] = fsapi.treemem;
277
278
  }
278
279
  }
280
+ if (res && res['success']) res = [res];
279
281
  if(!res[0] || !res[0]['success']) {
280
282
  cmdbox.message(res);
281
283
  target.find('.file-list').html('');
@@ -420,7 +422,7 @@ fsapi.tree = (target, svpath, current_ul_elem, is_local) => {
420
422
  const opt = cmdbox.get_server_opt(false, fsapi.right);
421
423
  const thum_size = "0";
422
424
  const constr = btoa(`${opt['host']}\t${opt['port']}\t${opt['svname']}\t${opt['password']}\t${encodeURIComponent(_p)}\t${opt['scope']}\t${thum_size}`);
423
- fsapi.viewer(_p, res['data'], `filer/download/${constr}?r=${cmdbox.randam_string(8)}`, _mime);
425
+ fsapi.viewer(_p, res['data'], `filer/download/${constr}?r=${cmdbox.random_string(8)}`, _mime);
424
426
  }
425
427
  }).finally(() => {
426
428
  cmdbox.hide_loading();
cmdbox/web/signin.html CHANGED
@@ -115,16 +115,20 @@
115
115
  <button class="btn btn-primary w-100 py-2" type="submit">Sign in</button>
116
116
  <div class="mt-3">
117
117
  <button class="btn btn-outline-primary w-100 py-2 mb-3 btn-azure" type="button" style="display:none;">
118
- <svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
119
- Sign in with Microsoft
118
+ <svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
119
+ Sign in with Microsoft OAuth2
120
120
  </button>
121
121
  <button class="btn btn-outline-primary w-100 py-2 mb-3 btn-google" type="button" style="display:none;">
122
- <svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#google"></use></svg>
123
- Sign in with Google
122
+ <svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#google"></use></svg>
123
+ Sign in with Google OAuth2
124
124
  </button>
125
125
  <button class="btn btn-outline-primary w-100 py-2 mb-3 btn-github" type="button" style="display:none;">
126
- <svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#github"></use></svg>
127
- Sign in with Github
126
+ <svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#github"></use></svg>
127
+ Sign in with Github OAuth2
128
+ </button>
129
+ <button class="btn btn-outline-primary w-100 py-2 mb-3 btn-saml-azure" type="button" style="display:none;">
130
+ <svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
131
+ Sign in with Microsoft SAML
128
132
  </button>
129
133
  </div>
130
134
  </form>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmdbox
3
- Version: 0.5.3.1
3
+ Version: 0.6.0
4
4
  Summary: cmdbox: It is a command line application with a plugin mechanism.
5
5
  Home-page: https://github.com/hamacom2004jp/cmdbox
6
6
  Download-URL: https://github.com/hamacom2004jp/cmdbox
@@ -22,6 +22,7 @@ Requires-Python: >=3.8
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: argcomplete
25
+ Requires-Dist: async-timeout
25
26
  Requires-Dist: cryptography
26
27
  Requires-Dist: fastapi
27
28
  Requires-Dist: gevent
@@ -37,6 +38,7 @@ Requires-Dist: pycryptodome
37
38
  Requires-Dist: questionary
38
39
  Requires-Dist: redis
39
40
  Requires-Dist: requests
41
+ Requires-Dist: rich
40
42
  Requires-Dist: six
41
43
  Requires-Dist: tabulate
42
44
  Requires-Dist: uvicorn[standard]
@@ -55,18 +57,48 @@ Requires-Dist: wheel
55
57
  # Install
56
58
 
57
59
  - Install cmdbox with the following command.
60
+ - Also install the docker version of the redis server.
58
61
 
59
62
  ```bash
63
+ docker run -p 6379:6379 --name redis -e REDIS_PASSWORD=password -it ubuntu/redis:latest
60
64
  pip install cmdbox
61
65
  cmdbox -v
62
66
  ```
63
67
 
64
- - Also install the docker version of the redis server.
68
+ - When using SAML in web mode, install the modules with dependencies.
69
+ ```bash
70
+ pip install xmlsec==1.3.13 python3-saml
71
+ apt-get install -y pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl build-essential libopencv-dev
72
+ ```
73
+
74
+ - When using `--agent use` in web mode, install the modules with dependencies.
75
+ ```bash
76
+ pip install google-adk litellm
77
+ ```
78
+
79
+ # Run
80
+
81
+ - Run the cmdbox server.
82
+
83
+ ```bash
84
+ cmdbox -m server -c start &
85
+ ```
86
+
87
+ - Run the cmdbox web.
88
+
89
+ ```bash
90
+ cmdbox -m web -c start --signin_file .cmdbox/user_list.yml &
91
+ ```
92
+
93
+ - Run the cmdbox web with agent.
94
+ - Below is an example of using Google vertexai.
95
+ - Other available options include Azure OpenAI and Ollama.
65
96
 
66
97
  ```bash
67
- docker run -p 6379:6379 --name redis -it ubuntu/redis:latest
98
+ cmdbox -m web -c start --signin_file .cmdbox/user_list.yml --agent use --llmprov vertexai --llmmodel gemini-2.0-flash --llmlocation us-central1 --llmsvaccountfile <account json file>
68
99
  ```
69
100
 
101
+
70
102
  # Tutorial
71
103
 
72
104
  - Open the ```.sample/sample_project``` folder in the current directory with VSCode.
@@ -287,29 +319,47 @@ aliases: # Specify the alias for the specified co
287
319
  # e.g. /{1}_exec
288
320
  move: # Specify whether to move the regular expression group of the source to the target.
289
321
  # e.g. true
290
- audit:
291
- enabled: true # Specify whether to enable the audit function.
292
- write:
293
- mode: audit # Specify the mode of the feature to be writed.
294
- cmd: write # Specify the command to be writed.
295
- search:
296
- mode: audit # Specify the mode of the feature to be searched.
297
- cmd: search # Specify the command to be searched.
298
- options: # Specify the options for the audit function.
299
- host: localhost # Specify the service host of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
300
- port: 6379 # Specify the service port of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
301
- password: password # Specify the access password of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
302
- svname: server # Specify the audit service name of the inference server.However, if it is specified as a command line argument, it is ignored.
303
- retry_count: 3 # Specifies the number of reconnections to the audit Redis server.If less than 0 is specified, reconnection is forever.
304
- retry_interval: 1 # Specifies the number of seconds before reconnecting to the audit Redis server.
305
- timeout: 15 # Specify the maximum waiting time until the server responds.
306
- pg_enabled: False # Specify True if using the postgresql database server.
307
- pg_host: localhost # Specify the postgresql host.
308
- pg_port: 5432 # Specify the postgresql port.
309
- pg_user: postgres # Specify the postgresql user name.
310
- pg_password: password # Specify the postgresql password.
311
- pg_dbname: audit # Specify the postgresql database name.
312
- retention_period_days: 365 # Specify the number of days to retain audit logs.
322
+ agentrule: # Specifies a list of rules that determine which commands the agent can execute.
323
+ policy: deny # Specify the default policy for the rule. The value can be allow or deny.
324
+ rules: # Specify the rules for the commands that the agent can execute according to the group to which the user belongs.
325
+ - mode: audit # Specify the "mode" as the condition for applying the rule.
326
+ cmds: [search, write] # Specify the "cmd" to which the rule applies. Multiple items can be specified in a list.
327
+ rule: allow # Specifies whether the specified command is allowed or not. Values are allow or deny.
328
+ - mode: client
329
+ cmds: [file_copy, file_download, file_list, file_mkdir, file_move, file_remove, file_rmdir, file_upload, server_info]
330
+ rule: allow
331
+ - mode: cmd
332
+ cmds: [list, load]
333
+ rule: allow
334
+ - mode: server
335
+ cmds: [list]
336
+ rule: allow
337
+ - mode: web
338
+ cmds: [gencert, genpass, group_list, user_list]
339
+ rule: allow
340
+ audit:
341
+ enabled: true # Specify whether to enable the audit function.
342
+ write:
343
+ mode: audit # Specify the mode of the feature to be writed.
344
+ cmd: write # Specify the command to be writed.
345
+ search:
346
+ mode: audit # Specify the mode of the feature to be searched.
347
+ cmd: search # Specify the command to be searched.
348
+ options: # Specify the options for the audit function.
349
+ host: localhost # Specify the service host of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
350
+ port: 6379 # Specify the service port of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
351
+ password: password # Specify the access password of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
352
+ svname: cmdbox # Specify the audit service name of the inference server.However, if it is specified as a command line argument, it is ignored.
353
+ retry_count: 3 # Specifies the number of reconnections to the audit Redis server.If less than 0 is specified, reconnection is forever.
354
+ retry_interval: 1 # Specifies the number of seconds before reconnecting to the audit Redis server.
355
+ timeout: 15 # Specify the maximum waiting time until the server responds.
356
+ pg_enabled: False # Specify True if using the postgresql database server.
357
+ pg_host: localhost # Specify the postgresql host.
358
+ pg_port: 5432 # Specify the postgresql port.
359
+ pg_user: postgres # Specify the postgresql user name.
360
+ pg_password: password # Specify the postgresql password.
361
+ pg_dbname: audit # Specify the postgresql database name.
362
+ retention_period_days: 365 # Specify the number of days to retain audit logs.
313
363
 
314
364
  ```
315
365
 
@@ -323,25 +373,25 @@ aliases: # Specify the alias for the specified co
323
373
  users: # A list of users, each of which is a map that contains the following fields.
324
374
  - uid: 1 # An ID that identifies a user. No two users can have the same ID.
325
375
  name: admin # A name that identifies the user. No two users can have the same name.
326
- password: XXXXXXXXXXX # The user's password. The value is hashed with the hash function specified in the next hash field.
327
- hash: plain # The hash function used to hash the password, which can be plain, md5, sha1, or sha256, or oauth2.
376
+ password: XXXXXXXXXXXXXXXX # The user's password. The value is hashed with the hash function specified in the next hash field.
377
+ hash: plain # The hash function used to hash the password, which can be plain, md5, sha1, or sha256, or oauth2, or saml.
328
378
  groups: [admin] # A list of groups to which the user belongs, as specified in the groups field.
329
- email: admin@aaa.bbb.jp # The email address of the user, used when authenticating using the provider specified in the oauth2 field.
379
+ email: admin@aaa.bbb.jp # The email address of the user, used when authenticating using the provider specified in the oauth2 or saml field.
330
380
  - uid: 101
331
381
  name: user01
332
- password: XXXXXXXXXXX
382
+ password: XXXXXXXXXXXXXXXX
333
383
  hash: md5
334
384
  groups: [user]
335
385
  email: user01@aaa.bbb.jp
336
386
  - uid: 102
337
387
  name: user02
338
- password: XXXXXXXXXXX
388
+ password: XXXXXXXXXXXXXXXX
339
389
  hash: sha1
340
390
  groups: [readonly]
341
391
  email: user02@aaa.bbb.jp
342
392
  - uid: 103
343
393
  name: user03
344
- password: XXXXXXXXXXX
394
+ password: XXXXXXXXXXXXXXXX
345
395
  hash: sha256
346
396
  groups: [editor]
347
397
  email: user03@aaa.bbb.jp
@@ -371,6 +421,10 @@ cmdrule: # A list of command rules, Specify a rule that de
371
421
  mode: server
372
422
  cmds: [list]
373
423
  rule: allow
424
+ - groups: [user, guest]
425
+ mode: audit
426
+ cmds: [write]
427
+ rule: allow
374
428
  - groups: [user, guest]
375
429
  mode: web
376
430
  cmds: [genpass]
@@ -391,7 +445,8 @@ pathrule: # List of RESTAPI rules, rules that determine whe
391
445
  rule: allow
392
446
  - groups: [user]
393
447
  paths: [/signin, /assets, /bbforce_cmd, /copyright, /dosignin, /dosignout, /password/change,
394
- /exec_cmd, /exec_pipe, /filer, /gui, /get_server_opt, /usesignout, /versions_cmdbox, /versions_used]
448
+ /gui/user_data/load, /gui/user_data/save, /gui/user_data/delete,
449
+ /exec_cmd, /exec_pipe, /filer, /result, /gui, /get_server_opt, /usesignout, /versions_cmdbox, /versions_used]
395
450
  rule: allow
396
451
  - groups: [readonly]
397
452
  paths: [/gui/del_cmd, /gui/del_pipe, /gui/save_cmd, /gui/save_pipe]
@@ -426,7 +481,8 @@ oauth2: # OAuth2 settings.
426
481
  client_secret: XXXXXXXXXXX # Specify Google's OAuth2 client secret.
427
482
  redirect_uri: https://localhost:8443/oauth2/google/callback # Specify Google's OAuth2 redirect URI.
428
483
  scope: ['email'] # Specify the scope you want to retrieve with Google's OAuth2. Usually, just reading the email is sufficient.
429
- signin_module: # Specify the module name that implements the sign-in. see, cmdbox.app.signin.SignIn
484
+ signin_module: # Specify the module name that implements the sign-in.
485
+ cmdbox.app.auth.google_signin
430
486
  note: # Specify a description such as Google's OAuth2 reference site.
431
487
  - https://developers.google.com/identity/protocols/oauth2/web-server?hl=ja#httprest
432
488
  github: # OAuth2 settings for GitHub.
@@ -435,9 +491,50 @@ oauth2: # OAuth2 settings.
435
491
  client_secret: XXXXXXXXXXX # Specify the GitHub OAuth2 client secret.
436
492
  redirect_uri: https://localhost:8443/oauth2/github/callback # Specify the OAuth2 redirect URI for GitHub.
437
493
  scope: ['user:email'] # Specify the scope you want to get from GitHub's OAuth2. Usually, just reading the email is sufficient.
438
- signin_module: # Specify the module name that implements the sign-in. see, cmdbox.app.signin.SignIn
494
+ signin_module: # Specify the module name that implements the sign-in.
495
+ cmdbox.app.auth.github_signin
439
496
  note: # Specify a description, such as a reference site for OAuth2 on GitHub.
440
497
  - https://docs.github.com/ja/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#scopes
498
+ azure: # OAuth2 settings for Azure AD.
499
+ enabled: false # Specify whether to enable OAuth2 for Azure AD.
500
+ tenant_id: XXXXXXXXXXX # Specify the tenant ID for Azure AD.
501
+ client_id: XXXXXXXXXXX # Specify the OAuth2 client ID for Azure AD.
502
+ client_secret: XXXXXXXXXXX # Specify the Azure AD OAuth2 client secret.
503
+ redirect_uri: https://localhost:8443/oauth2/azure/callback # Specify the OAuth2 redirect URI for Azure AD.
504
+ scope: ['openid', 'profile', 'email', 'https://graph.microsoft.com/mail.read']
505
+ signin_module: # Specify the module name that implements the sign-in.
506
+ cmdbox.app.auth.azure_signin
507
+ note: # Specify a description, such as a reference site for Azure AD's OAuth2.
508
+ - https://learn.microsoft.com/ja-jp/entra/identity-platform/v2-oauth2-auth-code-flow
509
+ saml: # SAML settings.
510
+ providers: # This is a per-provider setting for OAuth2.
511
+ azure: # SAML settings for Azure AD.
512
+ enabled: false # Specify whether to enable SAML authentication for Azure AD.
513
+ signin_module: # Specify the module name that implements the sign-in.
514
+ cmdbox.app.auth.azure_signin_saml # Specify the python3-saml configuration.
515
+ # see) https://github.com/SAML-Toolkits/python3-saml
516
+ sp:
517
+ entityId: https://localhost:8443/
518
+ assertionConsumerService:
519
+ url: https://localhost:8443/saml/azure/callback
520
+ binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
521
+ attributeConsumingService: {}
522
+ singleLogoutService:
523
+ binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
524
+ NameIDFormat: urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
525
+ x509cert: ''
526
+ privateKey: ''
527
+ idp:
528
+ entityId: https://sts.windows.net/{tenant-id}/
529
+ singleSignOnService:
530
+ url: https://login.microsoftonline.com/{tenant-id}/saml2
531
+ binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
532
+ x509cert: XXXXXXXXXXX
533
+ singleLogoutService: {}
534
+ certFingerprint: ''
535
+ certFingerprintAlgorithm: sha1
536
+
537
+
441
538
  ```
442
539
 
443
540
  - See the documentation for references to each file.