Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 24, 2022

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented May 20, 2022

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
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Looks good!

@f0ssel
Copy link
Contributor

f0ssel commented May 20, 2022

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

@Emyrk
Copy link
Member Author

Emyrk commented May 20, 2022

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
Copy link
Contributor

f0ssel commented May 20, 2022

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
Copy link
Member Author

Emyrk commented May 23, 2022

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
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
Copy link
Member Author

Emyrk commented May 23, 2022

I brought back the user arg

Copy link
Member

@ammario ammario left a comment

Choose a reason for hiding this comment

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

--

- rename 'userUpdate.go' -> 'userupdate.go'
- cmd 'users get' -> 'users show'
@Emyrk Emyrk requested a review from ammario May 23, 2022 15:14
Copy link
Member

@ammario ammario left a comment

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.

Copy link
Contributor

@f0ssel f0ssel left a comment

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

@johnstcn johnstcn self-requested a review May 23, 2022 22:54
Copy link
Member

@kylecarbs kylecarbs left a comment

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

@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
10 tasks
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* feat: Allow regen-ssh and fetching a single user from the cli
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