Skip to content

enabled flag#12

Merged
spbsoluble merged 11 commits intorelease-1.1from
enabledconfigflg
Oct 9, 2025
Merged

enabled flag#12
spbsoluble merged 11 commits intorelease-1.1from
enabledconfigflg

Conversation

@bhillkeyfactor
Copy link
Copy Markdown
Collaborator

Feature 76628

@spbsoluble spbsoluble requested a review from Copilot October 6, 2025 14:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an "Enabled" flag feature to the Aruba ClearPass AnyCA Gateway plugin and updates the project to support multiple .NET frameworks. The enabled flag allows administrators to disable gateway functionality while keeping the CA configuration intact, primarily for scenarios where the CA needs to be created before all configuration information is available.

  • Added an Enabled configuration parameter with default value of true
  • Updated project to support both .NET 6.0 and .NET 8.0 frameworks
  • Modified gateway operations to check the enabled flag before executing

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
integration-manifest.json Updated schema URL and added release_project field, plus new Enabled configuration parameter
aruba-clearpass-caplugin.csproj Changed from single .NET 6.0 target to multi-target .NET 6.0 and 8.0
Constants.cs Added Enabled constant for configuration key
ArubaClearPassConfig.cs Added Enabled boolean property with default value of true
ArubaClearPassCAPlugin.cs Implemented enabled flag checks in Ping and ValidateCAConnectionInfo methods, added configuration annotations
aruba-clearpass-caplugin.sln Updated Visual Studio version
README.md Updated documentation to reflect dual framework support and new Enabled parameter
CHANGELOG.md Added version 1.1.0 entry documenting the new features

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +169 to 185
try
{
if (!(bool)connectionInfo[ArubaClearPassConstants.Config.Enabled])
{
_logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
_logger.MethodExit(LogLevel.Trace);
return;
}
}
catch (Exception ex)
{
_logger.LogError($"Exception: {LogHandler.FlattenException(ex)}");
}

_logger.LogInformation("Validating CA Connection Info");

List<string> errors = new List<string>();
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The catch block swallows exceptions without re-throwing or handling the case where the Enabled key is missing. If the key doesn't exist or has an invalid type, the method will continue execution instead of properly handling the error condition.

Suggested change
try
{
if (!(bool)connectionInfo[ArubaClearPassConstants.Config.Enabled])
{
_logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
_logger.MethodExit(LogLevel.Trace);
return;
}
}
catch (Exception ex)
{
_logger.LogError($"Exception: {LogHandler.FlattenException(ex)}");
}
_logger.LogInformation("Validating CA Connection Info");
List<string> errors = new List<string>();
List<string> errors = new List<string>();
// Check for the Enabled key and its type
if (!connectionInfo.ContainsKey(ArubaClearPassConstants.Config.Enabled) || !(connectionInfo[ArubaClearPassConstants.Config.Enabled] is bool))
{
errors.Add("The 'Enabled' key is missing or not a boolean in the connection info.");
}
else if (!(bool)connectionInfo[ArubaClearPassConstants.Config.Enabled])
{
_logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
_logger.MethodExit(LogLevel.Trace);
return;
}
_logger.LogInformation("Validating CA Connection Info");
// errors list is already initialized above

Copilot uses AI. Check for mistakes.
@spbsoluble spbsoluble merged commit fca535d into release-1.1 Oct 9, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants