systemlink-cli 1.3.1__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 (74) hide show
  1. slcli/__init__.py +1 -0
  2. slcli/__main__.py +23 -0
  3. slcli/_version.py +4 -0
  4. slcli/asset_click.py +1289 -0
  5. slcli/cli_formatters.py +218 -0
  6. slcli/cli_utils.py +504 -0
  7. slcli/comment_click.py +602 -0
  8. slcli/completion_click.py +418 -0
  9. slcli/config.py +81 -0
  10. slcli/config_click.py +498 -0
  11. slcli/dff_click.py +979 -0
  12. slcli/dff_decorators.py +24 -0
  13. slcli/example_click.py +404 -0
  14. slcli/example_loader.py +274 -0
  15. slcli/example_provisioner.py +2777 -0
  16. slcli/examples/README.md +134 -0
  17. slcli/examples/_schema/schema-v1.0.json +169 -0
  18. slcli/examples/demo-complete-workflow/README.md +323 -0
  19. slcli/examples/demo-complete-workflow/config.yaml +638 -0
  20. slcli/examples/demo-test-plans/README.md +132 -0
  21. slcli/examples/demo-test-plans/config.yaml +154 -0
  22. slcli/examples/exercise-5-1-parametric-insights/README.md +101 -0
  23. slcli/examples/exercise-5-1-parametric-insights/config.yaml +1589 -0
  24. slcli/examples/exercise-7-1-test-plans/README.md +93 -0
  25. slcli/examples/exercise-7-1-test-plans/config.yaml +323 -0
  26. slcli/examples/spec-compliance-notebooks/README.md +140 -0
  27. slcli/examples/spec-compliance-notebooks/config.yaml +112 -0
  28. slcli/examples/spec-compliance-notebooks/notebooks/SpecAnalysis_ComplianceCalculation.ipynb +1553 -0
  29. slcli/examples/spec-compliance-notebooks/notebooks/SpecComplianceCalculation.ipynb +1577 -0
  30. slcli/examples/spec-compliance-notebooks/notebooks/SpecfileExtractionAndIngestion.ipynb +912 -0
  31. slcli/examples/spec-compliance-notebooks/spec_template.xlsx +0 -0
  32. slcli/feed_click.py +892 -0
  33. slcli/file_click.py +932 -0
  34. slcli/function_click.py +1400 -0
  35. slcli/function_templates.py +85 -0
  36. slcli/main.py +406 -0
  37. slcli/mcp_click.py +269 -0
  38. slcli/mcp_server.py +748 -0
  39. slcli/notebook_click.py +1770 -0
  40. slcli/platform.py +345 -0
  41. slcli/policy_click.py +679 -0
  42. slcli/policy_utils.py +411 -0
  43. slcli/profiles.py +411 -0
  44. slcli/response_handlers.py +359 -0
  45. slcli/routine_click.py +763 -0
  46. slcli/skill_click.py +253 -0
  47. slcli/skills/slcli/SKILL.md +713 -0
  48. slcli/skills/slcli/references/analysis-recipes.md +474 -0
  49. slcli/skills/slcli/references/filtering.md +236 -0
  50. slcli/skills/systemlink-webapp/SKILL.md +744 -0
  51. slcli/skills/systemlink-webapp/references/deployment.md +123 -0
  52. slcli/skills/systemlink-webapp/references/nimble-angular.md +380 -0
  53. slcli/skills/systemlink-webapp/references/systemlink-services.md +192 -0
  54. slcli/ssl_trust.py +93 -0
  55. slcli/system_click.py +2216 -0
  56. slcli/table_utils.py +124 -0
  57. slcli/tag_click.py +794 -0
  58. slcli/templates_click.py +599 -0
  59. slcli/testmonitor_click.py +1667 -0
  60. slcli/universal_handlers.py +305 -0
  61. slcli/user_click.py +1218 -0
  62. slcli/utils.py +832 -0
  63. slcli/web_editor.py +295 -0
  64. slcli/webapp_click.py +981 -0
  65. slcli/workflow_preview.py +287 -0
  66. slcli/workflows_click.py +988 -0
  67. slcli/workitem_click.py +2258 -0
  68. slcli/workspace_click.py +576 -0
  69. slcli/workspace_utils.py +206 -0
  70. systemlink_cli-1.3.1.dist-info/METADATA +20 -0
  71. systemlink_cli-1.3.1.dist-info/RECORD +74 -0
  72. systemlink_cli-1.3.1.dist-info/WHEEL +4 -0
  73. systemlink_cli-1.3.1.dist-info/entry_points.txt +7 -0
  74. systemlink_cli-1.3.1.dist-info/licenses/LICENSE +21 -0
