Skip to content

Commit 622819b

Browse files
author
Lee Fine
committed
ab#80665
1 parent c451d99 commit 622819b

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

CitrixAdcOrchestratorJobExtension/Inventory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Keyfactor.Orchestrators.Extensions.Interfaces;
2323

2424
using com.citrix.netscaler.nitro.resource.config.ssl;
25+
using Newtonsoft.Json;
2526

2627
namespace Keyfactor.Extensions.Orchestrator.CitricAdc
2728
{
@@ -49,15 +50,18 @@ public JobResult ProcessJob(InventoryJobConfiguration jobConfiguration, SubmitIn
4950
_logger.LogDebug($"Client Machine: {jobConfiguration.CertificateStoreDetails.ClientMachine}");
5051
_logger.LogDebug($"UseSSL: {jobConfiguration.UseSSL}");
5152
_logger.LogDebug($"StorePath: {jobConfiguration.CertificateStoreDetails.StorePath}");
53+
5254
ServerPassword = ResolvePamField("ServerPassword", jobConfiguration.ServerPassword);
5355
ServerUserName = ResolvePamField("ServerUserName", jobConfiguration.ServerUsername);
5456

57+
dynamic properties = JsonConvert.DeserializeObject(jobConfiguration.CertificateStoreDetails.Properties.ToString());
58+
var timeout = properties.timeout == null || string.IsNullOrEmpty(properties.timeout.Value) ? null : Convert.ToInt32(properties.timeout.Value);
5559

5660
_logger.LogDebug("Entering ProcessJob");
5761
CitrixAdcStore store = new CitrixAdcStore(jobConfiguration, ServerUserName, ServerPassword);
5862

5963
_logger.LogDebug("Logging into Citrix...");
60-
store.Login();
64+
store.Login(timeout);
6165

6266
JobResult result = ProcessJob(store, jobConfiguration, submitInventoryUpdate);
6367

CitrixAdcOrchestratorJobExtension/Management.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ public JobResult ProcessJob(ManagementJobConfiguration jobConfiguration)
6262
ServerPassword = ResolvePamField("ServerPassword", jobConfiguration.ServerPassword);
6363
ServerUserName = ResolvePamField("ServerUserName", jobConfiguration.ServerUsername);
6464

65+
dynamic properties = JsonConvert.DeserializeObject(jobConfiguration.CertificateStoreDetails.Properties.ToString());
66+
var linkToIssuer = properties.linkToIssuer == null || string.IsNullOrEmpty(properties.linkToIssuer.Value) ? false : Convert.ToBoolean(properties.linkToIssuer.Value);
67+
var timeout = properties.timeout == null || string.IsNullOrEmpty(properties.timeout.Value) ? null : Convert.ToInt32(properties.timeout.Value);
68+
6569
ApplicationSettings.Initialize(this.GetType().Assembly.Location);
6670

6771
var store = new CitrixAdcStore(jobConfiguration, ServerUserName, ServerPassword);
6872

6973
_logger.LogDebug("Logging into Citrix...");
70-
store.Login();
74+
store.Login(timeout);
7175

7276
try
7377
{
@@ -89,9 +93,6 @@ public JobResult ProcessJob(ManagementJobConfiguration jobConfiguration)
8993
var virtualServerName = (string)jobConfiguration.JobProperties["virtualServerName"];
9094
var sniCert = (string)jobConfiguration.JobProperties["sniCert"];
9195

92-
dynamic properties = JsonConvert.DeserializeObject(jobConfiguration.CertificateStoreDetails.Properties.ToString());
93-
var linkToIssuer = properties.linkToIssuer == null || string.IsNullOrEmpty(properties.linkToIssuer.Value) ? false : Convert.ToBoolean(properties.linkToIssuer.Value);
94-
9596
_logger.LogTrace($"alias: {jobConfiguration.JobCertificate.Alias} virtualServerName {virtualServerName}");
9697

9798
if (!aliasExists)

integration-manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@
6565
"DefaultValue": "false",
6666
"Required": false,
6767
"Description": "Determines whether an attempt will be made to link the added certificate (via a Management-Add job) to its issuing CA certificate."
68+
},
69+
{
70+
"Name": "timeout",
71+
"DisplayName": "API Timeout in seconds",
72+
"Type": "String",
73+
"DependsOn": "",
74+
"DefaultValue": "3600",
75+
"Required": false,
76+
"Description": "Determines timeout in seconds for all Citrix ADC API calls."
6877
}
6978
],
7079
"EntryParameters": [

0 commit comments

Comments
 (0)