Skip to content

Commit

Permalink
Updated to use latest tooling (#2135) (#2137)
Browse files Browse the repository at this point in the history
Co-authored-by: Dympna Laverty <dympna_laverty@rapid7.com>
  • Loading branch information
dlaverty-r7 and Dympna Laverty authored Nov 23, 2023
1 parent e6be46f commit 90df10c
Show file tree
Hide file tree
Showing 25 changed files with 181 additions and 60 deletions.
16 changes: 8 additions & 8 deletions plugins/matplotlib/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"spec": "a08b2fe669cda4852e9518a47ad56982",
"manifest": "cb9f2a0c6812a8be74169c3220a7ba57",
"setup": "60de923a251f440cf982a23c7e3775bc",
"manifest": "615cde7003c2d075e5803e4e076d1cd3",
"setup": "f2d218b8d7db702e36f203a43d524438",
"schemas": [
{
"identifier": "create_distribution_plot/schema.py",
"hash": "792f65b33c8a1df87d91b2d428cab53d"
"hash": "e935f247ea65f88d53c8ffc53e44e3ef"
},
{
"identifier": "create_joint_plot/schema.py",
"hash": "fc600281960a69cd96a77a88a2611035"
"hash": "eae8a3f2db5a56b9720d75abf7c2c460"
},
{
"identifier": "create_line_plot/schema.py",
"hash": "4936aa1cbf635ac563280326e103ca4a"
"hash": "fec3f1c55443414e0e1eefb4e045fe58"
},
{
"identifier": "create_pair_plot/schema.py",
"hash": "a6f7ae17608cdea4e4c956af0c0a0aa4"
"hash": "53bebfa27e5fd8d20c31e87396e72962"
},
{
"identifier": "create_scatter_plot/schema.py",
"hash": "ed4cf35a1ab1f9ce62ad4246c48235be"
"hash": "32553e9f1b62a73e3de638e6ce16b492"
},
{
"identifier": "connection/schema.py",
"hash": "9d48eac9e9c489dbd77132ce1378f009"
"hash": "bd524b567f9638ba1c6f7e0c9e45ff2e"
}
]
}
7 changes: 5 additions & 2 deletions plugins/matplotlib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ LABEL organization=rapid7
LABEL sdk=python

WORKDIR /python/src

ADD ./plugin.spec.yaml /plugin.spec.yaml
ADD . /python/src
ADD ./requirements.txt /python/src/requirements.txt

RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

ADD . /python/src

RUN python setup.py build && python setup.py install

# User to run plugin code. The two supported users are: root, nobody
USER nobody

ENTRYPOINT ["/usr/local/bin/icon_matplotlib"]
ENTRYPOINT ["/usr/local/bin/komand_matplotlib"]
20 changes: 10 additions & 10 deletions plugins/matplotlib/bin/komand_matplotlib
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python
# GENERATED BY KOMAND SDK - DO NOT EDIT
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
import os
import json
from sys import argv

Name = "Matplotlib"
Vendor = "rapid7"
Version = "1.0.2"
Version = "1.0.3"
Description = "Provides graphing capability of base64 encoded CSV data using Matplotlib, NumPy, Pandas, and Seaborn"


Expand All @@ -23,7 +23,7 @@ def main():
monkey.patch_all()

import insightconnect_plugin_runtime
from komand_matplotlib import connection, actions, triggers
from komand_matplotlib import connection, actions, triggers, tasks

class ICONMatplotlib(insightconnect_plugin_runtime.Plugin):
def __init__(self):
Expand All @@ -34,16 +34,16 @@ def main():
description=Description,
connection=connection.Connection()
)
self.add_action(actions.CreateLinePlot())

self.add_action(actions.CreateScatterPlot())

self.add_action(actions.CreateDistributionPlot())

self.add_action(actions.CreateJointPlot())

self.add_action(actions.CreateLinePlot())


self.add_action(actions.CreatePairPlot())

self.add_action(actions.CreateScatterPlot())



"""Run plugin"""
cli = insightconnect_plugin_runtime.CLI(ICONMatplotlib())
Expand Down
1 change: 1 addition & 0 deletions plugins/matplotlib/komand_matplotlib/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from .create_joint_plot.action import CreateJointPlot

from .create_pair_plot.action import CreatePairPlot

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
from .action import CreateDistributionPlot
from .action import CreateDistributionPlot
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Output:


