From e93fe9083b19cab8640fd01d28bd10fc8e670474 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 7 May 2026 17:20:48 +0200 Subject: [PATCH] cli/config/credentials: DetectDefaultStore: update GoDoc Signed-off-by: Sebastiaan van Stijn --- cli/config/credentials/default_store.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/config/credentials/default_store.go b/cli/config/credentials/default_store.go index a36afc41f4f5..35b9ae4f53ea 100644 --- a/cli/config/credentials/default_store.go +++ b/cli/config/credentials/default_store.go @@ -2,12 +2,19 @@ package credentials import "os/exec" -// DetectDefaultStore return the default credentials store for the platform if -// no user-defined store is passed, and the store executable is available. -func DetectDefaultStore(store string) string { - if store != "" { +// DetectDefaultStore returns the credentials store to use if no user-defined +// custom helper is passed. +// +// Some platforms define a preferred helper, in which case it attempts to look +// up the helper binary before falling back to the platform's default. +// +// If no user-defined helper is passed, and no helper is found, it returns an +// empty string, which means credentials are stored unencrypted in the CLI's +// config-file without the use of a credentials store. +func DetectDefaultStore(customStore string) string { + if customStore != "" { // use user-defined - return store + return customStore } platformDefault := defaultCredentialsStore()