Skip to content

Commit 187f755

Browse files
authored
String sdk prep (#3251) (#3257)
1 parent 47b88b3 commit 187f755

File tree

6 files changed

+79
-54
lines changed

6 files changed

+79
-54
lines changed

plugins/string/.CHECKSUM

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"spec": "f712d68ed3cdd1ab0abb816e1500f77d",
3-
"manifest": "ff9feb5c62cc6078a3212085652011c3",
4-
"setup": "394787d1ead943699cecc2712c114b1b",
2+
"spec": "b12f0295fe9126e73db6045661af22b2",
3+
"manifest": "5ce8336de039ebe2b3c73d420a9bcd66",
4+
"setup": "ae84f483eaa6702a79044bc439010422",
55
"schemas": [
66
{
77
"identifier": "length/schema.py",

plugins/string/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.2.2
1+
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.2.5
22

33
LABEL organization=rapid7
44
LABEL sdk=python
@@ -12,7 +12,7 @@ RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
1212

1313
ADD . /python/src
1414

15-
RUN python setup.py build && python setup.py install
15+
RUN pip install .
1616

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

plugins/string/bin/komand_string

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ from sys import argv
66

77
Name = "String Operations"
88
Vendor = "rapid7"
9-
Version = "1.4.2"
10-
Description = "The String Operations plugin allows easy manipulation of string data.This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
9+
Version = "1.4.3"
10+
Description = "The String Operations plugin allows easy manipulation of string data. This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
1111

1212

1313
def main():

plugins/string/help.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Description
22

33
The String Operations plugin allows easy manipulation of string data.
4-
4+
55
This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)
66

77
# Key Features
@@ -345,6 +345,7 @@ Example output:
345345

346346
# Version History
347347

348+
* 1.4.3 - Updated SDK to the latest version (6.2.5)
348349
* 1.4.2 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities
349350
* 1.4.1 - Initial updates for fedramp compliance | Updated SDK to the latest version
350351
* 1.4.0 - New action Replace

plugins/string/plugin.spec.yaml

+68-44
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,64 @@ extension: plugin
33
products: [insightconnect]
44
name: string
55
title: String Operations
6-
description: "The String Operations plugin allows easy manipulation of string data.\n\nThis plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
7-
version: 1.4.2
6+
description: "The String Operations plugin allows easy manipulation of string data.\n
7+
\nThis plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
8+
version: 1.4.3
89
connection_version: 1
910
vendor: rapid7
1011
support: community
1112
status: []
12-
supported_versions: ["2024-09-06"]
13+
supported_versions: ['2024-09-06']
1314
cloud_ready: true
1415
fedramp_ready: true
1516
resources:
1617
source_url: https://github.com/rapid7/insightconnect-plugins/tree/master/plugins/string
1718
license_url: https://github.com/rapid7/insightconnect-plugins/blob/master/LICENSE
1819
tags:
19-
- utilities
20-
- string
21-
- split
20+
- utilities
21+
- string
22+
- split
2223
hub_tags:
2324
use_cases: [data_utility]
2425
keywords: [string, cloud_enabled]
2526
features: []
2627
sdk:
2728
type: slim
28-
version: 6.2.2
29+
version: 6.2.5
2930
user: nobody
3031
key_features:
31-
- "Split a string to a list of elements"
32-
- "Split a string to an object"
33-
- "Upper case, lower case, and trim a string"
34-
- "Replace parts of a string"
32+
- Split a string to a list of elements
33+
- Split a string to an object
34+
- Upper case, lower case, and trim a string
35+
- Replace parts of a string
3536
version_history:
36-
- "1.4.2 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities"
37-
- "1.4.1 - Initial updates for fedramp compliance | Updated SDK to the latest version"
38-
- "1.4.0 - New action Replace"
39-
- "1.3.1 - Update to v4 Python plugin runtime"
40-
- "1.3.0 - New action Length | Add example inputs"
41-
- "1.2.1 - New spec and help.md format for the Extension Library"
42-
- "1.2.0 - New action Trim"
43-
- "1.1.0 - New action Set Encoding"
44-
- "1.0.1 - Update plugin tag from `util` to `utilities` for Marketplace searchability"
45-
- "1.0.0 - Initial plugin"
37+
- 1.4.3 - Updated SDK to the latest version (6.2.5)
38+
- 1.4.2 - Updated SDK to the latest version (v6.2.2) | Address vulnerabilities
39+
- 1.4.1 - Initial updates for fedramp compliance | Updated SDK to the latest version
40+
- 1.4.0 - New action Replace
41+
- 1.3.1 - Update to v4 Python plugin runtime
42+
- 1.3.0 - New action Length | Add example inputs
43+
- 1.2.1 - New spec and help.md format for the Extension Library
44+
- 1.2.0 - New action Trim
45+
- 1.1.0 - New action Set Encoding
46+
- 1.0.1 - Update plugin tag from `util` to `utilities` for Marketplace searchability
47+
- 1.0.0 - Initial plugin
4648
troubleshooting:
47-
- "`Split String to Object`: if the input contains multiple key:value pairs and these pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign we can follow the below example:\n\n + Example text: `Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo\\RGWin64\" Computer_Type=\"Windows\"`\n + Example Input: `{\"block_delimiter\": \" \",\"string\":\n\"Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo RGWin64\" Computer_Type=\"Windows\",\"string_delimiter\": \"=\"}`\n + Example output: `{ \"object\": { \"Computer_ID\": \"bef41e8b-47b8-e188-8e43-3a2b662dd55d\", \"Computer_Name\": \"dgdemo RGWin64\", \"Computer_Type\": \"Windows\" } }`\n\n"
48-
- "There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead."
49+
- "`Split String to Object`: if the input contains multiple key:value pairs and these
50+
pairs are separated from each other by a space, and the keys and values within each
51+
pair are separated by an equal sign we can follow the below example:\n\n + Example
52+
text: `Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo\\\
53+
RGWin64\" Computer_Type=\"Windows\"`\n + Example Input: `{\"block_delimiter\":
54+
\" \",\"string\":\n\"Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"\
55+
dgdemo RGWin64\" Computer_Type=\"Windows\",\"string_delimiter\": \"=\"}`\n + Example
56+
output: `{ \"object\": { \"Computer_ID\": \"bef41e8b-47b8-e188-8e43-3a2b662dd55d\"\
57+
, \"Computer_Name\": \"dgdemo RGWin64\", \"Computer_Type\": \"Windows\" } }`\n\n"
58+
- There may be complex string manipulation needs that are likely outside the scope
59+
of this plugin. If this is the case, consider using the Python 3 Script plugin instead.
4960
links:
50-
- "[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
61+
- '[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)'
5162
references:
52-
- "[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
63+
- '[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)'
5364
actions:
5465
set_encoding:
5566
title: Set Encoding
@@ -65,17 +76,17 @@ actions:
6576
type: string
6677
description: Encoding to use
6778
enum:
68-
- "UTF-8"
69-
- "ASCII"
79+
- UTF-8
80+
- ASCII
7081
required: true
7182
example: ASCII
7283
error_handling:
7384
type: string
7485
description: Error handler to use for encoding and decoding
7586
enum:
76-
- "strict"
77-
- "replace"
78-
- "ignore"
87+
- strict
88+
- replace
89+
- ignore
7990
required: true
8091
example: ignore
8192
output:
@@ -91,17 +102,17 @@ actions:
91102
input:
92103
string:
93104
title: String Input
94-
description: "String to break into an array"
105+
description: String to break into an array
95106
type: string
96107
required: true
97-
example: "This,is,a,sentence"
108+
example: This,is,a,sentence
98109
delimiter:
99110
title: Delimiter
100111
description: The character used to split the string into slices for the list.
101112
The default is a newline, if not provided by the user
102113
type: string
103114
required: false
104-
example: ","
115+
example: ','
105116
output:
106117
list:
107118
type: '[]string'
@@ -111,29 +122,40 @@ actions:
111122
example: '["This", "is", "a", "sentence"]'
112123
split_to_object:
113124
title: Split String to Object
114-
description: "This action is used to convert a string to an object containing key:value strings.\n\nAny input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.\n\nThe [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.\n\nPlease refer to troubleshooting section for a more complex example"
125+
description: "This action is used to convert a string to an object containing
126+
key:value strings.\n\nAny input requiring more than a single key:value pair,
127+
e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the
128+
input string is split by the `block_delimiter` character first, and the resulting
129+
items are then split by the `string_delimiter` option. Stripping of double-quotes
130+
is automatically applied in this situation for each item before the plugin returns
131+
it.\n\nThe [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema)
132+
on the action's page can be modified to pre-populate the workflow with the names
133+
of the keys. It allows users the ability to use the green selector and choose
134+
a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating)
135+
would need to be used to obtain variables by name otherwise.\n\nPlease refer
136+
to troubleshooting section for a more complex example"
115137
input:
116138
string:
117139
title: String Input
118140
description: String to convert e.g. USER=Bob
119141
type: string
120142
required: true
121-
example: "User=Bob"
143+
example: User=Bob
122144
string_delimiter:
123145
title: String Delimiter
124146
description: The character used to split the string into slices for the list.
125147
The default is a space, if not provided by the user
126148
type: string
127149
required: false
128-
example: "="
150+
example: '='
129151
block_delimiter:
130152
title: Block Delimiter
131153
description: The character delimiter for the initial string split, applied
132154
before the string delimiter input. This parameter is optional but allows
133155
for more complex handling
134156
type: string
135157
required: false
136-
example: "["
158+
example: '['
137159
output:
138160
object:
139161
type: object
@@ -184,7 +206,7 @@ actions:
184206
description: String to trim
185207
type: string
186208
required: true
187-
example: "Extra spaces at the end of this string "
209+
example: 'Extra spaces at the end of this string '
188210
output:
189211
trimmed:
190212
type: string
@@ -201,7 +223,7 @@ actions:
201223
description: String to return length of
202224
type: string
203225
required: true
204-
example: "return the number of characters in this string"
226+
example: return the number of characters in this string
205227
output:
206228
length:
207229
type: integer
@@ -218,19 +240,21 @@ actions:
218240
description: The string to replace parts of
219241
type: string
220242
required: true
221-
example: "this is a string"
243+
example: this is a string
222244
string_part_to_find:
223245
title: String Part to Find
224-
description: The string part to look for. All instances of this string will be replaced
246+
description: The string part to look for. All instances of this string will
247+
be replaced
225248
type: string
226249
required: true
227-
example: "string"
250+
example: string
228251
replacement_value:
229252
title: Replacement Value
230-
description: The string that will replace the parts that are found. If left blank the characters to find will be deleted
253+
description: The string that will replace the parts that are found. If left
254+
blank the characters to find will be deleted
231255
type: string
232256
required: false
233-
example: "replacement"
257+
example: replacement
234258
output:
235259
result_string:
236260
title: Result String

plugins/string/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
setup(name="string-rapid7-plugin",
6-
version="1.4.2",
7-
description="The String Operations plugin allows easy manipulation of string data.This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)",
6+
version="1.4.3",
7+
description="The String Operations plugin allows easy manipulation of string data. This plugin utilizes the Python 3 String library [set of methods](https://docs.python.org/3/library/stdtypes.html#string-methods)",
88
author="rapid7",
99
author_email="",
1010
url="",

0 commit comments

Comments
 (0)