From c371b882c9b67c5a4df2df521aede2b42213c8e7 Mon Sep 17 00:00:00 2001 From: Keyfactor Date: Wed, 7 Feb 2024 20:39:10 +0000 Subject: [PATCH] fix(pam-types): `types-list` does not crash on nil httpResponse. Signed-off-by: sbailey <1661003+spbsoluble@users.noreply.github.com> --- README.md | 8 ++++++++ cmd/pam.go | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0adeb9f..84c9bc3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ + # Keyfactor Command Utility (kfutil) `kfutil` is a go-lang CLI wrapper for Keyfactor Command API. It also includes other utility/helper functions around automating common Keyfactor Command operations. #### Integration status: Production - Ready for use in production environments. +## About the Keyfactor API Client +This API client allows for programmatic management of Keyfactor resources. ## Support for Keyfactor Command Utility (kfutil) @@ -12,6 +15,11 @@ Keyfactor Command Utility (kfutil) is open source and supported on best effort l ###### 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. +--- + + +--- + ## Quickstart diff --git a/cmd/pam.go b/cmd/pam.go index cd89467..cddc1f2 100644 --- a/cmd/pam.go +++ b/cmd/pam.go @@ -69,8 +69,14 @@ var pamTypesListCmd = &cobra.Command{ log.Trace().Interface("httpResponse", httpResponse). Msg("PAMProviderGetPamProviderTypes") if err != nil { + var status string + if httpResponse != nil { + status = httpResponse.Status + } else { + status = "No HTTP response received from Keyfactor Command." + } log.Error().Err(err). - Str("httpResponseCode", httpResponse.Status). + Str("httpResponseCode", status). Msg("error listing PAM provider types") return err }