Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,5 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/
.claude/settings.local.json
sample change.txt
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# v1.0.1
* SaaS Containerization Fixes, added enabled flag cleaned up some log messages
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHANGELOG entry has a minor grammar issue. "added enabled flag cleaned up" should have proper punctuation. Consider: "SaaS Containerization Fixes, added enabled flag, and cleaned up some log messages" or "SaaS Containerization Fixes: added enabled flag and cleaned up some log messages".

Suggested change
* SaaS Containerization Fixes, added enabled flag cleaned up some log messages
* SaaS Containerization Fixes: added enabled flag and cleaned up some log messages

Copilot uses AI. Check for mistakes.

# v1.0.0
* Initial Release. Sync, Enroll, and Revocation.
36 changes: 28 additions & 8 deletions HydrantCAProxy/HydrantIdCAPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class HydrantIdCAPlugin : IAnyCAPlugin
private RequestManager _requestManager;
private IAnyCAPluginConfigProvider Config { get; set; }
private ICertificateDataReader certDataReader;
private HydrantIdCAPluginConfig.Config _config;

public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDataReader certificateDataReader)
{
Expand All @@ -37,10 +38,13 @@ public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDa
{
certDataReader = certificateDataReader;
Config = configProvider;
var rawData = JsonConvert.SerializeObject(configProvider.CAConnectionData);
_config = JsonConvert.DeserializeObject<HydrantIdCAPluginConfig.Config>(rawData);
_logger.LogTrace($"Initialize - Enabled: {_config.Enabled}");
}
catch (Exception ex)
{
_logger.LogError($"Failed to initialize GCP CAS CAPlugin: {ex}");
_logger.LogError($"Failed to initialize HydrantId CAPlugin: {ex}");
}
}

Comment on lines 38 to 50
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Synchronize method does not check the Enabled flag before attempting to synchronize certificates from HydrantId. This is inconsistent with the Ping and ValidateCAConnectionInfo methods which skip operations when Enabled is false. When the CA is disabled, this method should return early to avoid unnecessary API calls and processing.

Copilot uses AI. Check for mistakes.
Expand All @@ -58,23 +62,39 @@ private static List<string> CheckRequiredValues(Dictionary<string, object> conne

public async Task Ping()
{

_logger.MethodEntry();
if (!_config.Enabled)
{
_logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping connectivity test...");
_logger.MethodExit(LogLevel.Trace);
return;
}
_logger.LogDebug("Pinging HydrantId to validate connection");
_logger.MethodExit();
}

public Task ValidateCAConnectionInfo(Dictionary<string, object> connectionInfo)
{
_logger.MethodEntry();
_logger.LogDebug($"Validating GCP CAS CA Connection properties");
_logger.LogDebug($"Validating HydrantId CA Connection properties");
var rawData = JsonConvert.SerializeObject(connectionInfo);
HydrantIdCAPluginConfig.Config config = JsonConvert.DeserializeObject<HydrantIdCAPluginConfig.Config>(rawData);
_config = JsonConvert.DeserializeObject<HydrantIdCAPluginConfig.Config>(rawData);

_logger.LogTrace($"HydrantIdClientFromCAConnectionData - HydrantIdBaseUrl: {config.HydrantIdBaseUrl}");
_logger.LogTrace($"HydrantIdClientFromCAConnectionData - HydrantIdBaseUrl: {_config.HydrantIdBaseUrl}");
_logger.LogTrace($"HydrantIdClientFromCAConnectionData - Enabled: {_config.Enabled}");

if (!_config.Enabled)
{
_logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation...");
_logger.MethodExit();
return Task.CompletedTask;
}

List<string> missingFields = new List<string>();

if (string.IsNullOrEmpty(config.HydrantIdBaseUrl)) missingFields.Add(nameof(config.HydrantIdBaseUrl));
if (string.IsNullOrEmpty(config.HydrantIdAuthId)) missingFields.Add(nameof(config.HydrantIdAuthId));
if (string.IsNullOrEmpty(config.HydrantIdAuthKey)) missingFields.Add(nameof(config.HydrantIdAuthKey));
if (string.IsNullOrEmpty(_config.HydrantIdBaseUrl)) missingFields.Add(nameof(_config.HydrantIdBaseUrl));
if (string.IsNullOrEmpty(_config.HydrantIdAuthId)) missingFields.Add(nameof(_config.HydrantIdAuthId));
if (string.IsNullOrEmpty(_config.HydrantIdAuthKey)) missingFields.Add(nameof(_config.HydrantIdAuthKey));

if (missingFields.Count > 0)
{
Expand Down
9 changes: 9 additions & 0 deletions HydrantCAProxy/HydrantIdCAPluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public class ConfigConstants
public static string HydrantIdAuthId = "HydrantIdAuthId";
public static string HydrantIdAuthKey = "HydrantIdAuthKey";
public static string DefaultPageSize = "DefaultPageSize";
public static string Enabled = "Enabled";
}

public class Config
{
public string HydrantIdBaseUrl { get; set; }
public string HydrantIdAuthId { get; set; }
public string HydrantIdAuthKey { get; set; }
public bool Enabled { get; set; }
}

public static class EnrollmentParametersConstants
Expand Down Expand Up @@ -68,6 +70,13 @@ public static Dictionary<string, PropertyConfigInfo> GetPluginAnnotations()
Hidden = true,
DefaultValue = "",
Type = "Secret"
},
[ConfigConstants.Enabled] = new PropertyConfigInfo()
{
Comments = "Flag to Enable or Disable the CA connector.",
Hidden = false,
DefaultValue = true,
Type = "Bool"
}
};
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ The plugin supports the following standard CRL revocation reasons:
* **HydrantIdBaseUrl** - The Base URL For the HydrantId Endpoint similar to https://acm-stage.hydrantid.com. Get this from HydrantId.
* **HydrantIdAuthId** - The AuthId Obtained from HydrantId.
* **HydrantIdAuthKey** - The AuthKey Obtained from HydrantId.
* **Enabled** - Flag to Enable or Disable the CA connector.

2. ### Template (Product) Configuration

Expand Down
4 changes: 4 additions & 0 deletions integration-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
{
"name": "HydrantIdAuthKey",
"description": "The AuthKey Obtained from HydrantId."
},
{
"name": "Enabled",
"description": "Flag to Enable or Disable the CA connector."
}
],
"enrollment_config": [
Expand Down
Loading