mirror of https://github.com/coder/coder.git
remove username/password from json output
This commit is contained in:
parent
6f51a5497b
commit
5fec06303a
|
@ -67,7 +67,17 @@ func (r *RootCmd) externalAuthLink() *serpent.Command {
|
|||
}
|
||||
return []agentsdk.ExternalAuthResponse{auth}, nil
|
||||
}),
|
||||
cliui.JSONFormat(),
|
||||
cliui.ChangeFormatterData(cliui.JSONFormat(), func(data any) (any, error) {
|
||||
auth, ok := data.(agentsdk.ExternalAuthResponse)
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("expected data to be of type codersdk.ExternalAuth, got %T", data)
|
||||
}
|
||||
|
||||
// Deprecated fields, omit them from any output.
|
||||
auth.Username = ""
|
||||
auth.Password = ""
|
||||
return auth, nil
|
||||
}),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -569,8 +569,8 @@ type ExternalAuthResponse struct {
|
|||
|
||||
// Deprecated: Only supported on `/workspaceagents/me/gitauth`
|
||||
// for backwards compatibility.
|
||||
Username string `json:"username" table:"-"`
|
||||
Password string `json:"password" table:"-"`
|
||||
Username string `json:"username,omitempty" table:"-"`
|
||||
Password string `json:"password,omitempty" table:"-"`
|
||||
}
|
||||
|
||||
// ExternalAuthRequest is used to request an access token for a provider.
|
||||
|
|
Loading…
Reference in New Issue