Skip to content

updated CSR enrollment to use Keyfactor Client SDK #44

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

Open
wants to merge 6 commits into
base: release-1.4
Choose a base branch
from

Conversation

joevanwanzeeleKF
Copy link
Contributor

  • Updated the Hashicorp SDK libraries
  • Incorporated the Keyfactor GO SDK for authentication and interaction with the Command API

@spbsoluble spbsoluble requested a review from Copilot June 4, 2025 16:20
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 pull request updates the CSR enrollment functionality to use the Keyfactor GO SDK for authentication and interaction with the Command API and updates the Hashicorp SDK libraries. Key changes include removal of legacy revoked-path code, refactoring the certificate issuance and revocation endpoints to use the new Keyfactor API client, and updating documentation and dependency versions.

Reviewed Changes

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

Show a summary per file
File Description
readme_source.md Added clarifying notes regarding certificate and chain retrieval.
path_revoke.go Removed obsolete commented code related to certificate revocation.
path_certs.go Updated API usage, modified callbacks, and replaced custom JSON validation with the standard json.Valid check.
installation.txt Updated connection testing instructions to note CA certificate requirements in the Command database.
go.mod Upgraded Go version and dependency versions for the Keyfactor and Hashicorp SDKs.
fields.go Updated field description to reflect the use of dns_sans for common name alternatives.
cmd/keyfactor/main.go Changed the plugin serving call to use ServeMultiplex and updated error handling accordingly.
client.go Refactored the client initialisation to use the new Keyfactor API client and updated authentication configuration.
backend.go Adjusted client caching and versioning to work with the new Keyfactor API client.
README.md Mirrored readme_source.md updates for CA certificate and chain notes.
CHANGELOG.md Documented the version bump and key changes in the changelog.
Comments suppressed due to low confidence (1)

path_revoke.go:1

  • The file contains only commented-out legacy code; consider removing it entirely if it is no longer needed to improve code maintainability.
/* ... entire file commented out ... */

Comment on lines +532 to +539
b.Logger().Debug(fmt.Sprintf("retreiving the keyfactor ID for cert stored at path: %s", "kfId/"+serial))

kfId, err := req.Storage.Get(ctx, "kfId/"+serial) //retrieve the keyfactor certificate ID, keyed by sn here
if err != nil {
b.Logger().Error("Unable to retreive Keyfactor certificate ID for cert with serial: "+serial, err)
b.Logger().Error("unable to retreive Keyfactor certificate ID for cert with serial: "+serial, err)
return nil, err
}

var keyfactorId int
b.Logger().Debug(fmt.Sprintf("retreived the logical storage entry, decoding..."))
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

Consider correcting the spelling of 'retreiving' to 'retrieving' for clarity.

Copilot uses AI. Check for mistakes.

Comment on lines +532 to +539
b.Logger().Debug(fmt.Sprintf("retreiving the keyfactor ID for cert stored at path: %s", "kfId/"+serial))

kfId, err := req.Storage.Get(ctx, "kfId/"+serial) //retrieve the keyfactor certificate ID, keyed by sn here
if err != nil {
b.Logger().Error("Unable to retreive Keyfactor certificate ID for cert with serial: "+serial, err)
b.Logger().Error("unable to retreive Keyfactor certificate ID for cert with serial: "+serial, err)
return nil, err
}

var keyfactorId int
b.Logger().Debug(fmt.Sprintf("retreived the logical storage entry, decoding..."))
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

Consider correcting the spelling of 'retreive' to 'retrieve' for clarity in error messages.

Copilot uses AI. Check for mistakes.

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.

1 participant