terminus icon indicating copy to clipboard operation
terminus copied to clipboard

Start token generation workflow from the CLI

Open joshkoenig opened this issue 9 years ago • 8 comments

It would be great if we were able to initiate the token process from the CLI:

  1. User runs a command along the lines of teminus auth token-generate
  2. That provides a URL for the dashboard which will take them to the token generation screen, and pre-load the "Machine Name"
  3. User adjusts the machine name as needed, clicks submit, gets a shiny new token.
  4. They then take the CLI copy/pasta back to their terminal.

IIRC we have the capability to handle this on the dashboard side if the URL is constructed right. If not, we can put this off until a later date, but if so it'd be great to have for demo purposes.

joshkoenig avatar Jan 19 '16 20:01 joshkoenig

User runs a command along the lines of teminus auth token-generate

As annoyingly long as this is this should be: terminus auth machine-token-generate or terminus auth machinetoken-generate. We also have the terminus machinetoken command space to use: terminus machinetoken create. Not sure which place is more appropriate.

IIRC we have the capability to handle this on the dashboard side if the URL is constructed right

Yup: https://dashboard.getpantheon.com/machine-token/create?client=terminus&device=[[DEVICENAME]]

ronan avatar Jan 19 '16 21:01 ronan

terminus auth machine-token-generate +1 for specificity.

joshkoenig avatar Jan 21 '16 18:01 joshkoenig

We tend to set our verbs first, though. terminus auth generate-machine-token would be better in line with our other subcommands.

TeslaDethray avatar Jan 21 '16 18:01 TeslaDethray

terminus auth generate-machine-token +1 for grammar! :)

joshkoenig avatar Jan 21 '16 18:01 joshkoenig

This request is largely satisfied by #790 - all we need is a way to get into that flow directly.

joshkoenig avatar Jan 27 '16 01:01 joshkoenig

+1 this feature request

kellybell avatar Jan 28 '16 06:01 kellybell

FYI used terminus auth login this am and got a nicely constructed dashboard link that got me a token in a jiffy so I could authorize my home machine. Quite nice!

dustinleblanc avatar Feb 14 '16 14:02 dustinleblanc

+1. This feature would facilitate automated rotation of machine tokens:

  • Login using existing token.
  • Create a new token with specified device name.
  • Delete other active tokens - all, or searching by name.
  • Log out and back in using the newly generated token.

It's already possible do rotate SSH keys via terminus, it would be great to be able to do the same. We can't rely on our users remembering to do it!

You could go further, and include automatic rotation of both machine tokens and ssh keys as terminus commands. But I'm happy to write a script, I just need terminus machine-token:create

andy-lcm avatar Mar 06 '24 11:03 andy-lcm