slcli/ssl_trust.py ADDED
@@ -0,0 +1,93 @@
1
+ """System certificate store integration utilities.
2
+
3
+ Configures the `requests` stack to use the operating system trust store via the
4
+ `truststore` library. This enables enterprise / corporate roots without modifying
5
+ the bundled certifi CA file.
6
+
7
+ Environment Variables:
8
+ SLCLI_DISABLE_OS_TRUST=1 -> Skip injection entirely (use certifi)
9
+ SLCLI_FORCE_OS_TRUST=1 -> Raise on any injection failure (fail fast)
10
+ SLCLI_DEBUG_OS_TRUST=1 -> Print traceback on injection errors
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import os
16
+ import ssl
17
+ import sys
18
+ import traceback
19
+
20
+ OS_TRUST_INJECTED: bool = False
21
+ OS_TRUST_REASON: str = "not-attempted"
22
+
23
+ __all__ = ["inject_os_trust", "OS_TRUST_INJECTED", "OS_TRUST_REASON"]
24
+
25
+
26
+ def inject_os_trust() -> None:
27
+ """Inject system certificate store into requests via truststore.
28
+
29
+ Steps:
30
+ 1. Respect SLCLI_DISABLE_OS_TRUST.
31
+ 2. Import truststore and call inject_into_requests().
32
+ 3. On failure: if SLCLI_FORCE_OS_TRUST set, re-raise; else log and fall back.
33
+
34
+ Silence on success keeps CLI output clean.
35
+ """
36
+ global OS_TRUST_INJECTED, OS_TRUST_REASON
37
+ force = os.environ.get("SLCLI_FORCE_OS_TRUST") == "1"
38
+ if os.environ.get("SLCLI_DISABLE_OS_TRUST") == "1":
39
+ OS_TRUST_INJECTED = False
40
+ OS_TRUST_REASON = "disabled-env"
41
+ return
42
+ try:
43
+ # Attempt OS trust injection using available truststore entry points.
44
+ # Multiple variants are tried in order; exceptions are handled per force/fallback rules.
45
+ import truststore # type: ignore
46
+
47
+ # Attempt known injection entry points in preferred order.
48
+ candidates = [
49
+ ("inject_into_requests", "requests"), # modern direct requests patch
50
+ ("inject_into_ssl", "ssl"), # base SSL context patch
51
+ ("inject_into_urllib3", "urllib3"), # older fallback (affects requests indirectly)
52
+ ]
53
+ injected_variant = None
54
+ injection_errors = (RuntimeError, OSError, ssl.SSLError, ValueError)
55
+ for attr_name, label in candidates:
56
+ if hasattr(truststore, attr_name):
57
+ try:
58
+ getattr(truststore, attr_name)() # type: ignore[misc]
59
+ injected_variant = label
60
+ break
61
+ except injection_errors: # pragma: no cover - try next variant
62
+ if force:
63
+ # Respect force mode: propagate the first injection failure
64
+ raise
65
+ continue
66
+ if injected_variant is None:
67
+ raise AttributeError(
68
+ "No compatible injection function on truststore module (expected one of: "
69
+ + ", ".join(name for name, _ in candidates)
70
+ + ")"
71
+ )
72
+ OS_TRUST_INJECTED = True
73
+ OS_TRUST_REASON = f"injected:{injected_variant}"
74
+ except ImportError as exc:
75
+ if force:
76
+ raise
77
+ sys.stderr.write(
78
+ f"[slcli] Info: system trust store injection skipped: {exc.__class__.__name__}: {exc}.\n"
79
+ )
80
+ if os.environ.get("SLCLI_DEBUG_OS_TRUST") == "1":
81
+ traceback.print_exc()
82
+ OS_TRUST_INJECTED = False
83
+ OS_TRUST_REASON = f"error:{exc.__class__.__name__}"
84
+ except (AttributeError, RuntimeError, OSError, ssl.SSLError, ValueError) as exc:
85
+ if force:
86
+ raise
87
+ sys.stderr.write(
88
+ f"[slcli] Info: system trust store injection skipped: {exc.__class__.__name__}: {exc}.\n"
89
+ )
90
+ if os.environ.get("SLCLI_DEBUG_OS_TRUST") == "1":
91
+ traceback.print_exc()
92
+ OS_TRUST_INJECTED = False
93
+ OS_TRUST_REASON = f"error:{exc.__class__.__name__}"