insightconnect-plugin-runtime 5.3.0__py3-none-any.whl → 5.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.
@@ -157,11 +157,13 @@ class Endpoints:
157
157
  500:
158
158
  description: Unexpected error
159
159
  """
160
+ self.logger.info("Plugin task beginning execution...")
160
161
  input_message = request.get_json(force=True)
161
162
  self.logger.debug("Request input: %s", input_message)
162
163
  Endpoints.validate_action_trigger_task_empty_input(input_message)
163
164
  Endpoints.validate_action_trigger_task_name(input_message, name, "task")
164
165
  output = self.run_action_trigger_task(input_message)
166
+ self.logger.info("Plugin task finished execution...")
165
167
  return output
166
168
 
167
169
  @legacy.route("/triggers/<string:name>/test", methods=["POST"])
@@ -1,4 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
+ import structlog
3
+ logger = structlog.get_logger("plugin")
4
+
5
+
2
6
  class ClientException(Exception):
3
7
  """
4
8
  An exception which marks an error made by the plugin invoker.
@@ -120,6 +124,12 @@ class ConnectionTestException(Exception):
120
124
 
121
125
  self.data = str(data) if data else ""
122
126
 
127
+ # Safeguard to ensure the exception is logged across all plugins even if the plugin
128
+ # itself does not call `self.logger.error(<error info>)`
129
+ params = ["cause", "assistance", "data", "preset"]
130
+ info_log = ", ".join([f"{atr}='{getattr(self, atr)}'" for atr in params if getattr(self, atr)])
131
+ logger.error(f"Plugin exception instantiated. {info_log}")
132
+
123
133
  def __str__(self):
124
134
  if self.data:
125
135
  return "Connection test failed!\n\n{cause} {assistance} Response was: {data}".format(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: insightconnect-plugin-runtime
3
- Version: 5.3.0
3
+ Version: 5.3.1
4
4
  Summary: InsightConnect Plugin Runtime
5
5
  Home-page: https://github.com/rapid7/komand-plugin-sdk-python
6
6
  Author: Rapid7 Integrations Alliance
@@ -212,6 +212,7 @@ after cloning this repository.
212
212
 
213
213
  ## Changelog
214
214
 
215
+ * 5.3.1 - New logging added to the beginning and end of a task | New logging when an exception is instantiated.
215
216
  * 5.3.0 - Update base images to pull Python 3.9.18 | python packages bump | rename image to drop python minor version.
216
217
  * 5.2.4 - Extended logging with OrgID and IntID
217
218
  * 5.2.3 - Extended logging in AWSClient
@@ -3,7 +3,7 @@ insightconnect_plugin_runtime/action.py,sha256=8gsOONf7mzY83O3DNjCBIafk7C7acnf7m
3
3
  insightconnect_plugin_runtime/cli.py,sha256=Pb-Janu-XfRlSXxPHh30OIquljWptrhhS51C3clJqh4,8939
4
4
  insightconnect_plugin_runtime/connection.py,sha256=4bHHV2B0UFGsAtvLu1fiYQRwx7fissUakHPUyjLQO0E,2340
5
5
  insightconnect_plugin_runtime/dispatcher.py,sha256=ru7njnyyWE1-oD-VbZJ-Z8tELwvDf69rM7Iezs4rbnw,1774
6
- insightconnect_plugin_runtime/exceptions.py,sha256=YEbm63_s6J6978Elsfz2mavoSaxdtPVkHPC6WYNDTBI,6060
6
+ insightconnect_plugin_runtime/exceptions.py,sha256=rC74M9aCSrY7J-nq9ttsccLkNbHR0gbZ2SRvXlCgLx0,6507
7
7
  insightconnect_plugin_runtime/helper.py,sha256=m5PxN04-NPXM1X10S2wwjqmiLvnNntd6TnwLoW4nnus,21108
8
8
  insightconnect_plugin_runtime/metrics.py,sha256=hf_Aoufip_s4k4o8Gtzz90ymZthkaT2e5sXh5B4LcF0,3186
9
9
  insightconnect_plugin_runtime/plugin.py,sha256=YEwxPHyIYsQcGAZYQZqh60POQOzbrtsZAcA5TcBmy8g,22708
@@ -15,7 +15,7 @@ insightconnect_plugin_runtime/trigger.py,sha256=Zq3cy68N3QxAGbNZKCID6CZF05Zi7YD2
15
15
  insightconnect_plugin_runtime/util.py,sha256=lE6UVOYyzY9Ldyqpf91V24CvvdKjUu3WjGOSy957Sm0,8073
16
16
  insightconnect_plugin_runtime/variables.py,sha256=7FjJGnU7KUR7m9o-_tRq7Q3KiaB1Pp0Apj1NGgOwrJk,3056
17
17
  insightconnect_plugin_runtime/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- insightconnect_plugin_runtime/api/endpoints.py,sha256=BjLr9YNM9J5cHXWfpD49JvBSB93jr-EChXxmXHhFVig,28966
18
+ insightconnect_plugin_runtime/api/endpoints.py,sha256=jjKTFArNIOJkZw-L0QU_1yzRcKC6xyAC8ge86M6fQjQ,29099
19
19
  insightconnect_plugin_runtime/api/schemas.py,sha256=jRmDrwLJTBl-iQOnyZkSwyJlCWg4eNjAnKfD9Eko4z0,2754
20
20
  insightconnect_plugin_runtime/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  insightconnect_plugin_runtime/clients/aws_client.py,sha256=3Ytx-uchkl7dTcwYKZPKvCJaWralEqZUZeireOCWlPo,20290
@@ -71,7 +71,7 @@ tests/unit/test_schema.py,sha256=swWZPRo_Q4M6VHte-srmxcV2wH-XS7pgmNRxpaL0Qrg,642
71
71
  tests/unit/test_server_spec.py,sha256=7hmXdsY36nP0ENhijrolBInAMJwht2-Z-D6yhcg_zZI,578
72
72
  tests/unit/test_trigger.py,sha256=E53mAUoVyponWu_4IQZ0IC1gQ9lakBnTn_9vKN2IZfg,1692
73
73
  tests/unit/test_variables.py,sha256=OUEOqGYZA3Nd5oKk5GVY3hcrWKHpZpxysBJcO_v5gzs,291
74
- insightconnect_plugin_runtime-5.3.0.dist-info/METADATA,sha256=AX4be54BOYKpomlbhDMGtqiJ9ISv_PxyztqsvLirbAg,11914
75
- insightconnect_plugin_runtime-5.3.0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
76
- insightconnect_plugin_runtime-5.3.0.dist-info/top_level.txt,sha256=AJtyJOpiFzHxsbHUICTcUKXyrGQ3tZxhrEHsPjJBvEA,36
77
- insightconnect_plugin_runtime-5.3.0.dist-info/RECORD,,
74
+ insightconnect_plugin_runtime-5.3.1.dist-info/METADATA,sha256=nNNrHZvzCIPzoz3isVDx8T05UKQckWjbQOzz6Wp03mY,12026
75
+ insightconnect_plugin_runtime-5.3.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
76
+ insightconnect_plugin_runtime-5.3.1.dist-info/top_level.txt,sha256=AJtyJOpiFzHxsbHUICTcUKXyrGQ3tZxhrEHsPjJBvEA,36
77
+ insightconnect_plugin_runtime-5.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5