segmentio / topicctl

Tool for declarative management of Kafka topics
MIT License
590 stars 55 forks source link

get users subcommand #153

Closed petedannemann closed 12 months ago

petedannemann commented 1 year ago

This PR adds the get users subcommand. It displays the users in the cluster as well as some basic, non-sensitive credential information

Help command

$ topicctl get users --help
Displays information for all users in the cluster.

Usage:
  topicctl get users [flags]

Flags:
  -h, --help   help for users

Global Flags:
  -b, --broker-addr string       Broker address
      --cluster-config string    Cluster config
      --debug                    enable debug logging
      --expand-env               Expand environment in cluster config
      --full                     Show more full information for resources
      --no-spinner               disable all UI spinners
      --sasl-mechanism string    SASL mechanism if using SASL (choices: AWS-MSK-IAM, PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512)
      --sasl-password string     SASL password if using SASL; will override value set in cluster config
      --sasl-username string     SASL username if using SASL; will override value set in cluster config
      --sort-values              Sort by value instead of name; only applies for lags at the moment
      --tls-ca-cert string       Path to client CA cert PEM file if using TLS
      --tls-cert string          Path to client cert PEM file if using TLS
      --tls-enabled              Use TLS for communication with brokers
      --tls-key string           Path to client private key PEM file if using TLS
      --tls-server-name string   Server name to use for TLS cert verification
      --tls-skip-verify          Skip hostname verification when using TLS
  -z, --zk-addr string           ZooKeeper address
      --zk-prefix string         Prefix for cluster-related nodes in zk

Usage:

$ topicctl get users --cluster-config examples/auth/cluster.yaml
[2023-09-19 15:54:49]  INFO Users:
-------------+-----------+-------------
     NAME    | MECHANISM | ITERATIONS
-------------+-----------+-------------
  adminscram | sha256    |       4096
  adminscram | sha512    |       4096
  junk       | sha512    |      15000
-------------+-----------+-------------
petedannemann commented 1 year ago

Need to add this to the repl