From adaa335ed6611889a6af215dd864dfd251792b59 Mon Sep 17 00:00:00 2001 From: David Galey Date: Fri, 7 Apr 2023 08:56:11 -0400 Subject: [PATCH 1/7] Properly log JSON request body objects --- CHANGELOG.md | 28 ++- GoDaddy.sln | 4 +- GoDaddy/API/APIProcessor.cs | 406 +++++++++++++++++++----------------- 3 files changed, 228 insertions(+), 210 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d38975..95f7897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,21 @@ -v1.0.4/1.0.5 -- Update nuget packages +v1.0.0: +- Original Version -v1.0.3 -- Code cleanup, publish to github. +v1.0.1 +- Added support for 5 OV and 2 EV GoDaddy products +- Added Renew/Reissue functionality -v1.0.2 -- Remove PEM header before returning certificates during sync and enrollment +v1.0.2 +- Remove PEM header before returning certificates during sync and enrollment -v1.0.1 -- Added support for 5 OV and 2 EV GoDaddy products -- Added Renew/Reissue functionality +v1.0.3 +- Code cleanup, publish to github. -v1.0.0: -- Original Version +v1.0.4/1.0.5 +- Update nuget packages + +v1.0.6 +- Code cleanup + +v1.0.7 +- Improved logging \ No newline at end of file diff --git a/GoDaddy.sln b/GoDaddy.sln index cf6ff0c..5a48d55 100644 --- a/GoDaddy.sln +++ b/GoDaddy.sln @@ -8,11 +8,11 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5D9941D2-A44F-4593-A33E-F5E0C861CAEB}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore - CHANGELOG.MD = CHANGELOG.MD + CHANGELOG.md = CHANGELOG.md GoDaddy.sln.licenseheader = GoDaddy.sln.licenseheader integration-manifest.json = integration-manifest.json README.md = README.md - README.md.tpl = README.md.tpl + readme_source.md = readme_source.md EndProjectSection EndProject Global diff --git a/GoDaddy/API/APIProcessor.cs b/GoDaddy/API/APIProcessor.cs index 1258212..d228679 100644 --- a/GoDaddy/API/APIProcessor.cs +++ b/GoDaddy/API/APIProcessor.cs @@ -1,11 +1,11 @@ // Copyright 2021 Keyfactor -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,234 +21,246 @@ namespace Keyfactor.AnyGateway.GoDaddy.API { - class APIProcessor : LoggingClientBase - { - private string ApiUrl { get; set; } - private string ApiKey { get; set; } - private string ShopperId { get; set; } + internal class APIProcessor : LoggingClientBase + { + private string ApiUrl { get; set; } + private string ApiKey { get; set; } + private string ShopperId { get; set; } + public APIProcessor(string apiUrl, string apiKey, string shopperId) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - public APIProcessor(string apiUrl, string apiKey, string shopperId) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + ApiUrl = apiUrl; + ApiKey = apiKey; + ShopperId = shopperId; - ApiUrl = apiUrl; - ApiKey = apiKey; - ShopperId = shopperId; + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + } - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - } + public string EnrollCSR(string csr, POSTCertificateRequest requestBody) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - public string EnrollCSR(string csr, POSTCertificateRequest requestBody) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - - string rtnMessage = string.Empty; + string rtnMessage = string.Empty; - string RESOURCE = "v1/certificates"; - RestRequest request = new RestRequest(RESOURCE, Method.POST); + string RESOURCE = "v1/certificates"; + RestRequest request = new RestRequest(RESOURCE, Method.POST); - request.AddJsonBody(requestBody); + request.AddJsonBody(requestBody); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - return SubmitRequest(request); - } + Logger.Trace($"Json Request Body: {JsonConvert.SerializeObject(requestBody)}"); - public string RenewReissueCSR(string certificateId, string csr, POSTCertificateRenewalRequest requestBody, bool isRenew) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + return SubmitRequest(request); + } - string rtnMessage = string.Empty; - string endpoint = isRenew ? "renew" : "reissue"; + public string RenewReissueCSR(string certificateId, string csr, POSTCertificateRenewalRequest requestBody, bool isRenew) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - string RESOURCE = $"v1/certificates/{certificateId}/{endpoint}"; - RestRequest request = new RestRequest(RESOURCE, Method.POST); + string rtnMessage = string.Empty; + string endpoint = isRenew ? "renew" : "reissue"; - request.AddJsonBody(requestBody); + string RESOURCE = $"v1/certificates/{certificateId}/{endpoint}"; + RestRequest request = new RestRequest(RESOURCE, Method.POST); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + request.AddJsonBody(requestBody); - return SubmitRequest(request); - } + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - public string GetCertificates(string customerId, int pageNumber, int pageSize) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + Logger.Trace($"Json Request Body: {JsonConvert.SerializeObject(requestBody)}"); - string rtnMessage = string.Empty; + return SubmitRequest(request); + } - string RESOURCE = $"v2/customers/{customerId}/certificates?offset={pageNumber.ToString()}&limit={pageSize.ToString()}"; - RestRequest request = new RestRequest(RESOURCE, Method.GET); + public string GetCertificates(string customerId, int pageNumber, int pageSize) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + string rtnMessage = string.Empty; - return SubmitRequest(request); - } + string RESOURCE = $"v2/customers/{customerId}/certificates?offset={pageNumber.ToString()}&limit={pageSize.ToString()}"; + RestRequest request = new RestRequest(RESOURCE, Method.GET); - public string GetCertificate(string certificateId) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - string rtnMessage = string.Empty; + return SubmitRequest(request); + } - string RESOURCE = $"v1/certificates/{certificateId}"; - RestRequest request = new RestRequest(RESOURCE, Method.GET); + public string GetCertificate(string certificateId) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + string rtnMessage = string.Empty; - return SubmitRequest(request); - } + string RESOURCE = $"v1/certificates/{certificateId}"; + RestRequest request = new RestRequest(RESOURCE, Method.GET); - public string DownloadCertificate(string certificateId) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - string rtnMessage = string.Empty; + return SubmitRequest(request); + } - string RESOURCE = $"v1/certificates/{certificateId}/download"; - RestRequest request = new RestRequest(RESOURCE, Method.GET); + public string DownloadCertificate(string certificateId) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + string rtnMessage = string.Empty; - return SubmitRequest(request); - } - - public void RevokeCertificate(string certificateId, POSTCertificateRevokeRequest.REASON reason) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + string RESOURCE = $"v1/certificates/{certificateId}/download"; + RestRequest request = new RestRequest(RESOURCE, Method.GET); - string rtnMessage = string.Empty; + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - string RESOURCE = $"v1/certificates/{certificateId}/revoke"; - RestRequest request = new RestRequest(RESOURCE, Method.POST); + return SubmitRequest(request); + } - POSTCertificateRevokeRequest body = new POSTCertificateRevokeRequest(); - body.reason = reason.ToString(); + public void RevokeCertificate(string certificateId, POSTCertificateRevokeRequest.REASON reason) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - request.AddJsonBody(body); - SubmitRequest(request); + string rtnMessage = string.Empty; - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - } + string RESOURCE = $"v1/certificates/{certificateId}/revoke"; + RestRequest request = new RestRequest(RESOURCE, Method.POST); - public string GetCustomerId() - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + POSTCertificateRevokeRequest body = new POSTCertificateRevokeRequest(); + body.reason = reason.ToString(); - string rtnMessage = string.Empty; - - string RESOURCE = $"v1/shoppers/{ShopperId}?includes=customerId"; - RestRequest request = new RestRequest(RESOURCE, Method.GET); - - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - - return SubmitRequest(request); - } - - public static int MapReturnStatus(CertificateStatusEnum status) - { - PKIConstants.Microsoft.RequestDisposition returnStatus = PKIConstants.Microsoft.RequestDisposition.UNKNOWN; - - switch (status) - { - case CertificateStatusEnum.DENIED: - returnStatus = PKIConstants.Microsoft.RequestDisposition.DENIED; - break; - case CertificateStatusEnum.EXPIRED: - case CertificateStatusEnum.CURRENT: - case CertificateStatusEnum.ISSUED: - returnStatus = PKIConstants.Microsoft.RequestDisposition.ISSUED; - break; - case CertificateStatusEnum.PENDING_ISSUANCE: - returnStatus = PKIConstants.Microsoft.RequestDisposition.EXTERNAL_VALIDATION; - break; - case CertificateStatusEnum.REVOKED: - returnStatus = PKIConstants.Microsoft.RequestDisposition.REVOKED; - break; - default: - returnStatus = PKIConstants.Microsoft.RequestDisposition.FAILED; - break; - } - - return Convert.ToInt32(returnStatus); - } - - public static POSTCertificateRevokeRequest.REASON MapRevokeReason(uint reason) - { - POSTCertificateRevokeRequest.REASON returnReason = POSTCertificateRevokeRequest.REASON.PRIVILEGE_WITHDRAWN; - - switch (reason) - { - case 1: - returnReason = POSTCertificateRevokeRequest.REASON.KEY_COMPROMISE; - break; - case 3: - returnReason = POSTCertificateRevokeRequest.REASON.AFFILIATION_CHANGED; - break; - case 4: - returnReason = POSTCertificateRevokeRequest.REASON.SUPERSEDED; - break; - case 5: - returnReason = POSTCertificateRevokeRequest.REASON.CESSATION_OF_OPERATION; - break; - } - - return returnReason; - } - - - #region Private Methods - private string SubmitRequest(RestRequest request) - { - Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); - Logger.Trace($"Request Resource: {request.Resource}"); - Logger.Trace($"Request Method: {request.Method.ToString()}"); - Logger.Trace($"Request Body: {(request.Body == null ? string.Empty : request.Body.Value.ToString())}"); - - IRestResponse response; - - RestClient client = new RestClient(ApiUrl); - request.AddHeader("Authorization", ApiKey); - - try - { - response = client.Execute(request); - } - catch (Exception ex) - { - string exceptionMessage = GoDaddyException.FlattenExceptionMessages(ex, $"Error processing {request.Resource}"); - Logger.Error(exceptionMessage); - throw new GoDaddyException(exceptionMessage); - } - - if (response.StatusCode != System.Net.HttpStatusCode.OK && - response.StatusCode != System.Net.HttpStatusCode.Accepted && - response.StatusCode != System.Net.HttpStatusCode.Created && - response.StatusCode != System.Net.HttpStatusCode.NoContent) - { - string errorMessage; - - try - { - APIError error = JsonConvert.DeserializeObject(response.Content); - errorMessage = $"{error.code}: {error.message}"; - } - catch (JsonReaderException ex) - { - errorMessage = response.Content; - } - - string exceptionMessage = $"Error processing {request.Resource}: {errorMessage}"; - Logger.Error(exceptionMessage); - throw new GoDaddyException(exceptionMessage); - } - - Logger.Trace($"API Result: {response.Content}"); - Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); - - return response.Content; - } - #endregion - } -} + request.AddJsonBody(body); + + Logger.Trace($"Json Request Body: {JsonConvert.SerializeObject(body)}"); + SubmitRequest(request); + + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + } + + public string GetCustomerId() + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + + string rtnMessage = string.Empty; + + string RESOURCE = $"v1/shoppers/{ShopperId}?includes=customerId"; + RestRequest request = new RestRequest(RESOURCE, Method.GET); + + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + + return SubmitRequest(request); + } + + public static int MapReturnStatus(CertificateStatusEnum status) + { + PKIConstants.Microsoft.RequestDisposition returnStatus = PKIConstants.Microsoft.RequestDisposition.UNKNOWN; + + switch (status) + { + case CertificateStatusEnum.DENIED: + returnStatus = PKIConstants.Microsoft.RequestDisposition.DENIED; + break; + + case CertificateStatusEnum.EXPIRED: + case CertificateStatusEnum.CURRENT: + case CertificateStatusEnum.ISSUED: + returnStatus = PKIConstants.Microsoft.RequestDisposition.ISSUED; + break; + + case CertificateStatusEnum.PENDING_ISSUANCE: + returnStatus = PKIConstants.Microsoft.RequestDisposition.EXTERNAL_VALIDATION; + break; + + case CertificateStatusEnum.REVOKED: + returnStatus = PKIConstants.Microsoft.RequestDisposition.REVOKED; + break; + + default: + returnStatus = PKIConstants.Microsoft.RequestDisposition.FAILED; + break; + } + + return Convert.ToInt32(returnStatus); + } + + public static POSTCertificateRevokeRequest.REASON MapRevokeReason(uint reason) + { + POSTCertificateRevokeRequest.REASON returnReason = POSTCertificateRevokeRequest.REASON.PRIVILEGE_WITHDRAWN; + + switch (reason) + { + case 1: + returnReason = POSTCertificateRevokeRequest.REASON.KEY_COMPROMISE; + break; + + case 3: + returnReason = POSTCertificateRevokeRequest.REASON.AFFILIATION_CHANGED; + break; + + case 4: + returnReason = POSTCertificateRevokeRequest.REASON.SUPERSEDED; + break; + + case 5: + returnReason = POSTCertificateRevokeRequest.REASON.CESSATION_OF_OPERATION; + break; + } + + return returnReason; + } + + #region Private Methods + + private string SubmitRequest(RestRequest request) + { + Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); + Logger.Trace($"Request Resource: {request.Resource}"); + Logger.Trace($"Request Method: {request.Method.ToString()}"); + + IRestResponse response; + + RestClient client = new RestClient(ApiUrl); + request.AddHeader("Authorization", ApiKey); + + try + { + response = client.Execute(request); + } + catch (Exception ex) + { + string exceptionMessage = GoDaddyException.FlattenExceptionMessages(ex, $"Error processing {request.Resource}"); + Logger.Error(exceptionMessage); + throw new GoDaddyException(exceptionMessage); + } + + if (response.StatusCode != System.Net.HttpStatusCode.OK && + response.StatusCode != System.Net.HttpStatusCode.Accepted && + response.StatusCode != System.Net.HttpStatusCode.Created && + response.StatusCode != System.Net.HttpStatusCode.NoContent) + { + string errorMessage; + + try + { + APIError error = JsonConvert.DeserializeObject(response.Content); + errorMessage = $"{error.code}: {error.message}"; + } + catch (JsonReaderException ex) + { + errorMessage = response.Content; + } + + string exceptionMessage = $"Error processing {request.Resource}: {errorMessage}"; + Logger.Error(exceptionMessage); + throw new GoDaddyException(exceptionMessage); + } + + Logger.Trace($"API Result: {response.Content}"); + Logger.MethodExit(ILogExtensions.MethodLogLevel.Debug); + + return response.Content; + } + + #endregion Private Methods + } +} \ No newline at end of file From 5d8ce0e0ff4c9a535086dfa05b76c2c5f8f7bbfc Mon Sep 17 00:00:00 2001 From: kfadmin Date: Fri, 7 Apr 2023 17:17:32 +0000 Subject: [PATCH 2/7] changes --- GoDaddy/API/APIProcessor.cs | 9 +++++++-- readme_source.md | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GoDaddy/API/APIProcessor.cs b/GoDaddy/API/APIProcessor.cs index d228679..f1b5d3a 100644 --- a/GoDaddy/API/APIProcessor.cs +++ b/GoDaddy/API/APIProcessor.cs @@ -27,7 +27,12 @@ internal class APIProcessor : LoggingClientBase private string ApiKey { get; set; } private string ShopperId { get; set; } - public APIProcessor(string apiUrl, string apiKey, string shopperId) + + private const string NO_CERTS_PURCHASED_MESSAGE = "Failed to create certificate order"; + private const string NO_CERTS_PURCHASED_REPL_MESSAGE = "Failed to create certificate order. This error often occurs if there are no certificates purchased to fulfill this enrollment request. " + + "Please check your GoDaddy account to make sure you have the correct SSL certificate product purchased to cover this enrollment."; + + public APIProcessor(string apiUrl, string apiKey, string shopperId) { Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug); @@ -228,7 +233,7 @@ private string SubmitRequest(RestRequest request) } catch (Exception ex) { - string exceptionMessage = GoDaddyException.FlattenExceptionMessages(ex, $"Error processing {request.Resource}"); + string exceptionMessage = GoDaddyException.FlattenExceptionMessages(ex, $"Error processing {request.Resource}").Replace(NO_CERTS_PURCHASED_MESSAGE, NO_CERTS_PURCHASED_REPL_MESSAGE); Logger.Error(exceptionMessage); throw new GoDaddyException(exceptionMessage); } diff --git a/readme_source.md b/readme_source.md index de9e089..a532f39 100644 --- a/readme_source.md +++ b/readme_source.md @@ -28,6 +28,8 @@ To begin, you must have the AnyGateway Service installed and operational before A production GoDaddy account must be set up that will be associated with the gateway and an API Key/Secret created. For more information on how to create an API Key, follow the instructions [here](https://developer.godaddy.com/keys). +For enrollment, make sure you have pre-purchased enough certificates of the type you will be enrolling before attempting to enroll certificates via this gateway. The gateway itself does not purchase certificates and requires that the product (certificate) be pre-purchased for the gateway to enroll it successfully. + ### Installation and Configuration ##### Step 1 - Install the GoDaddy root and intermediate certificates. From 2df9e8a37c15388840afbd17806a8955b7d5e4b9 Mon Sep 17 00:00:00 2001 From: kfadmin Date: Fri, 7 Apr 2023 17:23:45 +0000 Subject: [PATCH 3/7] changes --- readme_source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme_source.md b/readme_source.md index a532f39..92165f8 100644 --- a/readme_source.md +++ b/readme_source.md @@ -28,7 +28,7 @@ To begin, you must have the AnyGateway Service installed and operational before A production GoDaddy account must be set up that will be associated with the gateway and an API Key/Secret created. For more information on how to create an API Key, follow the instructions [here](https://developer.godaddy.com/keys). -For enrollment, make sure you have pre-purchased enough certificates of the type you will be enrolling before attempting to enroll certificates via this gateway. The gateway itself does not purchase certificates and requires that the product (certificate) be pre-purchased for the gateway to enroll it successfully. +For enrollment, make sure you have pre-purchased enough certificates of the type you will be enrolling before attempting to enroll certificates via this gateway. The gateway itself does not purchase certificates and requires that the product (certificate) be pre-purchased for the gateway to enroll it successfully. The certificate may be purchased using any payment method including but not limited to GoDaddy's Good as Gold or in store credits, but just having these funds available is not enough. The product MUST actually be pre-purchased using an available payment method. ### Installation and Configuration From 5cb4a59fe4fbb7f1999864d5517121d717dcef80 Mon Sep 17 00:00:00 2001 From: Dave Galey <89407235+dgaley@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:31:30 -0400 Subject: [PATCH 4/7] Delete keyfactor-starter-workflow.yml --- .../workflows/keyfactor-starter-workflow.yml | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/keyfactor-starter-workflow.yml diff --git a/.github/workflows/keyfactor-starter-workflow.yml b/.github/workflows/keyfactor-starter-workflow.yml deleted file mode 100644 index b80ec25..0000000 --- a/.github/workflows/keyfactor-starter-workflow.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Starter Workflow -on: [workflow_dispatch, push, pull_request] - -jobs: - call-create-github-release-workflow: - uses: Keyfactor/actions/.github/workflows/github-release.yml@main - - 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: GoDaddy/bin/Release # TODO: set build output directory to upload as a release, relative to checkout workspace - secrets: - token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }} - - call-generate-readme-workflow: - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main - - call-update-catalog-workflow: - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main - secrets: - token: ${{ secrets.SDK_SYNC_PAT }} From 2b8a355a1cfa33e3e087c19916ddbcff1206f26e Mon Sep 17 00:00:00 2001 From: Dave Galey <89407235+dgaley@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:31:47 -0400 Subject: [PATCH 5/7] Create keyfactor-starter-workflow.yml --- .../workflows/keyfactor-starter-workflow.yml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/keyfactor-starter-workflow.yml diff --git a/.github/workflows/keyfactor-starter-workflow.yml b/.github/workflows/keyfactor-starter-workflow.yml new file mode 100644 index 0000000..47be3a3 --- /dev/null +++ b/.github/workflows/keyfactor-starter-workflow.yml @@ -0,0 +1,42 @@ +name: Starter Workflow +on: [workflow_dispatch, push, pull_request] + +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: GoDaddy/bin/Release + secrets: + token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }} + + call-generate-readme-workflow: + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main + 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 }} From c0a81d14dc0448ef0115c2b8b0cced2388b86f7c Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Fri, 7 Apr 2023 17:32:23 +0000 Subject: [PATCH 6/7] Update generated README --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 2d07c7d..5c55f7f 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,10 @@ GoDaddy is a domain registrar, web hosting company, and most relevant here, a pu This repository contains an AnyGateway CA Connector, which is a plugin to the Keyfactor AnyGateway. AnyGateway CA Connectors allow Keyfactor Command to be used for inventory, issuance, and revocation of certificates from a third-party certificate authority. ---- ---- - *** # GoDaddy Supported Certificate Types From b53e9bb2c785e27001fad47e593eee14b758ed4b Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Fri, 7 Apr 2023 17:36:24 +0000 Subject: [PATCH 7/7] Update generated README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5c55f7f..94a9daf 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ To begin, you must have the AnyGateway Service installed and operational before A production GoDaddy account must be set up that will be associated with the gateway and an API Key/Secret created. For more information on how to create an API Key, follow the instructions [here](https://developer.godaddy.com/keys). +For enrollment, make sure you have pre-purchased enough certificates of the type you will be enrolling before attempting to enroll certificates via this gateway. The gateway itself does not purchase certificates and requires that the product (certificate) be pre-purchased for the gateway to enroll it successfully. The certificate may be purchased using any payment method including but not limited to GoDaddy's Good as Gold or in store credits, but just having these funds available is not enough. The product MUST actually be pre-purchased using an available payment method. + ### Installation and Configuration ##### Step 1 - Install the GoDaddy root and intermediate certificates.