Merge pull request #17050 from influxdata/auth_cli_list
fix(cmd/influx): fix auth user namepull/17072/head^2
commit
2f941c669a
|
@ -8,6 +8,7 @@
|
|||
1. [17042](https://github.com/influxdata/influxdb/pull/17042): Fixed issue where tasks are not exported when exporting by org id
|
||||
1. [17070](https://github.com/influxdata/influxdb/pull/17070): Fixed issue where tasks with imports in query break in pkger
|
||||
1. [17028](https://github.com/influxdata/influxdb/pull/17028): Fixed issue where selecting an aggregate function in the script editor was not adding the function to a new line
|
||||
1. [17050](https://github.com/influxdata/influxdb/pull/17050): Added missing user names to auth CLI commands
|
||||
|
||||
## v2.0.0-beta.5 [2020-02-27]
|
||||
|
||||
|
|
|
@ -313,6 +313,11 @@ func authorizationFindF(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
us, err := newUserService()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
filter := platform.AuthorizationFilter{}
|
||||
if authorizationFindFlags.id != "" {
|
||||
fID, err := platform.IDFromString(authorizationFindFlags.id)
|
||||
|
@ -362,11 +367,16 @@ func authorizationFindF(cmd *cobra.Command, args []string) error {
|
|||
for _, p := range a.Permissions {
|
||||
permissions = append(permissions, p.String())
|
||||
}
|
||||
user, err := us.FindUserByID(context.Background(), a.UserID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
w.Write(map[string]interface{}{
|
||||
"ID": a.ID,
|
||||
"Token": a.Token,
|
||||
"Status": a.Status,
|
||||
"User": user.Name,
|
||||
"UserID": a.UserID.String(),
|
||||
"Permissions": permissions,
|
||||
})
|
||||
|
@ -466,6 +476,11 @@ func authorizationActiveF(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
us, err := newUserService()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var id platform.ID
|
||||
if err := id.DecodeFromString(authorizationActiveFlags.id); err != nil {
|
||||
return err
|
||||
|
@ -498,10 +513,16 @@ func authorizationActiveF(cmd *cobra.Command, args []string) error {
|
|||
ps = append(ps, p.String())
|
||||
}
|
||||
|
||||
user, err := us.FindUserByID(context.Background(), a.UserID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
w.Write(map[string]interface{}{
|
||||
"ID": a.ID.String(),
|
||||
"Token": a.Token,
|
||||
"Status": a.Status,
|
||||
"User": user.Name,
|
||||
"UserID": a.UserID.String(),
|
||||
"Permissions": ps,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue