Skip to content

Commit

Permalink
remove user identifiable values (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist authored May 18, 2022
1 parent 0867181 commit 129f818
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 26 deletions.
13 changes: 6 additions & 7 deletions pkg/commands/compute/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,11 @@ func manageNoServiceIDFlow(
//
// NOTE: If the creation of the service fails because the user has not
// activated a free trial, then we'll trigger the trial for their account.
func createService(name string, apiClient api.Interface, activateTrial activator, progress text.Progress, errLog fsterr.LogInterface) (serviceID string, serviceVersion *fastly.Version, err error) {
func createService(pkgName string, apiClient api.Interface, activateTrial activator, progress text.Progress, errLog fsterr.LogInterface) (serviceID string, serviceVersion *fastly.Version, err error) {
progress.Step("Creating service...")

service, err := apiClient.CreateService(&fastly.CreateServiceInput{
Name: name,
Name: pkgName,
Type: "wasm",
})
if err != nil {
Expand All @@ -636,15 +636,14 @@ func createService(name string, apiClient api.Interface, activateTrial activator
}

errLog.AddWithContext(err, map[string]interface{}{
"Name": name,
"User": user.Name,
"Customer ID": user.CustomerID,
"Package Name": pkgName,
"Customer ID": user.CustomerID,
})
return createService(name, apiClient, activateTrial, progress, errLog)
return createService(pkgName, apiClient, activateTrial, progress, errLog)
}

errLog.AddWithContext(err, map[string]interface{}{
"Name": name,
"Package Name": pkgName,
})
return serviceID, serviceVersion, fmt.Errorf("error creating service: %w", err)
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/commands/compute/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,8 @@ func (c *InitCommand) Exec(in io.Reader, out io.Writer) (err error) {
name, desc, authors, err := promptOrReturn(c.manifest, c.dir, email, in, out)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"Authors": authors,
"Description": desc,
"Directory": c.dir,
"Email": email,
"Name": name,
})
return err
}
Expand Down Expand Up @@ -189,9 +186,7 @@ func (c *InitCommand) Exec(in io.Reader, out io.Writer) (err error) {
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"Directory": c.dir,
"Name": name,
"Description": desc,
"Authors": authors,
"Language": language,
})
return err
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/service/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func (c *CreateCommand) Exec(in io.Reader, out io.Writer) error {
s, err := c.Globals.APIClient.CreateService(&c.Input)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"Name": c.Input.Name,
"Type": c.Input.Type,
"Comment": c.Input.Comment,
"Service Name": c.Input.Name,
"Type": c.Input.Type,
"Comment": c.Input.Comment,
})
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/service/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *SearchCommand) Exec(in io.Reader, out io.Writer) error {
service, err := c.Globals.APIClient.SearchService(&c.Input)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"Name": c.Input.Name,
"Service Name": c.Input.Name,
})
return err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/service/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {
s, err := c.Globals.APIClient.UpdateService(&c.input)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"Service ID": serviceID,
"Name": c.name.Value,
"Comment": c.comment.Value,
"Service ID": serviceID,
"Service Name": c.name.Value,
"Comment": c.comment.Value,
})
return err
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/commands/user/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {

err = c.Globals.APIClient.ResetUserPassword(input)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"User Login": c.login,
})
return err
}

Expand All @@ -73,7 +70,6 @@ func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"User ID": c.id,
"Input": input,
})
return err
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/commands/whoami/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ func (c *RootCommand) Exec(in io.Reader, out io.Writer) error {
fullurl := fmt.Sprintf("%s/verify", strings.TrimSuffix(endpoint, "/"))
req, err := http.NewRequest("GET", fullurl, nil)
if err != nil {
c.Globals.ErrLog.AddWithContext(err, map[string]interface{}{
"GET": fullurl,
})
return fmt.Errorf("error constructing API request: %w", err)
}

Expand Down

0 comments on commit 129f818

Please sign in to comment.