Skip to content

Commit 6bfa3ff

Browse files
committed
Remove sanitize option from license formatter
1 parent 2951c2d commit 6bfa3ff

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

cli/cliutil/license.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@ import (
1212
"github.com/coder/coder/v2/codersdk"
1313
)
1414

15-
// LicenseFormatterOpts are options for the license formatter.
16-
type LicenseFormatterOpts struct {
17-
Sanitize bool // If true, the UUID of the license will be redacted.
18-
}
19-
2015
// NewLicenseFormatter returns a new license formatter.
2116
// The formatter will return a table and JSON output.
22-
func NewLicenseFormatter(opts LicenseFormatterOpts) *cliui.OutputFormatter {
17+
func NewLicenseFormatter() *cliui.OutputFormatter {
2318
type tableLicense struct {
2419
ID int32 `table:"id,default_sort"`
2520
UUID uuid.UUID `table:"uuid" format:"uuid"`
@@ -63,11 +58,6 @@ func NewLicenseFormatter(opts LicenseFormatterOpts) *cliui.OutputFormatter {
6358
// If this returns an error, a zero time is returned.
6459
exp, _ := lic.ExpiresAt()
6560

66-
// If sanitize is true, we redact the UUID.
67-
if opts.Sanitize {
68-
lic.UUID = uuid.Nil
69-
}
70-
7161
out = append(out, tableLicense{
7262
ID: lic.ID,
7363
UUID: lic.UUID,

cli/support.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var supportBundleBlurb = cliui.Bold("This will collect the following information
5151
- Agent details (with environment variable sanitized)
5252
- Agent network diagnostics
5353
- Agent logs
54-
- License status (sanitized)
54+
- License status
5555
` + cliui.Bold("Note: ") +
5656
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") +
5757
cliui.Bold("Please confirm that you will:\n") +
@@ -371,9 +371,7 @@ func humanizeBuildLogs(ls []codersdk.ProvisionerJobLog) string {
371371
}
372372

373373
func humanizeLicenses(licenses []codersdk.License) (string, error) {
374-
formatter := cliutil.NewLicenseFormatter(cliutil.LicenseFormatterOpts{
375-
Sanitize: true,
376-
})
374+
formatter := cliutil.NewLicenseFormatter()
377375

378376
if len(licenses) == 0 {
379377
return "No licenses found", nil

enterprise/cli/licenses.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func validJWT(s string) error {
136136
}
137137

138138
func (r *RootCmd) licensesList() *serpent.Command {
139-
formatter := cliutil.NewLicenseFormatter(cliutil.LicenseFormatterOpts{})
139+
formatter := cliutil.NewLicenseFormatter()
140140
client := new(codersdk.Client)
141141
cmd := &serpent.Command{
142142
Use: "list",

0 commit comments

Comments
 (0)