Skip to content

SSH key prompt doesn't list all user's SSH keys

Summary

glab ssh-key get prompts the user with a list of the user's SSH public keys and prints the selected one. The prompting code doesn't set any pagination properties and doesn't handle paging in general. This leads to the defaults being used. As the default is 20 items per page, only the first 20 keys are included in the prompt. The user thus can't select keys that would arrive in the later pages and there's no message saying that some keys were excluded.

Steps to reproduce

  1. Have more than 20 SSH public keys in a user profile
  2. Run glab ssh-key get
    • The prompt doesn't include all of the keys.
    • There's no message saying some keys have been excluded.

What is the current bug behavior?

Keys get silently left out from the prompt.

What is the expected correct behavior?

Provide access to all keys or at least inform the users that some keys were excluded from the prompt due to there being too many.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information