Skip to content

Commit

Permalink
Merge f1d9dcb into 2b21ca7
Browse files Browse the repository at this point in the history
  • Loading branch information
bhillkeyfactor authored Dec 16, 2024
2 parents 2b21ca7 + f1d9dcb commit 420906a
Show file tree
Hide file tree
Showing 12 changed files with 464 additions and 163 deletions.
56 changes: 17 additions & 39 deletions .github/workflows/keyfactor-starter-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,20 @@
name: Starter Workflow
on: [workflow_dispatch, push, pull_request]
name: Keyfactor Bootstrap Workflow

jobs:
call-create-github-release-workflow:
uses: Keyfactor/actions/.github/workflows/github-release.yml@main

get-manifest-properties:
runs-on: windows-latest
outputs:
update_catalog: ${{ steps.read-json.outputs.prop }}
steps:
- uses: actions/checkout@v3
- name: Read json
id: read-json
shell: pwsh
run: |
$json = Get-Content integration-manifest.json | ConvertFrom-Json
echo "::set-output name=prop::$(echo $json.update_catalog)"
call-dotnet-build-and-release-workflow:
needs: [call-create-github-release-workflow]
uses: Keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@main
with:
release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }}
release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }}
release_dir: DataPower/bin/Debug # TODO: set build output directory to upload as a release, relative to checkout workspace
secrets:
token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }}
on:
workflow_dispatch:
pull_request:
types: [opened, closed, synchronize, edited, reopened]
push:
create:
branches:
- 'release-*.*'

call-generate-readme-workflow:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main
jobs:
call-starter-workflow:
uses: keyfactor/actions/.github/workflows/starter.yml@3.1.2
secrets:
token: ${{ secrets.APPROVE_README_PUSH }}

call-update-catalog-workflow:
needs: get-manifest-properties
if: needs.get-manifest-properties.outputs.update_catalog == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main
secrets:
token: ${{ secrets.SDK_SYNC_PAT }}
token: ${{ secrets.V2BUILDTOKEN}}
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
scan_token: ${{ secrets.SAST_TOKEN }}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
1.1.1
* Dual Build .Net 6 and .Net 8 support
* Test Tool Modifications
* Readme Updates

1.1.0
* Convert to Universal Orchestrator Framework
* Added Support for .cer files during inventory
* Added PAM Support

1.0.0
* Windows Orchestrator with Add, Remove and Inventory Capabilities

14 changes: 10 additions & 4 deletions DataPower.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataPower", "DataPower\DataPower.csproj", "{33FBC5A1-3466-4F10-B9A6-7186F804A65A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1A6C93E7-24FD-47FD-883D-EDABF5CEE4C6}"
ProjectSection(SolutionItems) = preProject
CHANGELOG.md = CHANGELOG.md
integration-manifest.json = integration-manifest.json
.github\workflows\keyfactor-extension-release.yml = .github\workflows\keyfactor-extension-release.yml
README.md = README.md
README.md.tpl = README.md.tpl
EndProjectSection
EndProject
Global
Expand All @@ -20,8 +22,12 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Release|Any CPU.Build.0 = Debug|Any CPU
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{33FBC5A1-3466-4F10-B9A6-7186F804A65A}.Release|Any CPU.Build.0 = Release|Any CPU
{FFF21E91-1820-4090-922B-A78D5CC38D7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFF21E91-1820-4090-922B-A78D5CC38D7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFF21E91-1820-4090-922B-A78D5CC38D7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFF21E91-1820-4090-922B-A78D5CC38D7B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 3 additions & 6 deletions DataPower/DataPower.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Keyfactor.Extensions.Orchestrator.DataPower</RootNamespace>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Keyfactor.Logging" Version="1.1.1" />
Expand Down
1 change: 0 additions & 1 deletion DataPower/Jobs/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private JobResult PerformInventory(InventoryJobConfiguration config, SubmitInven
_protocol = ci.Protocol;
_logger.LogTrace(
$"Certificate Config Domain: {ci.Domain} and Certificate Store: {ci.CertificateStore}");
_logger.LogTrace($"Any Job Config {JsonConvert.SerializeObject(config)}");
_logger.LogTrace("Entering IBM DataPower: Certificate Inventory");
_logger.LogTrace(
$"Entering processJob for Domain: {ci.Domain} and Certificate Store: {ci.CertificateStore}");
Expand Down
1 change: 0 additions & 1 deletion DataPower/Jobs/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
try
{
_logger.MethodEntry(LogLevel.Debug);
_logger.LogTrace($"Any Job Config {JsonConvert.SerializeObject(config)}");

var ci = Utility.ParseCertificateConfig(config);
var np = Utility.ParseStoreProperties(config);
Expand Down
8 changes: 4 additions & 4 deletions DataPower/RequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public JobResult AddPubCert(ManagementJobConfiguration addPubConfig, CertStoreIn
//If you have a password then you will get a PFX in return instead of the base64 encoded string
if (!string.IsNullOrEmpty(addPubConfig.JobCertificate?.PrivateKeyPassword))
{
_logger.LogTrace($"Has PFX Password {addPubConfig.JobCertificate?.PrivateKeyPassword}");
_logger.LogTrace($"Has PFX Password");
using var ms = new MemoryStream(certData);
store = new Pkcs12Store(ms, addPubConfig.JobCertificate?.PrivateKeyPassword.ToCharArray());
var storeAlias = store.Aliases.Cast<string>().SingleOrDefault(a => store.IsKeyEntry(a));
Expand Down Expand Up @@ -600,7 +600,7 @@ private JobResult RemoveCertFromDomain(ManagementJobConfiguration removeConfig,
_logger.LogTrace(
$"Entering RemoveCertStore for Domain: {ci.Domain} and Certificate Store: {ci.CertificateStore}");
_logger.LogTrace(
$"Creating API Client Created with user: {ServerUserName} password: {ServerPassword} protocol: {_protocol} ClientMachine: {removeConfig.CertificateStoreDetails.ClientMachine.Trim()} Domain: {ci.Domain}");
$"Creating API Client Created with user: {ServerUserName} protocol: {_protocol} ClientMachine: {removeConfig.CertificateStoreDetails.ClientMachine.Trim()} Domain: {ci.Domain}");
var apiClient = new DataPowerClient(ServerUserName, ServerPassword,
$"{_protocol}://" + removeConfig.CertificateStoreDetails.ClientMachine.Trim(), ci.Domain);
_logger.LogTrace("API Client Created!");
Expand Down Expand Up @@ -792,7 +792,7 @@ private JobResult AddCertStore(ManagementJobConfiguration addConfig, CertStoreIn
_logger.LogTrace(
$"Entering AddCertStore for Domain: {ci.Domain} and Certificate Store: {ci.CertificateStore}");
_logger.LogTrace(
$"Creating API Client Created with user: {ServerUserName} password: {ServerPassword} protocol: {_protocol} ClientMachine: {addConfig.CertificateStoreDetails.ClientMachine.Trim()} Domain: {ci.Domain}");
$"Creating API Client Created with user: {ServerUserName} protocol: {_protocol} ClientMachine: {addConfig.CertificateStoreDetails.ClientMachine.Trim()} Domain: {ci.Domain}");
var apiClient = new DataPowerClient(ServerUserName, ServerPassword,
$"{_protocol}://" + addConfig.CertificateStoreDetails.ClientMachine.Trim(),
ci.Domain);
Expand All @@ -808,7 +808,7 @@ private JobResult AddCertStore(ManagementJobConfiguration addConfig, CertStoreIn
{
if (!string.IsNullOrEmpty(addConfig.JobCertificate.PrivateKeyPassword))
{
_logger.LogTrace($"Has Password: {addConfig.JobCertificate.PrivateKeyPassword}");
_logger.LogTrace($"Has Password");
var certPem = GetCertPem(addConfig, alias, ref privateKeyString);
_logger.LogTrace($"certPem: {certPem}");
var baseAlias = alias.ToLower();
Expand Down
Loading

0 comments on commit 420906a

Please sign in to comment.