Skip to content

Commit bd3c203

Browse files
committed
Merge Enabled field into dev branch
2 parents c5bb5d8 + 2213302 commit bd3c203

8 files changed

Lines changed: 100 additions & 30 deletions

File tree

.github/workflows/keyfactor-bootstrap-workflow-v3.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Keyfactor Bootstrap Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, closed, synchronize, edited, reopened]
7+
push:
8+
create:
9+
branches:
10+
- 'release-*.*'
11+
12+
jobs:
13+
call-starter-workflow:
14+
uses: keyfactor/actions/.github/workflows/starter.yml@v4
15+
permissions:
16+
contents: write # Explicitly grant write permission
17+
with:
18+
command_token_url: ${{ vars.COMMAND_TOKEN_URL }}
19+
command_hostname: ${{ vars.COMMAND_HOSTNAME }}
20+
command_base_api_path: ${{ vars.COMMAND_API_PATH }}
21+
secrets:
22+
token: ${{ secrets.V2BUILDTOKEN}}
23+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
24+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
25+
scan_token: ${{ secrets.SAST_TOKEN }}
26+
entra_username: ${{ secrets.DOCTOOL_ENTRA_USERNAME }}
27+
entra_password: ${{ secrets.DOCTOOL_ENTRA_PASSWD }}
28+
command_client_id: ${{ secrets.COMMAND_CLIENT_ID }}
29+
command_client_secret: ${{ secrets.COMMAND_CLIENT_SECRET }}

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center" style="border-bottom: none">
2-
GlobalSign MSSL Gateway AnyCA Gateway REST Plugin
2+
GlobalSign MSSL AnyCA Gateway REST Plugin
33
</h1>
44

55
<p align="center">
@@ -38,10 +38,10 @@ The GlobalSign CAPlugin enables the Synchronization, Enrollment, and Revocation
3838

3939
## Compatibility
4040

41-
The GlobalSign MSSL Gateway AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 25.2.0 and later.
41+
The GlobalSign MSSL AnyCA Gateway REST plugin is compatible with the Keyfactor AnyCA Gateway REST 25.2.0 and later.
4242

4343
## Support
44-
The GlobalSign MSSL Gateway AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
44+
The GlobalSign MSSL AnyCA Gateway REST plugin is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
4545

4646
> To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab.
4747
@@ -60,7 +60,7 @@ This extension uses the contact information of the GCC Domain point of contact f
6060

6161
1. Install the AnyCA Gateway REST per the [official Keyfactor documentation](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/InstallIntroduction.htm).
6262

63-
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [GlobalSign MSSL Gateway AnyCA Gateway REST plugin](https://github.com/Keyfactor/globalsign-mssl-caplugin/releases/latest) from GitHub.
63+
2. On the server hosting the AnyCA Gateway REST, download and unzip the latest [GlobalSign MSSL AnyCA Gateway REST plugin](https://github.com/Keyfactor/globalsign-mssl-caplugin/releases/latest) from GitHub.
6464

6565
3. Copy the unzipped directory (usually called `net6.0` or `net8.0`) to the Extensions directory:
6666

@@ -71,11 +71,11 @@ This extension uses the contact information of the GCC Domain point of contact f
7171
Program Files\Keyfactor\AnyCA Gateway\AnyGatewayREST\net8.0\Extensions
7272
```
7373

74-
> The directory containing the GlobalSign MSSL Gateway AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
74+
> The directory containing the GlobalSign MSSL AnyCA Gateway REST plugin DLLs (`net6.0` or `net8.0`) can be named anything, as long as it is unique within the `Extensions` directory.
7575

7676
4. Restart the AnyCA Gateway REST service.
7777

78-
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the GlobalSign MSSL Gateway plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
78+
5. Navigate to the AnyCA Gateway REST portal and verify that the Gateway recognizes the GlobalSign MSSL plugin by hovering over the ⓘ symbol to the right of the Gateway on the top left of the portal.
7979

8080
## Configuration
8181

@@ -103,8 +103,9 @@ This extension uses the contact information of the GCC Domain point of contact f
103103
* **RetryCount** - This is the number of times the AnyGateway will attempt to pickup an new certificate before reporting an error. Default is 5.
104104
* **SyncIntervalDays** - OPTIONAL: Required if SyncStartDate is used. Specifies how to page the certificate sync. Should be a value such that no interval of that length contains > 500 certificate enrollments.
105105
* **SyncStartDate** - If provided, full syncs will start at the specified date.
106+
* **Enabled** - Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available.
106107

107-
2. Define [Certificate Profiles](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCP-Gateway.htm) and [Certificate Templates](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Gateway.htm) for the Certificate Authority as required. One Certificate Profile must be defined per Certificate Template. It's recommended that each Certificate Profile be named after the Product ID. The GlobalSign MSSL Gateway plugin supports the following product IDs:
108+
2. Define [Certificate Profiles](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCP-Gateway.htm) and [Certificate Templates](https://software.keyfactor.com/Guides/AnyCAGatewayREST/Content/AnyCAGatewayREST/AddCA-Gateway.htm) for the Certificate Authority as required. One Certificate Profile must be defined per Certificate Template. It's recommended that each Certificate Profile be named after the Product ID. The GlobalSign MSSL plugin supports the following product IDs:
108109
109110
* **PEV_SHA2**
110111
* **PEV**

globalsign-mssl-caplugin/Client/GlobalSignApiClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public GlobalSignApiClient(GlobalSignCAConfig config, ILogger logger)
2626
Logger = logger;
2727
Config = config;
2828
// Logger = LogHandler.GetClassLogger(this.GetType());
29+
var enabled =config.Enabled;
30+
if (!enabled)
31+
{
32+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
33+
Logger.MethodExit();
34+
return;
35+
}
2936
QueryService = new GASV1Client
3037
{
3138
Endpoint = { Address = new EndpointAddress(config.GetUrl(GlobalSignServiceType.QUERY)), Name = "QUERY" }

globalsign-mssl-caplugin/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ internal class Constants
2222
public static string SYNCSTARTDATE = "SyncStartDate";
2323
public static string SYNCINTERNVALDAYS = "SyncIntervalDays";
2424
public static string SYNCPRODUCTS = "SyncProducts";
25+
public static string Enabled = "Enabled";
2526
}
2627

2728
public static class EnrollmentConfigConstants

globalsign-mssl-caplugin/GlobalSignCAConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class GlobalSignCAConfig
3434
public int SyncIntervalDays { get; set; } = 0;
3535
public string SyncProducts { get; set; } = "";
3636

37+
public bool Enabled { get; set; } = true;
3738

3839
public string GetUrl(GlobalSignServiceType queryType)
3940
{

globalsign-mssl-caplugin/GlobalSignCAPlugin.cs

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,25 @@ public class GlobalSignCAPlugin : IAnyCAPlugin
2323
private ICertificateDataReader? _certificateDataReader;
2424
private ILogger Logger;
2525

26-
private GlobalSignCAConfig Config { get; set; } = new();
27-
26+
private GlobalSignCAConfig Config { get; set; } = new();
27+
private bool _enabled = false;
2828

2929
public void Initialize(IAnyCAPluginConfigProvider configProvider, ICertificateDataReader certificateDataReader)
3030
{
3131
Logger = LogHandler.GetClassLogger(GetType());
3232
Logger.MethodEntry();
33+
var enabledValue = configProvider.CAConnectionData["Enabled"];
34+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
35+
if (!isEnabled)
36+
{
37+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
38+
Logger.MethodExit();
39+
return;
40+
}
3341
Config = new GlobalSignCAConfig
3442
{
3543
IsTest = bool.Parse((string)configProvider.CAConnectionData["TestAPI"]),
44+
Enabled = isEnabled,
3645
Password = (string)configProvider.CAConnectionData["GlobalSignPassword"],
3746
Username = (string)configProvider.CAConnectionData["GlobalSignUsername"],
3847
PickupDelay = int.Parse((string)configProvider.CAConnectionData["DelayTime"]),
@@ -473,6 +482,12 @@ public async Task<EnrollmentResult> Enroll(string csr, string subject, Dictionar
473482
public async Task Ping()
474483
{
475484
Logger.MethodEntry();
485+
if (!_enabled)
486+
{
487+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping config validation and MSSL Client creation...");
488+
Logger.MethodExit();
489+
return;
490+
}
476491
try
477492
{
478493
Logger.LogInformation("Ping reqeuest recieved");
@@ -490,6 +505,18 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
490505
{
491506
Logger = LogHandler.GetClassLogger(GetType());
492507
Logger.MethodEntry();
508+
509+
// Handle Enabled flag - could be bool or string
510+
var enabledValue = connectionInfo["Enabled"];
511+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
512+
513+
if (!isEnabled)
514+
{
515+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
516+
Logger.MethodExit(LogLevel.Trace);
517+
return;
518+
}
519+
493520
Config = new GlobalSignCAConfig
494521
{
495522
IsTest = bool.Parse((string)connectionInfo["TestAPI"]),
@@ -502,6 +529,7 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
502529
ORDER_TEST_URL = (string)connectionInfo["OrderAPITestURL"],
503530
QUERY_TEST_URL = (string)connectionInfo["QueryAPITestURL"],
504531
QUERY_PROD_URL = (string)connectionInfo["QueryAPIProdURL"],
532+
Enabled = isEnabled,
505533
SyncStartDate = connectionInfo.TryGetValue("SyncStartDate", out object? value)
506534
? (string)value : string.Empty,
507535
SyncIntervalDays = connectionInfo.TryGetValue("SyncIntervalDays", out var val)
@@ -517,6 +545,17 @@ public async Task ValidateCAConnectionInfo(Dictionary<string, object> connection
517545

518546
public Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary<string, object> connectionInfo)
519547
{
548+
// Handle Enabled flag - could be bool or string
549+
var enabledValue = connectionInfo["Enabled"];
550+
bool isEnabled = enabledValue is bool ? (bool)enabledValue : bool.Parse((string)enabledValue);
551+
552+
if (!isEnabled)
553+
{
554+
Logger.LogWarning($"The CA is currently in the Disabled state. It must be Enabled to perform operations. Skipping validation...");
555+
Logger.MethodExit(LogLevel.Trace);
556+
return Task.CompletedTask;
557+
}
558+
520559
Config = new GlobalSignCAConfig
521560
{
522561
IsTest = bool.Parse((string)connectionInfo["TestAPI"]),
@@ -529,6 +568,7 @@ public Task ValidateProductInfo(EnrollmentProductInfo productInfo, Dictionary<st
529568
ORDER_TEST_URL = (string)connectionInfo["OrderAPITestURL"],
530569
QUERY_TEST_URL = (string)connectionInfo["QueryAPITestURL"],
531570
QUERY_PROD_URL = (string)connectionInfo["QueryAPIProdURL"],
571+
Enabled = isEnabled,
532572
SyncStartDate = connectionInfo.TryGetValue("SyncStartDate", out object? value)
533573
? (string)value : string.Empty,
534574
SyncIntervalDays = connectionInfo.TryGetValue("SyncIntervalDays", out var val)
@@ -646,7 +686,14 @@ public Dictionary<string, PropertyConfigInfo> GetCAConnectorAnnotations()
646686
Hidden = false,
647687
DefaultValue = null,
648688
Type = "String"
649-
}
689+
},
690+
[Constants.Enabled] = new()
691+
{
692+
Comments = "Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available.",
693+
Hidden = false,
694+
DefaultValue = true,
695+
Type = "Boolean"
696+
}
650697
};
651698
}
652699

integration-manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
{
6161
"name": "SyncStartDate",
6262
"description": "If provided, full syncs will start at the specified date."
63+
},
64+
{
65+
"name": "Enabled",
66+
"description": "Flag to Enable or Disable gateway functionality. Disabling is primarily used to allow creation of the CA prior to configuration information being available."
6367
}
6468
],
6569
"enrollment_config": [

0 commit comments

Comments
 (0)