insightconnect-plugin-runtime 5.6.0__py3-none-any.whl → 5.6.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.
@@ -283,7 +283,7 @@ class Endpoints:
283
283
  self.logger.debug("Request input: %s", input_message)
284
284
  Endpoints.validate_action_trigger_task_empty_input(input_message)
285
285
  Endpoints.validate_action_trigger_task_name(input_message, name, "task")
286
- output = self.run_action_trigger_task(input_message, True)
286
+ output = self.run_action_trigger_task(input_message, True, connection_test_type="test_task")
287
287
  return output
288
288
 
289
289
  @v1.route("/api")
@@ -821,13 +821,13 @@ class Endpoints:
821
821
 
822
822
  return input_data
823
823
 
824
- def run_action_trigger_task(self, input_message, test=False):
824
+ def run_action_trigger_task(self, input_message, test=False, connection_test_type="test"):
825
825
  connection = input_message.get("body", {}).get("connection", {})
826
826
  status_code = 200
827
827
  output = None
828
828
  try:
829
829
  output = self.plugin.handle_step(
830
- input_message, is_debug=self.debug, is_test=test
830
+ input_message, is_debug=self.debug, is_test=test, connection_test_type=connection_test_type
831
831
  )
832
832
  except LoggedException as error:
833
833
  wrapped_exception = error.ex
@@ -841,6 +841,8 @@ class Endpoints:
841
841
  and wrapped_exception.preset is PluginException.Preset.BAD_REQUEST
842
842
  ):
843
843
  status_code = 400
844
+ elif isinstance(wrapped_exception, (ConnectionTestException, ClientException)):
845
+ status_code = 400
844
846
  elif isinstance(wrapped_exception, ServerException):
845
847
  # I'm unsure about this
846
848
  status_code = 500
@@ -627,7 +627,7 @@ class Plugin(object):
627
627
  # Check if connection test func available. If so - use it (preferred). Else fallback to action/trigger test
628
628
  if hasattr(step.connection, "test"):
629
629
  if hasattr(step.connection, "test") and connection_test_type == "test_task":
630
- func = step.connection.task_test
630
+ func = step.connection.test_task
631
631
  else:
632
632
  func = step.connection.test
633
633
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: insightconnect-plugin-runtime
3
- Version: 5.6.0
3
+ Version: 5.6.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
@@ -211,6 +211,7 @@ contributed. Black is installed as a test dependency and the hook can be initial
211
211
  after cloning this repository.
212
212
 
213
213
  ## Changelog
214
+ * 5.6.1 - Making sure all paths that can call the task connection test endpoints return a 400 error if the test fails
214
215
  * 5.6.0 - Add APIException class for error handling | Fix error in response_handler where data of type Response was not correctly being returned
215
216
  * 5.5.5 - Address bug with typing for type `Dict` in Python 3.8
216
217
  * 5.5.4 - Support pagination parameters within AWS client.
@@ -6,7 +6,7 @@ insightconnect_plugin_runtime/dispatcher.py,sha256=ru7njnyyWE1-oD-VbZJ-Z8tELwvDf
6
6
  insightconnect_plugin_runtime/exceptions.py,sha256=Pvcdkx81o6qC2qU661x-DzNjuIMP82x52nPMSEqEo4s,8491
7
7
  insightconnect_plugin_runtime/helper.py,sha256=kXUt_yq6-9_wMdCIkS1fC3dddE8uwH9tcRITXvrJHIM,31178
8
8
  insightconnect_plugin_runtime/metrics.py,sha256=hf_Aoufip_s4k4o8Gtzz90ymZthkaT2e5sXh5B4LcF0,3186
9
- insightconnect_plugin_runtime/plugin.py,sha256=s2YVyygPcNeXeDi3X_JmaCiLHXZWIqz4mlLJy6p7-UA,24904
9
+ insightconnect_plugin_runtime/plugin.py,sha256=l09-NxNPIfjSyklO4Jnbwf5yHQdobkcs29sjFV6N2ZE,24904
10
10
  insightconnect_plugin_runtime/schema.py,sha256=jTNc6KAMqFpaDVWrAYhkVC6e8I63P3X7uVlJkAr1hiY,583
11
11
  insightconnect_plugin_runtime/server.py,sha256=09fxsbKf2ZZvSqRP2Bv9e9-fspDyEFR8_YgIFeMnXqQ,12578
12
12
  insightconnect_plugin_runtime/step.py,sha256=KdERg-789-s99IEKN61DR08naz-YPxyinPT0C_T81C4,855
@@ -15,7 +15,7 @@ insightconnect_plugin_runtime/trigger.py,sha256=Zq3cy68N3QxAGbNZKCID6CZF05Zi7YD2
15
15
  insightconnect_plugin_runtime/util.py,sha256=qPkZ3LA55nYuNYdansEbnCnBccQkpzIpp9NA1B64Kvw,8444
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=rqieWL71Eu0jIKrspizof4xSyp672xCQxbrQUYdpbbA,32560
18
+ insightconnect_plugin_runtime/api/endpoints.py,sha256=xprYehTnO6TSpWcNXZ5iYOAgYk5-5UnxtgM9BDIYuRw,32792
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=qKldWkyETmVhfoXbMZY58FFaDas6B5Uqc0D1LJROf6M,21658
@@ -78,7 +78,7 @@ tests/unit/test_server_spec.py,sha256=je97BaktgK0Fiz3AwFPkcmHzYtOJJNqJV_Fw5hrvqX
78
78
  tests/unit/test_trigger.py,sha256=E53mAUoVyponWu_4IQZ0IC1gQ9lakBnTn_9vKN2IZfg,1692
79
79
  tests/unit/test_variables.py,sha256=OUEOqGYZA3Nd5oKk5GVY3hcrWKHpZpxysBJcO_v5gzs,291
80
80
  tests/unit/utils.py,sha256=VooVmfpIgxmglNdtmT32AkEDFxHxyRHLK8RsCWjjYRY,2153
81
- insightconnect_plugin_runtime-5.6.0.dist-info/METADATA,sha256=5zYfXPKpqKNmeylm7-7KdhwXgujAZ3mmfxQTiEpjeJ8,13988
82
- insightconnect_plugin_runtime-5.6.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
83
- insightconnect_plugin_runtime-5.6.0.dist-info/top_level.txt,sha256=AJtyJOpiFzHxsbHUICTcUKXyrGQ3tZxhrEHsPjJBvEA,36
84
- insightconnect_plugin_runtime-5.6.0.dist-info/RECORD,,
81
+ insightconnect_plugin_runtime-5.6.1.dist-info/METADATA,sha256=Ytd-U6ssnfYqZdQ-KKlMfTjDi6fPOFsPGGHcULACkLg,14106
82
+ insightconnect_plugin_runtime-5.6.1.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
83
+ insightconnect_plugin_runtime-5.6.1.dist-info/top_level.txt,sha256=AJtyJOpiFzHxsbHUICTcUKXyrGQ3tZxhrEHsPjJBvEA,36
84
+ insightconnect_plugin_runtime-5.6.1.dist-info/RECORD,,