class CreateDistributionPlotInput(insightconnect_plugin_runtime.Input):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
Expand All @@ -30,6 +30,7 @@ class CreateDistributionPlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Color Palette",
"description": "Color palette of the plot",
"default": "dark",
"enum": [
"deep",
"muted",
Expand All @@ -49,7 +50,7 @@ class CreateDistributionPlotInput(insightconnect_plugin_runtime.Input):
"csv_data": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV Data",
"description": "Base64 encoded CSV data from which to create the plot",
"order": 1
Expand All @@ -58,12 +59,14 @@ class CreateDistributionPlotInput(insightconnect_plugin_runtime.Input):
"type": "boolean",
"title": "KDE",
"description": "Display a kernel density estimation line on the plot",
"default": false,
"order": 3
},
"margin_style": {
"type": "string",
"title": "Margin Style",
"description": "Style of the margin of the plot",
"default": "dark",
"enum": [
"darkgrid",
"whitegrid",
Expand All @@ -90,23 +93,23 @@ def __init__(self):


class CreateDistributionPlotOutput(insightconnect_plugin_runtime.Output):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
"properties": {
"csv": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV",
"description": "Base64 encoded CSV data used to generate the plot",
"order": 1
},
"plot": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "Plot",
"description": "Base64 encoded PNG plot data (can be attached to an email)",
"order": 2
Expand All @@ -121,4 +124,4 @@ class CreateDistributionPlotOutput(insightconnect_plugin_runtime.Output):
""")

def __init__(self):
super(self.__class__, self).__init__(self.schema)
super(self.__class__, self).__init__(self.schema)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
from .action import CreateJointPlot
from .action import CreateJointPlot
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Output:


class CreateJointPlotInput(insightconnect_plugin_runtime.Input):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
Expand All @@ -31,6 +31,7 @@ class CreateJointPlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Color Palette",
"description": "Color palette of the plot",
"default": "dark",
"enum": [
"deep",
"muted",
Expand All @@ -44,7 +45,7 @@ class CreateJointPlotInput(insightconnect_plugin_runtime.Input):
"csv_data": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV Data",
"description": "Base64 encoded CSV data from which to create the plot",
"order": 1
Expand All @@ -53,6 +54,7 @@ class CreateJointPlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Kind",
"description": "Kind of data representation to use in the created plot",
"default": "scatter",
"enum": [
"scatter",
"reg",
Expand All @@ -66,6 +68,7 @@ class CreateJointPlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Margin Style",
"description": "Style of the margin of the plot",
"default": "dark",
"enum": [
"darkgrid",
"whitegrid",
Expand Down Expand Up @@ -105,23 +108,23 @@ def __init__(self):


class CreateJointPlotOutput(insightconnect_plugin_runtime.Output):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
"properties": {
"csv": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV",
"description": "Base64 encoded CSV data used to generate the plot",
"order": 1
},
"plot": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "Plot",
"description": "Base64 encoded PNG plot data (can be attached to an email)",
"order": 2
Expand All @@ -136,4 +139,4 @@ class CreateJointPlotOutput(insightconnect_plugin_runtime.Output):
""")

def __init__(self):
super(self.__class__, self).__init__(self.schema)
super(self.__class__, self).__init__(self.schema)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
from .action import CreateLinePlot
from .action import CreateLinePlot
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Output:


class CreateLinePlotInput(insightconnect_plugin_runtime.Input):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
Expand All @@ -31,6 +31,7 @@ class CreateLinePlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Color Palette",
"description": "Color palette of the plot",
"default": "dark",
"enum": [
"deep",
"muted",
Expand All @@ -44,7 +45,7 @@ class CreateLinePlotInput(insightconnect_plugin_runtime.Input):
"csv_data": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV Data",
"description": "Base64 encoded CSV data from which to create the plot",
"order": 1
Expand All @@ -59,6 +60,7 @@ class CreateLinePlotInput(insightconnect_plugin_runtime.Input):
"type": "string",
"title": "Margin Style",
"description": "Style of the margin of the plot",
"default": "dark",
"enum": [
"darkgrid",
"whitegrid",
Expand Down Expand Up @@ -97,23 +99,23 @@ def __init__(self):


class CreateLinePlotOutput(insightconnect_plugin_runtime.Output):
schema = json.loads("""
schema = json.loads(r"""
{
"type": "object",
"title": "Variables",
"properties": {
"csv": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "CSV",
"description": "Base64 encoded CSV data used to generate the plot",
"order": 1
},
"plot": {
"type": "string",
"format": "bytes",
"display_type": "bytes",
"displayType": "bytes",
"title": "Plot",
"description": "Base64 encoded PNG plot data (can be attached to an email)",
"order": 2
Expand All @@ -128,4 +130,4 @@ class CreateLinePlotOutput(insightconnect_plugin_runtime.Output):
""")

def __init__(self):
super(self.__class__, self).__init__(self.schema)
super(self.__class__, self).__init__(self.schema)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
from .action import CreatePairPlot
from .action import CreatePairPlot
Loading

0 comments on commit 90df10c

Please sign in to comment.