mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-19 21:10:48 +02:00
shell: update s3.configure to list users instead of full config
This commit is contained in:
@@ -138,14 +138,14 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io
|
||||
func (c *commandS3Configure) listConfiguration(commandEnv *CommandEnv, writer io.Writer) error {
|
||||
return pb.WithGrpcClient(false, 0, func(conn *grpc.ClientConn) error {
|
||||
client := iam_pb.NewSeaweedIdentityAccessManagementClient(conn)
|
||||
resp, err := client.GetConfiguration(context.Background(), &iam_pb.GetConfigurationRequest{})
|
||||
resp, err := client.ListUsers(context.Background(), &iam_pb.ListUsersRequest{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
filer.ProtoToText(&buf, resp.Configuration)
|
||||
fmt.Fprint(writer, buf.String())
|
||||
fmt.Fprintln(writer)
|
||||
fmt.Fprintln(writer, "Users:")
|
||||
for _, user := range resp.Usernames {
|
||||
fmt.Fprintf(writer, "- %s\n", user)
|
||||
}
|
||||
return nil
|
||||
}, commandEnv.option.FilerAddress.ToGrpcAddress(), false, commandEnv.option.GrpcDialOption)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user