Skip to content

Commit 800aa01

Browse files
authored
Merge pull request #27 from g4-api/development
Development
2 parents 8cf8574 + 19202bf commit 800aa01

11 files changed

Lines changed: 173 additions & 102 deletions

File tree

src/G4.DocumentsGenerator/G4.DocumentsGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup> <PackageReference Include="G4.Abstraction.Cli" Version="2025.3.7.16" />
19-
<PackageReference Include="G4.Converters" Version="2025.3.7.34" />
19+
<PackageReference Include="G4.Converters" Version="2025.3.28.36" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src/G4.IntegrationTests/G4.IntegrationTests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<PackageReference Include="G4.Api" Version="2025.3.5.31" />
36-
<PackageReference Include="G4.Plugins" Version="2025.3.7.34" />
37-
<PackageReference Include="G4.Converters" Version="2025.3.7.34" />
35+
<PackageReference Include="G4.Api" Version="2025.3.11.34" />
36+
<PackageReference Include="G4.Plugins" Version="2025.3.28.36" />
37+
<PackageReference Include="G4.Converters" Version="2025.3.28.36" />
3838
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.10" PrivateAssets="all" />
3939
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
40-
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
41-
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
40+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
41+
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
4242
<PackageReference Include="coverlet.collector" Version="6.0.4">
4343
<PrivateAssets>all</PrivateAssets>
4444
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4545
</PackageReference>
46-
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
46+
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
4747
</ItemGroup>
4848

4949
<ItemGroup>

src/G4.ManifestValidator/G4.ManifestValidator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="G4.Attributes" Version="2025.3.7.34" />
19+
<PackageReference Include="G4.Attributes" Version="2025.3.28.36" />
2020
</ItemGroup>
2121

2222
</Project>

src/G4.Plugins.Common/Actions.Manifests/RegisterParameter.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"| Environment Handling | Allows specifying different environments where the parameters are managed. |",
3636
"| Regular Expression Matching | Can apply a regular expression to the value and encode the result in Base64. |",
3737
"| Meta Action | Converts user input into the appropriate `SetParameter` plugin rule and sends it. |",
38+
"| Encryption Support | Optionally encrypts the parameter value using the provided EncryptionKey. |",
3839
"",
3940
"### Usages in RPA",
4041
"",
@@ -46,11 +47,11 @@
4647
"",
4748
"### Usages in Automation Testing",
4849
"",
49-
"| Usage | Description |",
50-
"|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|",
51-
"| Test Data Management | Use the `RegisterParameter` plugin to manage test data by registering values to different scopes. |",
52-
"| Environment Configuration | Facilitate the setup of test environments by registering configuration parameters to the required locations. |",
53-
"| Dynamic Test Execution | Enable dynamic test execution by registering runtime parameters that are needed for various test scenarios, ensuring tests are executed with the correct data.|"
50+
"| Usage | Description |",
51+
"|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|",
52+
"| Test Data Management | Use the `RegisterParameter` plugin to manage test data by registering values to different scopes. |",
53+
"| Environment Configuration | Facilitate the setup of test environments by registering configuration parameters to the required locations. |",
54+
"| Dynamic Test Execution | Enable dynamic test execution by registering runtime parameters that are needed for various test scenarios, ensuring tests are executed with the correct data. |"
5455
],
5556
"examples": [
5657
{
@@ -117,6 +118,15 @@
117118
"pluginName": "RegisterParameter",
118119
"regularExpression": "\\d+"
119120
}
121+
},
122+
{
123+
"description": [
124+
"This configuration registers a parameter with an encryption key provided for encrypting the parameter value within the session scope."
125+
],
126+
"rule": {
127+
"argument": "{{$ --Name:parameterName --Value:parameterValue --Scope:Session --EncryptionKey:myEncryptionKey}}",
128+
"pluginName": "RegisterParameter"
129+
}
120130
}
121131
],
122132
"key": "RegisterParameter",
@@ -154,6 +164,14 @@
154164
"mandatory": false,
155165
"name": "Value",
156166
"type": "String"
167+
},
168+
{
169+
"description": [
170+
"Specifies the encryption key to be used to encrypt the parameter value."
171+
],
172+
"mandatory": false,
173+
"name": "EncryptionKey",
174+
"type": "String"
157175
}
158176
],
159177
"pluginType": "Action",
@@ -210,7 +228,7 @@
210228
"summary": [
211229
"The `RegisterParameter` plugin facilitates the registration and storage of parameters within automation scripts by saving values to a specified scope.",
212230
"It converts user input into the appropriate `SetParameter` plugin rule and sends it, supporting parameter registration from direct input or web elements.",
213-
"Key features include parameter registration, scope management, environment handling, regular expression matching, and meta action capabilities.",
231+
"Key features include parameter registration, scope management, environment handling, regular expression matching, meta action capabilities, and encryption support when an EncryptionKey is provided.",
214232
"Common use cases include registering values from web elements, managing parameters across sessions or environments, and handling complex data with regular expressions in both RPA and automation testing scenarios."
215233
]
216234
}

src/G4.Plugins.Common/Actions/RegisterParameter.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ protected override PluginResponseModel OnSend(PluginDataModel pluginData)
3131
var isValue = arguments.ContainsKey(Value);
3232

3333
// Get the parameter name, value, and scope from the formatted arguments or use defaults.
34-
var name = arguments.Get(Name, defaultValue: pluginData.Rule.Argument);
35-
var value = arguments.Get(Value, defaultValue: string.Empty);
36-
var scope = arguments.Get(Scope, defaultValue: "Session");
37-
var environment = arguments.Get(Environment, "SystemParameters");
34+
var name = arguments.Get(key: Name, defaultValue: pluginData.Rule.Argument);
35+
var value = arguments.Get(key: Value, defaultValue: string.Empty);
36+
var encryptionKey = arguments.Get(key: "EncryptionKey", defaultValue: string.Empty);
37+
var scope = arguments.Get(key: Scope, defaultValue: "Session");
38+
var environment = arguments.Get(key: Environment, "SystemParameters");
3839

3940
try
4041
{
@@ -71,7 +72,12 @@ protected override PluginResponseModel OnSend(PluginDataModel pluginData)
7172
value ??= string.Empty;
7273

7374
// Using Regex to match the value based on the regular expression defined in the 'action' object
74-
value = Regex.Match(value, pluginData.Rule.RegularExpression).Value.ConvertToBase64();
75+
value = Regex.Match(value, pluginData.Rule.RegularExpression).Value;
76+
77+
// Encrypt the value if the 'Encrypt' parameter is set to true and the value is not empty.
78+
value = !string.IsNullOrEmpty(encryptionKey)
79+
? value.Encrypt(encryptionKey).ConvertToBase64()
80+
: value.ConvertToBase64();
7581

7682
// Creating a new scope action with the specified name, value, and scope
7783
var scopeRule = NewScopeAction(pluginData, name, value, scope, environment);

src/G4.Plugins.Common/G4.Plugins.Common.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="G4.Converters" Version="2025.3.7.34" />
29-
<PackageReference Include="G4.Extensions" Version="2025.3.7.34" />
30-
<PackageReference Include="G4.Plugins" Version="2025.3.7.34" />
28+
<PackageReference Include="G4.Converters" Version="2025.3.28.36" />
29+
<PackageReference Include="G4.Extensions" Version="2025.3.28.36" />
30+
<PackageReference Include="G4.Plugins" Version="2025.3.28.36" />
3131
</ItemGroup>
3232

3333
<ItemGroup>

0 commit comments

Comments
 (0)