mirror of
https://github.com/hanzokms/cli.git
synced 2026-10-30 20:30:00 +00:00
go.mod now references github.com/hanzokms/{[email protected], [email protected], [email protected], turn/[email protected]}; code uses kmsSdk.NewClient/ClientInterface + kmip.KMSBaseAPIURL; keyring reads KMS_VAULT_FILE_PASSPHRASE. Zero Infisical in our source + go.mod. (Private forks need GOPRIVATE=github.com/hanzokms/* to build.)
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package visualize
|
|
|
|
import kmsModels "github.com/hanzokms/go-sdk/packages/models"
|
|
|
|
func PrintAllDyamicSecretLeaseCredentials(leaseCredentials map[string]any) {
|
|
rows := [][]string{}
|
|
for key, value := range leaseCredentials {
|
|
if cred, ok := value.(string); ok {
|
|
rows = append(rows, []string{key, cred})
|
|
}
|
|
}
|
|
|
|
headers := []string{"Key", "Value"}
|
|
|
|
GenericTable(headers, rows)
|
|
}
|
|
|
|
func PrintAllDynamicRootCredentials(dynamicRootCredentials []kmsModels.DynamicSecret) {
|
|
rows := [][]string{}
|
|
for _, el := range dynamicRootCredentials {
|
|
rows = append(rows, []string{el.Name, el.Type, el.DefaultTTL, el.MaxTTL})
|
|
}
|
|
|
|
headers := []string{"Name", "Provider", "Default TTL", "Max TTL"}
|
|
|
|
GenericTable(headers, rows)
|
|
}
|
|
|
|
func PrintAllDynamicSecretLeases(dynamicSecretLeases []kmsModels.DynamicSecretLease) {
|
|
rows := [][]string{}
|
|
const timeformat = "02-Jan-2006 03:04:05 PM"
|
|
for _, el := range dynamicSecretLeases {
|
|
rows = append(rows, []string{el.Id, el.ExpireAt.Local().Format(timeformat), el.CreatedAt.Local().Format(timeformat)})
|
|
}
|
|
|
|
headers := []string{"ID", "Expire At", "Created At"}
|
|
|
|
GenericTable(headers, rows)
|
|
}
|