Skip to content

cub serviceaccount key add

cub serviceaccount key add

Register a public key for a service account

Synopsis

Register a public key for a service account.

Either generate a keypair here with --generate, which stores the private key locally and registers the public half, or register a public key you already have with --public-key.

--generate takes an alias or a path. A bare name is an alias stored under ~/.confighub/keys, which is what "cub auth login --private-key=" looks up; anything containing a path separator is written there instead and has no alias.

Examples:

  # Generate a keypair, storing it under ~/.confighub/keys as the alias "deploy-bot"
  cub serviceaccount key add deploy-bot --generate deploy-bot

  # ...then authenticate as the service account with it
  cub auth login --private-key=deploy-bot

  # Register a public key you already have, with a note about who holds it
  cub serviceaccount key add deploy-bot --public-key ./deploy-bot.pub.jwk \
      --description "CI runner, us-east"
cub serviceaccount key add <service account> [flags]

Options

      --description string   note recording which host or pipeline holds the private key
      --dry-run              report what the command would write, and write nothing
      --generate string      generate an Ed25519 keypair, store the private key under this alias (or path), and register the public half
  -h, --help                 help for add
      --public-key string    file holding the public key as a JWK, or - for stdin

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO