MCPcopy Create free account
hub / github.com/compozy/agh / providerAuthStatusRows

Function providerAuthStatusRows

internal/cli/provider.go:718–753  ·  view source on GitHub ↗
(record providerAuthStatusRecord)

Source from the content-addressed store, hash-verified

716}
717
718func providerAuthStatusRows(record providerAuthStatusRecord) []keyValue {
719 rows := []keyValue{
720 {Label: providerProviderValue, Value: stringOrDash(record.Provider)},
721 {Label: "Display Name", Value: stringOrDash(record.DisplayName)},
722 {Label: providerAuthModeValue, Value: stringOrDash(record.AuthMode)},
723 {Label: "Env Policy", Value: stringOrDash(record.EnvPolicy)},
724 {Label: "Home Policy", Value: stringOrDash(record.HomePolicy)},
725 {Label: providerStateValue, Value: stringOrDash(record.State)},
726 {Label: cliCodeValue, Value: stringOrDash(record.Code)},
727 {Label: providerMessageValue, Value: stringOrDash(record.Message)},
728 {Label: "Status Command", Value: stringOrDash(record.StatusCommand)},
729 {Label: "Login Command", Value: stringOrDash(record.LoginCommand)},
730 }
731 if len(record.LoginEnv) > 0 {
732 rows = append(rows, keyValue{Label: "Login Env", Value: strings.Join(record.LoginEnv, " ")})
733 }
734 if record.NativeCLI != nil {
735 rows = append(rows,
736 keyValue{Label: "Native CLI Command", Value: stringOrDash(record.NativeCLI.Command)},
737 keyValue{Label: "Native CLI Present", Value: boolString(record.NativeCLI.Present)},
738 keyValue{Label: "Native CLI Path", Value: stringOrDash(record.NativeCLI.Path)},
739 keyValue{Label: "Native CLI Source", Value: stringOrDash(record.NativeCLI.Source)},
740 )
741 if record.NativeCLI.Error != "" {
742 rows = append(rows, keyValue{Label: "Native CLI Error", Value: record.NativeCLI.Error})
743 }
744 }
745 if record.Probe != nil {
746 rows = append(rows,
747 keyValue{Label: "Probe Exit Code", Value: fmt.Sprintf("%d", record.Probe.ExitCode)},
748 keyValue{Label: "Probe Stdout", Value: stringOrDash(strings.TrimSpace(record.Probe.Stdout))},
749 keyValue{Label: "Probe Stderr", Value: stringOrDash(strings.TrimSpace(record.Probe.Stderr))},
750 )
751 }
752 return rows
753}
754
755func providerCredentialStatusRows(statuses []providerCredentialStatusItem) [][]string {
756 rows := make([][]string, 0, len(statuses))

Callers 1

providerAuthStatusBundleFunction · 0.85

Calls 3

stringOrDashFunction · 0.85
appendFunction · 0.85
boolStringFunction · 0.70

Tested by

no test coverage detected