insight-plugin 1.1.0__tar.gz → 1.2.0__tar.gz
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.
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/PKG-INFO +1 -1
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/__init__.py +1 -1
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/__main__.py +85 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/__pycache__/__init__.cpython-39.pyc +0 -0
- insight_plugin-1.2.0/insight_plugin/constants.py +58 -0
- insight_plugin-1.2.0/insight_plugin/features/analysis/controller.py +63 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/schema_util.py +13 -13
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/template_util.py +3 -3
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/export/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/interactive/controller.py +14 -22
- insight_plugin-1.2.0/insight_plugin/features/linter/controller.py +34 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/refresh/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/run/bash_controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/run/run_controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/run/server_controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/samples/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/validate/controller.py +8 -8
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/view/controller.py +2 -2
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/PKG-INFO +1 -1
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/SOURCES.txt +4 -0
- insight_plugin-1.2.0/tests/resources/export_test_base64/__init__.py +0 -0
- insight_plugin-1.2.0/tests/resources/export_test_base64/unit_test/__init__.py +0 -0
- insight_plugin-1.1.0/insight_plugin/constants.py +0 -47
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/LICENSE +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/README.md +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/common → insight_plugin-1.2.0/insight_plugin/features/analysis}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/create → insight_plugin-1.2.0/insight_plugin/features/common}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/builder.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/checksum_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/command_line_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/common_feature.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/docker_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/dockerspec.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/exceptions.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/logging_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/plugin_spec_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/temp_file_util.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/create/help → insight_plugin-1.2.0/insight_plugin/features/create}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/export → insight_plugin-1.2.0/insight_plugin/features/create/help}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/components.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/connection_help.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/constants.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/help_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/input_output_helpers.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/json_generation_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/plugin_to_helpmd.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/util.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/export/util → insight_plugin-1.2.0/insight_plugin/features/export}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/interactive → insight_plugin-1.2.0/insight_plugin/features/export/util}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/export/util/util.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/interactive/util → insight_plugin-1.2.0/insight_plugin/features/interactive}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/refresh → insight_plugin-1.2.0/insight_plugin/features/interactive/util}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/interactive/util/util.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/run → insight_plugin-1.2.0/insight_plugin/features/linter}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/samples → insight_plugin-1.2.0/insight_plugin/features/refresh}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/samples/util → insight_plugin-1.2.0/insight_plugin/features/run}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/validate → insight_plugin-1.2.0/insight_plugin/features/samples}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/version → insight_plugin-1.2.0/insight_plugin/features/samples/util}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/samples/util/constants.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/samples/util/util.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/version/util → insight_plugin-1.2.0/insight_plugin/features/validate}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/features/view → insight_plugin-1.2.0/insight_plugin/features/version}/__init__.py +0 -0
- {insight_plugin-1.1.0/insight_plugin/templates → insight_plugin-1.2.0/insight_plugin/features/version/util}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/helpmd_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/input_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/version_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/yaml_util.py +0 -0
- {insight_plugin-1.1.0/tests/resources → insight_plugin-1.2.0/insight_plugin/features/view}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/.dockerignore.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/Dockerfile.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/Makefile.jinja +0 -0
- {insight_plugin-1.1.0/tests/resources/export_test_base64 → insight_plugin-1.2.0/insight_plugin/templates}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/assessment/assessment.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/bin/plugin.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/actions/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/actions/action/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/actions/action/action.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/actions/action/schema.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/connection/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/connection/connection.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/connection/schema.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/tasks/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/tasks/task/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/tasks/task/schema.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/tasks/task/task.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/triggers/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/triggers/trigger/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/triggers/trigger/schema.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/triggers/trigger/trigger.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/util/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/requirements.txt.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/setup.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/unit_test/__init__.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/unit_test/test_action.py.jinja +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/dependency_links.txt +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/entry_points.txt +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/requires.txt +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin.egg-info/top_level.txt +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/pyproject.toml +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/setup.cfg +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/setup.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/__init__.py +0 -0
- {insight_plugin-1.1.0/tests/resources/export_test_base64/unit_test → insight_plugin-1.2.0/tests/resources}/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/decode/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/decode/action.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/decode/schema.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/encode/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/encode/action.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/actions/encode/schema.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/connection/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/connection/connection.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/connection/schema.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/triggers/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/komand_base64/util/__init__.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/setup.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/resources/export_test_base64/unit_test/test_encode.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_checksum.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_create.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_export.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_gen_samples.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_help_creation.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_interactive.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_json_generate.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_refresh.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_run.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_schema.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_semver.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_spec_order.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_temp_file_util.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/test_validate.py +0 -0
- {insight_plugin-1.1.0 → insight_plugin-1.2.0}/tests/util.py +0 -0
|
@@ -6,9 +6,11 @@ from argparse import Namespace
|
|
|
6
6
|
|
|
7
7
|
from insight_plugin import VERSION
|
|
8
8
|
|
|
9
|
+
from insight_plugin.features.analysis.controller import AnalysisController
|
|
9
10
|
from insight_plugin.features.create.controller import CreateController
|
|
10
11
|
from insight_plugin.features.samples.controller import GenSampleController
|
|
11
12
|
from insight_plugin.features.export.controller import ExportController
|
|
13
|
+
from insight_plugin.features.linter.controller import LinterController
|
|
12
14
|
from insight_plugin.features.refresh.controller import RefreshController
|
|
13
15
|
from insight_plugin.features.run.run_controller import RunController
|
|
14
16
|
from insight_plugin.features.validate.controller import ValidateController
|
|
@@ -19,6 +21,7 @@ from insight_plugin.features.common.exceptions import InsightException
|
|
|
19
21
|
from insight_plugin.features.version.controller import VersionController
|
|
20
22
|
from insight_plugin.features.view.controller import ViewController
|
|
21
23
|
from typing import List
|
|
24
|
+
from insight_plugin.constants import Color
|
|
22
25
|
|
|
23
26
|
DEFAULT_JQ_STRING = ".body.output"
|
|
24
27
|
|
|
@@ -33,10 +36,16 @@ def main():
|
|
|
33
36
|
subparsers = argparser.add_subparsers(help="Commands")
|
|
34
37
|
parsers_list = []
|
|
35
38
|
|
|
39
|
+
# Analysis
|
|
40
|
+
analysis_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
41
|
+
# Checks
|
|
42
|
+
checks_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
36
43
|
# Create
|
|
37
44
|
create_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
38
45
|
# Export
|
|
39
46
|
export_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
47
|
+
# Linter
|
|
48
|
+
linter_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
40
49
|
# Refresh
|
|
41
50
|
refresh_argparse(subparsers=subparsers, parsers_list=parsers_list)
|
|
42
51
|
# Validate
|
|
@@ -507,8 +516,8 @@ def validate(args: Namespace) -> None:
|
|
|
507
516
|
:param args: CLI args
|
|
508
517
|
:return: None
|
|
509
518
|
"""
|
|
510
|
-
controller = ValidateController.new_from_cli(**{"
|
|
511
|
-
controller.
|
|
519
|
+
controller = ValidateController.new_from_cli(**{"target_dir": args.target_dir})
|
|
520
|
+
controller.run()
|
|
512
521
|
|
|
513
522
|
|
|
514
523
|
def view_argparse(subparsers, parsers_list: List) -> None:
|
|
@@ -538,5 +547,79 @@ def view(args: Namespace) -> None:
|
|
|
538
547
|
controller.run()
|
|
539
548
|
|
|
540
549
|
|
|
550
|
+
def linter_argparse(subparsers, parsers_list: List) -> None:
|
|
551
|
+
"""
|
|
552
|
+
Handle the arg-parsing for the linter subcommand
|
|
553
|
+
:param subparsers: List to be filled with commands
|
|
554
|
+
:param parsers_list: List to be appended with parsed commands
|
|
555
|
+
:return: None
|
|
556
|
+
"""
|
|
557
|
+
command_view = subparsers.add_parser("linter", help=LinterController.HELP_MSG)
|
|
558
|
+
parsers_list.append(command_view)
|
|
559
|
+
command_view.set_defaults(func=linter)
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
def linter(args: Namespace) -> None:
|
|
563
|
+
"""
|
|
564
|
+
Run the linter
|
|
565
|
+
"""
|
|
566
|
+
controller = LinterController.new_from_cli(**{"target_dir": args.target_dir})
|
|
567
|
+
controller.run()
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
def analysis_argparse(subparsers, parsers_list: List) -> None:
|
|
571
|
+
"""
|
|
572
|
+
Handle the arg-parsing for the analysis subcommand
|
|
573
|
+
:param subparsers: List to be filled with commands
|
|
574
|
+
:param parsers_list: List to be appended with parsed commands
|
|
575
|
+
:return: None
|
|
576
|
+
"""
|
|
577
|
+
command_view = subparsers.add_parser("analysis", help=AnalysisController.HELP_MSG)
|
|
578
|
+
parsers_list.append(command_view)
|
|
579
|
+
command_view.set_defaults(func=analysis)
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
def analysis(args: Namespace) -> None:
|
|
583
|
+
"""
|
|
584
|
+
Run Static Code Analysis
|
|
585
|
+
"""
|
|
586
|
+
controller = AnalysisController.new_from_cli(**{"target_dir": args.target_dir})
|
|
587
|
+
controller.run()
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
def checks_argparse(subparsers, parsers_list: List) -> None:
|
|
591
|
+
"""
|
|
592
|
+
Handle the arg-parsing for the checks subcommand
|
|
593
|
+
:param subparsers: List to be filled with commands
|
|
594
|
+
:param parsers_list: List to be appended with parsed commands
|
|
595
|
+
:return: None
|
|
596
|
+
"""
|
|
597
|
+
command_view = subparsers.add_parser(
|
|
598
|
+
"checks", help="Run Linter, code analysis & validate on the plugin"
|
|
599
|
+
)
|
|
600
|
+
parsers_list.append(command_view)
|
|
601
|
+
command_view.set_defaults(func=checks)
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
def checks(args: Namespace) -> None:
|
|
605
|
+
"""
|
|
606
|
+
Run Linter, SCA & Validate
|
|
607
|
+
"""
|
|
608
|
+
analysis_controller = AnalysisController.new_from_cli(
|
|
609
|
+
**{"target_dir": args.target_dir}
|
|
610
|
+
)
|
|
611
|
+
linter_controller = LinterController.new_from_cli(**{"target_dir": args.target_dir})
|
|
612
|
+
validate_controller = ValidateController.new_from_cli(
|
|
613
|
+
**{"target_dir": args.target_dir}
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
print(Color.BOLD + "\nAnalysis \n" + Color.END)
|
|
617
|
+
analysis_controller.run()
|
|
618
|
+
print(Color.BOLD + "\nLinter\n" + Color.END)
|
|
619
|
+
linter_controller.run()
|
|
620
|
+
print(Color.BOLD + "\nValidate\n" + Color.END)
|
|
621
|
+
validate_controller.run()
|
|
622
|
+
|
|
623
|
+
|
|
541
624
|
if __name__ == "__main__":
|
|
542
625
|
main()
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/__pycache__/__init__.cpython-39.pyc
RENAMED
|
Binary file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
class SubcommandDescriptions:
|
|
2
|
+
ANALYSIS_DESCRIPTION = "Run static code analysis on the plugin"
|
|
3
|
+
CHECKS_DESCRIPTION = "Run Linter, code analysis & validate on the plugin"
|
|
4
|
+
LINTER_DESCRIPTION = "Run the 'black' linter on the plugin"
|
|
5
|
+
CREATE_DESCRIPTION = (
|
|
6
|
+
"Create a new plugin."
|
|
7
|
+
+ " This command will generate the skeleton folder structure and "
|
|
8
|
+
"code for a new plugin, based on the provided plugin.spec.yaml file"
|
|
9
|
+
)
|
|
10
|
+
SERVER_DESCRIPTION = (
|
|
11
|
+
"Run the plugin in HTTP mode."
|
|
12
|
+
+ " This allows an external API testing program to be "
|
|
13
|
+
"used to test a plugin "
|
|
14
|
+
)
|
|
15
|
+
SAMPLES_DESCRIPTION = (
|
|
16
|
+
"Create test samples for actions and triggers."
|
|
17
|
+
+ " This command will create new files under the 'tests' folder "
|
|
18
|
+
"which can be used to test each new action/trigger. "
|
|
19
|
+
"Note if a file already exists for a particular action/trigger, it will not be overwritten"
|
|
20
|
+
)
|
|
21
|
+
REFRESH_DESCRIPTION = (
|
|
22
|
+
"Refresh the plugin."
|
|
23
|
+
+ " This command will update the current plugin code, when updates are made in the "
|
|
24
|
+
"plugin.spec.yaml file"
|
|
25
|
+
)
|
|
26
|
+
RUN_DESCRIPTION = (
|
|
27
|
+
"Run an action/trigger from a json test file"
|
|
28
|
+
+ " (created during sample generation)"
|
|
29
|
+
)
|
|
30
|
+
SHELL_DESCRIPTION = (
|
|
31
|
+
"Run the plugin via the docker shell" + " to enable advanced debugging"
|
|
32
|
+
)
|
|
33
|
+
EXPORT_DESCRIPTION = (
|
|
34
|
+
"Export a plugin Docker image to a tarball."
|
|
35
|
+
+ " This tarball can be uploaded as a custom plugin via the import "
|
|
36
|
+
"functionality in the InsightConnect UI"
|
|
37
|
+
)
|
|
38
|
+
VALIDATE_DESCRIPTION = (
|
|
39
|
+
"Validate / Run checks against the plugin."
|
|
40
|
+
+ " This command performs quality control checks on the current "
|
|
41
|
+
"state of the plugin. This should be run before finalizing any new updates"
|
|
42
|
+
)
|
|
43
|
+
VERSION_DESCRIPTION = (
|
|
44
|
+
"Update the plugin versioning."
|
|
45
|
+
+ " This command should be run after finalizing any updates, defect fixes or "
|
|
46
|
+
"new functionality, to update the versioning"
|
|
47
|
+
)
|
|
48
|
+
VIEW_DESCRIPTION = (
|
|
49
|
+
"View plugin docker container info" + "Provides an overview of the plugin"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
VALID_IGNORE_FILES = ["help.md", "dockerfile", "unit_test"]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class Color:
|
|
57
|
+
BOLD = "\033[1m"
|
|
58
|
+
END = "\033[0m"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
|
+
import os
|
|
4
|
+
from shutil import which
|
|
5
|
+
from typing import Union
|
|
6
|
+
|
|
7
|
+
DEFAULT_PROFILE = (
|
|
8
|
+
"prospector --profile --tool bandit --tool mccabe --tool pylint --tool pyflakes"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AnalysisController(CommonFeature):
|
|
13
|
+
HELP_MSG = SubcommandDescriptions.ANALYSIS_DESCRIPTION
|
|
14
|
+
|
|
15
|
+
def __init__(self, verbose: bool, target_dir: str):
|
|
16
|
+
super().__init__(verbose=verbose, target_dir=target_dir)
|
|
17
|
+
self._verbose = verbose
|
|
18
|
+
self._target_dir = target_dir
|
|
19
|
+
self.default_profile = (
|
|
20
|
+
"prospector --tool bandit --tool mccabe --tool pylint --tool pyflakes"
|
|
21
|
+
)
|
|
22
|
+
self.current_dir = os.path.abspath(self.target_dir)
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def new_from_cli(cls, **kwargs):
|
|
26
|
+
super().new_from_cli(
|
|
27
|
+
**{
|
|
28
|
+
"verbose": kwargs.get("verbose"),
|
|
29
|
+
"target_dir": kwargs.get("target_dir"),
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
return cls(
|
|
33
|
+
kwargs.get("verbose"),
|
|
34
|
+
kwargs.get("target_dir"),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def run(self) -> Union[None, int]:
|
|
38
|
+
if which("prospector") is None:
|
|
39
|
+
print("Prospector is not installed.\nInstall via 'pip install prospector'")
|
|
40
|
+
return
|
|
41
|
+
|
|
42
|
+
# If its an official plugins repo
|
|
43
|
+
if "plugins" in self.current_dir:
|
|
44
|
+
self.run_prospector(
|
|
45
|
+
self.current_dir.split("/plugins")[0] + "/prospector.yaml"
|
|
46
|
+
)
|
|
47
|
+
else:
|
|
48
|
+
# If not in any plugins repo, run default prospector (no profile)
|
|
49
|
+
return self.run_prospector()
|
|
50
|
+
|
|
51
|
+
def run_prospector(self, prospector_path: str = None) -> int:
|
|
52
|
+
"""
|
|
53
|
+
Helper method to generate the os.system run command depending on prospector used.
|
|
54
|
+
|
|
55
|
+
:param prospector_path: Path to the prospector.yaml file
|
|
56
|
+
"""
|
|
57
|
+
if prospector_path:
|
|
58
|
+
return os.system( # nosec
|
|
59
|
+
f"prospector --profile {prospector_path} {self.target_dir} --tool bandit --tool "
|
|
60
|
+
f"mccabe --tool pylint --tool pyflakes "
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return os.system(self.default_profile) # nosec
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Tuple, Dict, Union,
|
|
1
|
+
from typing import Tuple, Dict, Union, Any
|
|
2
2
|
from insight_plugin.features.common.plugin_spec_util import PluginSpecConstants
|
|
3
3
|
from insight_plugin.features.common.exceptions import InsightException
|
|
4
4
|
from insight_plugin.features.common.logging_util import BaseLoggingFeature
|
|
@@ -287,9 +287,9 @@ class SchemaUtil:
|
|
|
287
287
|
# Primitive type definitions are only either strings or dicts.
|
|
288
288
|
if isinstance(SchemaUtil.PRIMITIVE_TYPES[current_type], str):
|
|
289
289
|
# If this type definition is a string, we simply assign the value to the type property.
|
|
290
|
-
parent_object[key][
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
parent_object[key][PluginSpecConstants.TYPE] = (
|
|
291
|
+
SchemaUtil.PRIMITIVE_TYPES[current_type]
|
|
292
|
+
)
|
|
293
293
|
# This parameter's primitive type is one defined as a dict object with multiple properties.
|
|
294
294
|
elif isinstance(SchemaUtil.PRIMITIVE_TYPES[current_type], dict):
|
|
295
295
|
# Add each property of this primitive type's dict definition to the current parameter schema.
|
|
@@ -358,9 +358,9 @@ class SchemaUtil:
|
|
|
358
358
|
# Is this an array of strings?
|
|
359
359
|
if isinstance(SchemaUtil.PRIMITIVE_TYPES[final_type], str):
|
|
360
360
|
# Set this array's items: type value to string.
|
|
361
|
-
current_item[
|
|
362
|
-
|
|
363
|
-
|
|
361
|
+
current_item[PluginSpecConstants.TYPE] = (
|
|
362
|
+
SchemaUtil.PRIMITIVE_TYPES[final_type]
|
|
363
|
+
)
|
|
364
364
|
# Is this an array of dict objects?
|
|
365
365
|
elif isinstance(SchemaUtil.PRIMITIVE_TYPES[final_type], dict):
|
|
366
366
|
for primitive_key in SchemaUtil.PRIMITIVE_TYPES[final_type]:
|
|
@@ -370,9 +370,9 @@ class SchemaUtil:
|
|
|
370
370
|
# Is this parameter an array of a base type?
|
|
371
371
|
elif final_type in SchemaUtil.BASE_TYPES:
|
|
372
372
|
# Non-primitive types use $ref instead of type, here we set the definition reference.
|
|
373
|
-
current_item[
|
|
374
|
-
SchemaConstants.
|
|
375
|
-
|
|
373
|
+
current_item[SchemaConstants.REF] = (
|
|
374
|
+
f"{SchemaConstants.REF_DEF}{final_type}"
|
|
375
|
+
)
|
|
376
376
|
# Non-primitive types must be defined in the schema, here we get this base type definition.
|
|
377
377
|
if final_type not in definitions:
|
|
378
378
|
definitions[final_type] = SchemaUtil.BASE_TYPES[final_type]
|
|
@@ -382,9 +382,9 @@ class SchemaUtil:
|
|
|
382
382
|
and final_type in spec[PluginSpecConstants.TYPES]
|
|
383
383
|
):
|
|
384
384
|
# Non-primitive types use $ref instead of type, here we set the definition reference.
|
|
385
|
-
current_item[
|
|
386
|
-
SchemaConstants.
|
|
387
|
-
|
|
385
|
+
current_item[SchemaConstants.REF] = (
|
|
386
|
+
f"{SchemaConstants.REF_DEF}{final_type}"
|
|
387
|
+
)
|
|
388
388
|
# Have we not yet added this custom type definition to the schema?
|
|
389
389
|
if final_type not in definitions:
|
|
390
390
|
# We have not yet defined this custom type, prepare to recurse.
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/template_util.py
RENAMED
|
@@ -40,9 +40,9 @@ class Templates:
|
|
|
40
40
|
self._env.globals["upper_camel_case"] = Templates.upper_camel_case
|
|
41
41
|
self._env.globals["json_schema_connection"] = self.json_schema_connection
|
|
42
42
|
self._env.globals["json_schema_trigger_input"] = self.json_schema_trigger_input
|
|
43
|
-
self._env.globals[
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
self._env.globals["json_schema_trigger_output"] = (
|
|
44
|
+
self.json_schema_trigger_output
|
|
45
|
+
)
|
|
46
46
|
self._env.globals["json_schema_action_input"] = self.json_schema_action_input
|
|
47
47
|
self._env.globals["json_schema_action_output"] = self.json_schema_action_output
|
|
48
48
|
self._env.globals["json_schema_task_input"] = self.json_schema_task_input
|
|
@@ -11,7 +11,7 @@ from insight_plugin.features.common.template_util import Templates
|
|
|
11
11
|
from insight_plugin.features.common.temp_file_util import SafeTempDirectory
|
|
12
12
|
from insight_plugin.features.common.exceptions import InsightException
|
|
13
13
|
from insight_plugin.features.create import util
|
|
14
|
-
from insight_plugin.constants import
|
|
14
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class CreateController(CommonFeature):
|
|
@@ -20,7 +20,7 @@ class CreateController(CommonFeature):
|
|
|
20
20
|
Depends on plugin spec dictionary values to fill templates.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
HELP_MSG = CREATE_DESCRIPTION
|
|
23
|
+
HELP_MSG = SubcommandDescriptions.CREATE_DESCRIPTION
|
|
24
24
|
|
|
25
25
|
def __init__(self, spec_path: Optional[str], verbose: bool, target_dir: str):
|
|
26
26
|
super().__init__(verbose, target_dir)
|
|
@@ -7,7 +7,7 @@ from insight_plugin.features.common.common_feature import CommonFeature
|
|
|
7
7
|
from insight_plugin.features.common.command_line_util import CommandLineUtil
|
|
8
8
|
from insight_plugin.features.common.temp_file_util import SafeTempDirectory
|
|
9
9
|
from insight_plugin.features.common.exceptions import InsightException
|
|
10
|
-
from insight_plugin.constants import
|
|
10
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class ExportController(CommonFeature):
|
|
@@ -16,7 +16,7 @@ class ExportController(CommonFeature):
|
|
|
16
16
|
Allows the user to export the plugin image to a tarball
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
HELP_MSG = EXPORT_DESCRIPTION
|
|
19
|
+
HELP_MSG = SubcommandDescriptions.EXPORT_DESCRIPTION
|
|
20
20
|
|
|
21
21
|
def __init__(
|
|
22
22
|
self,
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/interactive/controller.py
RENAMED
|
@@ -6,13 +6,7 @@ from insight_plugin.features.refresh.controller import RefreshController
|
|
|
6
6
|
from insight_plugin.features.run.run_controller import RunController
|
|
7
7
|
from insight_plugin.features.export.controller import ExportController
|
|
8
8
|
from typing import Tuple, Optional, Union
|
|
9
|
-
from insight_plugin.constants import
|
|
10
|
-
CREATE_DESCRIPTION,
|
|
11
|
-
REFRESH_DESCRIPTION,
|
|
12
|
-
RUN_DESCRIPTION,
|
|
13
|
-
EXPORT_DESCRIPTION,
|
|
14
|
-
VALIDATE_DESCRIPTION,
|
|
15
|
-
)
|
|
9
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
16
10
|
from insight_plugin.features.interactive.util.util import (
|
|
17
11
|
retrieve_bool_input,
|
|
18
12
|
retrieve_path_input,
|
|
@@ -33,15 +27,15 @@ class _Option(object):
|
|
|
33
27
|
# TODO: Make this dynamic instead of hardcoded
|
|
34
28
|
_OPTIONS = [
|
|
35
29
|
# 1
|
|
36
|
-
_Option(title="Create", description=CREATE_DESCRIPTION),
|
|
30
|
+
_Option(title="Create", description=SubcommandDescriptions.CREATE_DESCRIPTION),
|
|
37
31
|
# 2
|
|
38
|
-
_Option(title="Refresh", description=REFRESH_DESCRIPTION),
|
|
32
|
+
_Option(title="Refresh", description=SubcommandDescriptions.REFRESH_DESCRIPTION),
|
|
39
33
|
# 3
|
|
40
|
-
_Option(title="Run", description=RUN_DESCRIPTION),
|
|
34
|
+
_Option(title="Run", description=SubcommandDescriptions.RUN_DESCRIPTION),
|
|
41
35
|
# 4
|
|
42
|
-
_Option(title="Validate", description=VALIDATE_DESCRIPTION),
|
|
36
|
+
_Option(title="Validate", description=SubcommandDescriptions.VALIDATE_DESCRIPTION),
|
|
43
37
|
# 5
|
|
44
|
-
_Option(title="Export", description=EXPORT_DESCRIPTION),
|
|
38
|
+
_Option(title="Export", description=SubcommandDescriptions.EXPORT_DESCRIPTION),
|
|
45
39
|
]
|
|
46
40
|
|
|
47
41
|
|
|
@@ -201,16 +195,14 @@ class InteractiveController(object):
|
|
|
201
195
|
return path_to_spec
|
|
202
196
|
|
|
203
197
|
@staticmethod
|
|
204
|
-
def _get_run_controller_menu() ->
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
]
|
|
213
|
-
):
|
|
198
|
+
def _get_run_controller_menu() -> Tuple[
|
|
199
|
+
str,
|
|
200
|
+
Union[str, None],
|
|
201
|
+
bool,
|
|
202
|
+
bool,
|
|
203
|
+
bool,
|
|
204
|
+
Optional[str],
|
|
205
|
+
]:
|
|
214
206
|
"""
|
|
215
207
|
Method to handle the run subcommand inputs.
|
|
216
208
|
:return: User inputs for verbose, target_dir, assessment, is_test, jq & json_target
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
|
+
import os
|
|
4
|
+
from shutil import which
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LinterController(CommonFeature):
|
|
8
|
+
HELP_MSG = SubcommandDescriptions.LINTER_DESCRIPTION
|
|
9
|
+
|
|
10
|
+
def __init__(self, verbose: bool, target_dir: str):
|
|
11
|
+
super().__init__(verbose=verbose, target_dir=target_dir)
|
|
12
|
+
self._verbose = verbose
|
|
13
|
+
self._target_dir = target_dir
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
def new_from_cli(cls, **kwargs):
|
|
17
|
+
super().new_from_cli(
|
|
18
|
+
**{
|
|
19
|
+
"verbose": kwargs.get("verbose"),
|
|
20
|
+
"target_dir": kwargs.get("target_dir"),
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
return cls(
|
|
24
|
+
kwargs.get("verbose"),
|
|
25
|
+
kwargs.get("target_dir"),
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def run(self) -> int:
|
|
29
|
+
if which("black") is None:
|
|
30
|
+
print("Black is not installed.\nInstall via 'pip install black'")
|
|
31
|
+
else:
|
|
32
|
+
return os.system( # nosec
|
|
33
|
+
f"black {self.target_dir} --check --force-exclude venv/"
|
|
34
|
+
)
|
|
@@ -9,7 +9,7 @@ from insight_plugin.features.common.common_feature import CommonFeature
|
|
|
9
9
|
from insight_plugin.features.common.template_util import Templates
|
|
10
10
|
from insight_plugin.features.common.exceptions import InsightException
|
|
11
11
|
from insight_plugin.features.create import util
|
|
12
|
-
from insight_plugin.constants import
|
|
12
|
+
from insight_plugin.constants import SubcommandDescriptions, VALID_IGNORE_FILES
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class RefreshController(CommonFeature):
|
|
@@ -18,7 +18,7 @@ class RefreshController(CommonFeature):
|
|
|
18
18
|
Depends on plugin spec dictionary values to fill templates.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
HELP_MSG = REFRESH_DESCRIPTION
|
|
21
|
+
HELP_MSG = SubcommandDescriptions.REFRESH_DESCRIPTION
|
|
22
22
|
|
|
23
23
|
def __init__(
|
|
24
24
|
self, spec_path: Optional[str], verbose: bool, target_dir: str, ignore: list
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/run/bash_controller.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
-
from insight_plugin.constants import
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
3
|
from insight_plugin.features.common.docker_util import DockerUtil
|
|
4
4
|
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ class RunShellController(CommonFeature):
|
|
|
9
9
|
Allows the user to run the plugin via the docker shell
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
HELP_MSG = SHELL_DESCRIPTION
|
|
12
|
+
HELP_MSG = SubcommandDescriptions.SHELL_DESCRIPTION
|
|
13
13
|
|
|
14
14
|
def __init__(
|
|
15
15
|
self,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
-
from insight_plugin.constants import
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
3
|
from insight_plugin.features.common.docker_util import DockerUtil
|
|
4
4
|
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ class RunController(CommonFeature):
|
|
|
9
9
|
Allows the user to run the plugin
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
HELP_MSG = RUN_DESCRIPTION
|
|
12
|
+
HELP_MSG = SubcommandDescriptions.RUN_DESCRIPTION
|
|
13
13
|
|
|
14
14
|
def __init__(
|
|
15
15
|
self,
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/run/server_controller.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
-
from insight_plugin.constants import
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
3
|
from insight_plugin.features.common.docker_util import DockerUtil
|
|
4
4
|
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ class RunServerController(CommonFeature):
|
|
|
9
9
|
Allows the user to run the plugin as a webserver
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
HELP_MSG = SERVER_DESCRIPTION
|
|
12
|
+
HELP_MSG = SubcommandDescriptions.SERVER_DESCRIPTION
|
|
13
13
|
|
|
14
14
|
def __init__(
|
|
15
15
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
3
|
-
from insight_plugin.constants import
|
|
3
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
4
4
|
from insight_plugin.features.samples.util.util import SamplesUtil
|
|
5
5
|
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ class GenSampleController(CommonFeature):
|
|
|
10
10
|
Depends on plugin spec dictionary values to fill templates.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
HELP_MSG = SAMPLES_DESCRIPTION
|
|
13
|
+
HELP_MSG = SubcommandDescriptions.SAMPLES_DESCRIPTION
|
|
14
14
|
|
|
15
15
|
def __init__(
|
|
16
16
|
self,
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/validate/controller.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
2
|
from icon_validator.validate import validate as icon_validate
|
|
3
|
-
from insight_plugin.constants import
|
|
3
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class ValidateController(CommonFeature):
|
|
@@ -9,18 +9,18 @@ class ValidateController(CommonFeature):
|
|
|
9
9
|
Allows the user to run validation checks against the plugin
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
HELP_MSG = VALIDATE_DESCRIPTION
|
|
12
|
+
HELP_MSG = SubcommandDescriptions.VALIDATE_DESCRIPTION
|
|
13
13
|
|
|
14
|
-
def __init__(self,
|
|
14
|
+
def __init__(self, target_dir: str):
|
|
15
15
|
super().__init__()
|
|
16
|
-
self.
|
|
16
|
+
self._target_dir = target_dir
|
|
17
17
|
|
|
18
18
|
@classmethod
|
|
19
19
|
def new_from_cli(cls, **kwargs):
|
|
20
|
-
super().new_from_cli(**{"
|
|
20
|
+
super().new_from_cli(**{"target_dir": kwargs.get("target_dir")})
|
|
21
21
|
return cls(
|
|
22
|
-
kwargs.get("
|
|
22
|
+
kwargs.get("target_dir"),
|
|
23
23
|
)
|
|
24
24
|
|
|
25
|
-
def
|
|
26
|
-
return icon_validate(self.
|
|
25
|
+
def run(self):
|
|
26
|
+
return icon_validate(self.target_dir, run_all=True)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
-
from insight_plugin.constants import
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
3
|
from insight_plugin.features.version.util.version_util import VersionUtil
|
|
4
4
|
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ class VersionController(CommonFeature):
|
|
|
9
9
|
Must be used within the directory that contains the plugin.spec.yaml
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
HELP_MSG = VERSION_DESCRIPTION
|
|
12
|
+
HELP_MSG = SubcommandDescriptions.VERSION_DESCRIPTION
|
|
13
13
|
|
|
14
14
|
def __init__(
|
|
15
15
|
self,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from insight_plugin.features.common.common_feature import CommonFeature
|
|
2
|
-
from insight_plugin.constants import
|
|
2
|
+
from insight_plugin.constants import SubcommandDescriptions
|
|
3
3
|
from insight_plugin.features.common.docker_util import DockerUtil
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class ViewController(CommonFeature):
|
|
7
|
-
HELP_MSG = VIEW_DESCRIPTION
|
|
7
|
+
HELP_MSG = SubcommandDescriptions.VIEW_DESCRIPTION
|
|
8
8
|
|
|
9
9
|
def __init__(self, verbose: bool, target_dir: str):
|
|
10
10
|
super().__init__(verbose=verbose, target_dir=target_dir)
|
|
@@ -13,6 +13,8 @@ insight_plugin.egg-info/requires.txt
|
|
|
13
13
|
insight_plugin.egg-info/top_level.txt
|
|
14
14
|
insight_plugin/__pycache__/__init__.cpython-39.pyc
|
|
15
15
|
insight_plugin/features/__init__.py
|
|
16
|
+
insight_plugin/features/analysis/__init__.py
|
|
17
|
+
insight_plugin/features/analysis/controller.py
|
|
16
18
|
insight_plugin/features/common/__init__.py
|
|
17
19
|
insight_plugin/features/common/builder.py
|
|
18
20
|
insight_plugin/features/common/checksum_util.py
|
|
@@ -45,6 +47,8 @@ insight_plugin/features/interactive/__init__.py
|
|
|
45
47
|
insight_plugin/features/interactive/controller.py
|
|
46
48
|
insight_plugin/features/interactive/util/__init__.py
|
|
47
49
|
insight_plugin/features/interactive/util/util.py
|
|
50
|
+
insight_plugin/features/linter/__init__.py
|
|
51
|
+
insight_plugin/features/linter/controller.py
|
|
48
52
|
insight_plugin/features/refresh/__init__.py
|
|
49
53
|
insight_plugin/features/refresh/controller.py
|
|
50
54
|
insight_plugin/features/run/__init__.py
|
|
File without changes
|
|
File without changes
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
CREATE_DESCRIPTION = (
|
|
2
|
-
"Create a new plugin."
|
|
3
|
-
+ " This command will generate the skeleton folder structure and "
|
|
4
|
-
"code for a new plugin, based on the provided plugin.spec.yaml file"
|
|
5
|
-
)
|
|
6
|
-
SERVER_DESCRIPTION = (
|
|
7
|
-
"Run the plugin in HTTP mode."
|
|
8
|
-
+ " This allows an external API testing program to be "
|
|
9
|
-
"used to test a plugin "
|
|
10
|
-
)
|
|
11
|
-
SAMPLES_DESCRIPTION = (
|
|
12
|
-
"Create test samples for actions and triggers."
|
|
13
|
-
+ " This command will create new files under the 'tests' folder "
|
|
14
|
-
"which can be used to test each new action/trigger. "
|
|
15
|
-
"Note if a file already exists for a particular action/trigger, it will not be overwritten"
|
|
16
|
-
)
|
|
17
|
-
REFRESH_DESCRIPTION = (
|
|
18
|
-
"Refresh the plugin."
|
|
19
|
-
+ " This command will update the current plugin code, when updates are made in the "
|
|
20
|
-
"plugin.spec.yaml file"
|
|
21
|
-
)
|
|
22
|
-
RUN_DESCRIPTION = (
|
|
23
|
-
"Run an action/trigger from a json test file"
|
|
24
|
-
+ " (created during sample generation)"
|
|
25
|
-
)
|
|
26
|
-
SHELL_DESCRIPTION = (
|
|
27
|
-
"Run the plugin via the docker shell" + " to enable advanced debugging"
|
|
28
|
-
)
|
|
29
|
-
EXPORT_DESCRIPTION = (
|
|
30
|
-
"Export a plugin Docker image to a tarball."
|
|
31
|
-
+ " This tarball can be uploaded as a custom plugin via the import "
|
|
32
|
-
"functionality in the InsightConnect UI"
|
|
33
|
-
)
|
|
34
|
-
VALIDATE_DESCRIPTION = (
|
|
35
|
-
"Validate / Run checks against the plugin."
|
|
36
|
-
+ " This command performs quality control checks on the current "
|
|
37
|
-
"state of the plugin. This should be run before finalizing any new updates"
|
|
38
|
-
)
|
|
39
|
-
VERSION_DESCRIPTION = (
|
|
40
|
-
"Update the plugin versioning."
|
|
41
|
-
+ " This command should be run after finalizing any updates, defect fixes or "
|
|
42
|
-
"new functionality, to update the versioning"
|
|
43
|
-
)
|
|
44
|
-
VIEW_DESCRIPTION = (
|
|
45
|
-
"View plugin docker container info" + "Provides an overview of the plugin"
|
|
46
|
-
)
|
|
47
|
-
VALID_IGNORE_FILES = ["help.md", "dockerfile", "unit_test"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/checksum_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/command_line_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/common_feature.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/logging_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/plugin_spec_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/common/temp_file_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/components.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/connection_help.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/constants.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/help/help_util.py
RENAMED
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/json_generation_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/create/plugin_to_helpmd.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/interactive/util/util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/samples/util/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/helpmd_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/input_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/version_util.py
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/features/version/util/yaml_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/assessment/assessment.jinja
RENAMED
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/__init__.py.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/plugin/util/__init__.py.jinja
RENAMED
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/requirements.txt.jinja
RENAMED
|
File without changes
|
|
File without changes
|
{insight_plugin-1.1.0 → insight_plugin-1.2.0}/insight_plugin/templates/unit_test/__init__.py.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|