Skip to content

feat: Allow regen-ssh and fetching a single user from the cli - #1619

Merged
Emyrk merged 12 commits into
mainfrom
stevenmasley/user_update
May 24, 2022
Merged

Emyrk merged 12 commits into
mainfrom
stevenmasley/user_update

Conversation

@Emyrk

@Emyrk Emyrk commented May 20, 2022 •

Copy link
Copy Markdown
Member

Some more CLI user CRUD

coder public-key --reset -y
coder users get me

@Emyrk
Emyrk requested review from BrunoQuaresma and mafredri May 20, 2022 13:59

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

Comment thread cli/userUpdate.go Resolved
Comment thread cli/userUpdate.go Resolved
Comment thread cli/userlist.go Resolved
@f0ssel

f0ssel commented May 20, 2022

Copy link
Copy Markdown
Member

Who all can regenerate a user's ssh key? I assumed it was only the user themselves.

@Emyrk

Emyrk commented May 20, 2022

Copy link
Copy Markdown
Member Author

Who all can regenerate a user's ssh key? I assumed it was only the user themselves.

Admins can do it too on other people. But we can make that a feature of impersonating. I can drop the argument, and just always use me. Good point

@f0ssel

f0ssel commented May 20, 2022

Copy link
Copy Markdown
Member

I think if the API supports it we should mimic that here and still support username. I just wasn't sure what matches the API perms. It also seems useful for admins to be able to do this in batches if they require rotation, etc.

@Emyrk

Emyrk commented May 23, 2022

Copy link
Copy Markdown
Member Author

I think if the API supports it we should mimic that here and still support username. I just wasn't sure what matches the API perms. It also seems useful for admins to be able to do this in batches if they require rotation, etc.

Should I default to 'me' if there is no argument then? That seems like it could lead to a mistake.

@mafredri

Copy link
Copy Markdown
Member

Intuitively, if I run coder users get I'd expect to get a list of users, not myself. I'm in favor of keeping me for clarity.

With regards to regen-ssh, I'd like to see a coder regen-ssh for me and a coder users regen-ssh <user> to reset it for others. Perhaps we should consider compartmentalizing "admin" and "user" functionality?

@Emyrk

Emyrk commented May 23, 2022

Copy link
Copy Markdown
Member Author

I brought back the user arg

@ammario ammario left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--

Comment thread cli/userUpdate.go Resolved
Comment thread cli/userlist.go Resolved
- rename 'userUpdate.go' -> 'userupdate.go'
- cmd 'users get' -> 'users show'
@Emyrk
Emyrk requested a review from ammario May 23, 2022 15:14

@ammario ammario left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm only reviewing UX, not code. But LGTM.

@f0ssel f0ssel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yup this looks great to me

Comment thread cli/userlist_test.go Resolved
Comment thread cli/userlist_test.go Resolved
@johnstcn
johnstcn self-requested a review May 23, 2022 22:54
Comment thread cli/userupdate.go Resolved

@kylecarbs kylecarbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor comments on copy, but LGTM

Comment thread cli/publickey.go Resolved
Comment thread cli/publickey.go Resolved
Comment thread cli/publickey.go Resolved
@Emyrk
Emyrk enabled auto-merge (squash) May 24, 2022 16:20
@Emyrk
Emyrk merged commit d3a0578 into main May 24, 2022
@Emyrk
Emyrk deleted the stevenmasley/user_update branch May 24, 2022 16:53
@Emyrk Emyrk mentioned this pull request May 26, 2022
6 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants