Skip to content

Dev 1.2 #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2025
Merged

Dev 1.2 #40

merged 2 commits into from
Jul 14, 2025

Conversation

dgaley
Copy link
Contributor

@dgaley dgaley commented Jun 23, 2025

No description provided.

@spbsoluble spbsoluble requested a review from Copilot July 7, 2025 20:43
Copy link

@Copilot 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 updates the certificate revocation flow to include a numeric revocation code parameter and aligns the proxy and client implementations with the new Sectigo API format.

  • Added revcode argument to the client and proxy layers
  • Extended RevokeReasonToString to handle code 0 and throw on invalid values
  • Updated CHANGELOG to 1.2.2 with revocation API change note

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/SectigoCAProxy/SectigoCAProxy.cs Pass new revocationReason code to API call and revise string mapping logic
src/SectigoCAProxy/Client/SectigoApiClient.cs Add revcode parameter and include it in JSON payload
CHANGELOG.md Bump version to 1.2.2 and note the API call change
Comments suppressed due to low confidence (2)

CHANGELOG.md:26

  • [nitpick] The changelog header format differs from existing entries and lacks a date. Consider using a consistent header style (e.g., ## [1.2.2] - YYYY-MM-DD) to match the project’s convention.
# 1.2.2  

src/SectigoCAProxy/Client/SectigoApiClient.cs:142

  • The method signature now includes revcode but existing XML comments or summaries may be outdated. Update the method documentation to describe the new parameter.
		public async Task<bool> RevokeSslCertificateById(int sslId, int revcode, string revreason)

@@ -569,7 +569,7 @@ public override int Revoke(string caRequestID, string hexSerialNumber, uint revo
{
Logger.MethodEntry(ILogExtensions.MethodLogLevel.Debug);

var response = Task.Run(async () => await Client.RevokeSslCertificateById(int.Parse(caRequestID), RevokeReasonToString(revocationReason))).Result;
var response = Task.Run(async () => await Client.RevokeSslCertificateById(int.Parse(caRequestID), (int)revocationReason, RevokeReasonToString(revocationReason))).Result;
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Blocking on an async Task with .Result inside Task.Run can lead to deadlocks. Consider making Revoke async and using await, or use GetAwaiter().GetResult() if synchronous behavior is required.

Copilot uses AI. Check for mistakes.

Comment on lines 779 to 781
default:
return "Unspecified";
throw new Exception($"Invalid revocation code: {revokeType.ToString()}. Valid values are 0,1,3-5");
}
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Throwing a generic Exception makes it harder for callers to handle specific errors. Use ArgumentOutOfRangeException (or a custom exception) to clearly indicate an invalid code.

Copilot uses AI. Check for mistakes.

default:
return "Unspecified";
throw new Exception($"Invalid revocation code: {revokeType.ToString()}. Valid values are 0,1,3-5");
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Hard-coding the list of valid codes means it must be kept in sync with switch cases. Consider deriving valid values programmatically or centralizing the list to avoid drift.

Copilot uses AI. Check for mistakes.

@doebrowsk doebrowsk merged commit c8ad505 into release-1.2 Jul 14, 2025
28 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