Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

feat: Reveal tokens subcommand #229

Merged
merged 1 commit into from
Jan 25, 2021
Merged

feat: Reveal tokens subcommand #229

merged 1 commit into from
Jan 25, 2021

Conversation

jawnsy
Copy link
Contributor

@jawnsy jawnsy commented Jan 25, 2021

  • Mark tokens subcommand as visible
  • Re-generate Markdown documentation for the commands
  • Add JSON output for "tokens ls" command, as with "envs ls"
  • Add integration test cases

Tested the commands:

[coder@jawnsy-m docs]$ coder tokens ls -o json
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
[{"id":"RQAv4Tvhiw","name":"abc","application":true,"user_id":"6006fa81-d49b8c0d52e920fe40f5ca90","last_used":"0001-01-01T00:00:00Z"},{"id":"rAvv33PmmY","name":"","application":false,"user_id":"6006fa81-d49b8c0d52e920fe40f5ca90","last_used":"2021-01-22T21:19:58.65074Z"},{"id":"XTCWEeOvoo","name":"","application":false,"user_id":"6006fa81-d49b8c0d52e920fe40f5ca90","last_used":"2021-01-25T00:13:34.62261Z"},{"id":"vl7pIPT8dX","name":"","application":false,"user_id":"6006fa81-d49b8c0d52e920fe40f5ca90","last_used":"2021-01-25T00:22:36.56265Z"}]
[coder@jawnsy-m docs]$ coder tokens create abcdef
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
Oo6zFqfK3t-tvUWLtWQPY5Qrj4s14E1Rq
[coder@jawnsy-m docs]$ coder tokens ls
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
ID            Name      Application    UserID                               LastUsed                               
Oo6zFqfK3t    abcdef    true           6006fa81-d49b8c0d52e920fe40f5ca90    0001-01-01 00:00:00 +0000 UTC          
RQAv4Tvhiw    abc       true           6006fa81-d49b8c0d52e920fe40f5ca90    0001-01-01 00:00:00 +0000 UTC          
rAvv33PmmY              false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-22 21:19:58.65074 +0000 UTC    
XTCWEeOvoo              false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-25 00:13:34.62261 +0000 UTC    
vl7pIPT8dX              false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-25 00:22:36.56265 +0000 UTC    
[coder@jawnsy-m docs]$ coder tokens regen Oo6zFqfK3t
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
Oo6zFqfK3t-r9OHpN1h6BJPhnHWFIYbD3
[coder@jawnsy-m docs]$ coder tokens rm Oo6zFqfK3t
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
[coder@jawnsy-m docs]$ coder tokens ls
warning: version mismatch detected
  | Coder CLI version: unknown
  | Coder API version: 1.14.0+351-gb3b505259-20210124
  | 
  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases
ID            Name    Application    UserID                               LastUsed                               
RQAv4Tvhiw    abc     true           6006fa81-d49b8c0d52e920fe40f5ca90    0001-01-01 00:00:00 +0000 UTC          
rAvv33PmmY            false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-22 21:19:58.65074 +0000 UTC    
XTCWEeOvoo            false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-25 00:13:34.62261 +0000 UTC    
vl7pIPT8dX            false          6006fa81-d49b8c0d52e920fe40f5ca90    2021-01-25 00:22:36.56265 +0000 UTC

@jawnsy jawnsy requested a review from cmoog January 25, 2021 00:36
@jawnsy jawnsy self-assigned this Jan 25, 2021
@shortcut-integration
Copy link

This pull request has been linked to Clubhouse Story #6470: Reveal (and document) coder tokens.

@jawnsy jawnsy force-pushed the jawnsy/ch6470 branch 5 times, most recently from 85e7bbe to 54c2c42 Compare January 25, 2021 00:59
* Mark tokens subcommand as visible
* Re-generate Markdown documentation for the commands
* Add JSON output for "tokens ls" command, as with "envs ls"
* Add integration test cases
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@jawnsy
Copy link
Contributor Author

jawnsy commented Jan 25, 2021

@cmoog Something from the above output that I'm a bit unsure about, the tokens listed are partial (only the part before the hyphen), so even though regen changes the key (the latter part changes), the coder tokens ls output looks the same. I assume this is as designed but figured I should highlight it to you just in case.

@jawnsy jawnsy merged commit 96c67b8 into master Jan 25, 2021
@jawnsy jawnsy deleted the jawnsy/ch6470 branch January 25, 2021 16:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants