Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove sanitize option from license formatter
  • Loading branch information
kacpersaw committed Jun 24, 2025
commit 6bfa3ffde690c0b9fbd10d53c13779229a8e81ca
12 changes: 1 addition & 11 deletions cli/cliutil/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ import (
"github.com/coder/coder/v2/codersdk"
)

// LicenseFormatterOpts are options for the license formatter.
type LicenseFormatterOpts struct {
Sanitize bool // If true, the UUID of the license will be redacted.
}

// NewLicenseFormatter returns a new license formatter.
// The formatter will return a table and JSON output.
func NewLicenseFormatter(opts LicenseFormatterOpts) *cliui.OutputFormatter {
func NewLicenseFormatter() *cliui.OutputFormatter {
type tableLicense struct {
ID int32 `table:"id,default_sort"`
UUID uuid.UUID `table:"uuid" format:"uuid"`
Expand Down Expand Up @@ -63,11 +58,6 @@ func NewLicenseFormatter(opts LicenseFormatterOpts) *cliui.OutputFormatter {
// If this returns an error, a zero time is returned.
exp, _ := lic.ExpiresAt()

// If sanitize is true, we redact the UUID.
if opts.Sanitize {
lic.UUID = uuid.Nil
}

out = append(out, tableLicense{
ID: lic.ID,
UUID: lic.UUID,
Expand Down
6 changes: 2 additions & 4 deletions cli/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var supportBundleBlurb = cliui.Bold("This will collect the following information
- Agent details (with environment variable sanitized)
- Agent network diagnostics
- Agent logs
- License status (sanitized)
- License status
` + cliui.Bold("Note: ") +
cliui.Wrap("While we try to sanitize sensitive data from support bundles, we cannot guarantee that they do not contain information that you or your organization may consider sensitive.\n") +
cliui.Bold("Please confirm that you will:\n") +
Expand Down Expand Up @@ -371,9 +371,7 @@ func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
}

func humanizeLicenses(licenses []codersdk.License) (string, error) {
formatter := cliutil.NewLicenseFormatter(cliutil.LicenseFormatterOpts{
Sanitize: true,
})
formatter := cliutil.NewLicenseFormatter()

if len(licenses) == 0 {
return "No licenses found", nil
Expand Down
2 changes: 1 addition & 1 deletion enterprise/cli/licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func validJWT(s string) error {
}

func (r *RootCmd) licensesList() *serpent.Command {
formatter := cliutil.NewLicenseFormatter(cliutil.LicenseFormatterOpts{})
formatter := cliutil.NewLicenseFormatter()
client := new(codersdk.Client)
cmd := &serpent.Command{
Use: "list",
Expand Down
Loading