upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

Reorganize organization user commands. #322

Closed AlainRoy closed 1 year ago

AlainRoy commented 1 year ago

Description

This reorganizes the 'up org user' commands to be more consistent with other commands in the CLI. Instead of multiple list commands, there is a single list command. Instead of multiple removal commands, there is a single removal command.

List

Instead of two commands to list users (list-members, list-invites), there is a single command that lists all users in an org, whether they have a pending invite or have accepted the invite.

For example:

up org user list alain-org
USERNAMME   NAME        EMAIL                 PERMISSION   STATUS 
alain       Alain Roy   alain@upbound.io      owner        ACTIVE 
                        alain+2@upbound.org                INVITED

Remove

Instead of separate commands to remove a member or delete an invite, there is a single command. It accepts an email address (for invites and members) or a username (for members)

An example of removing a user that has been invited but hasn't been acccepted:

up org user remove alain-org 'alain+2@upbound.org'
Are you sure you want to remove this member? [y/n]: y
Invite for alain+2@upbound.org removed from alain-org

An example of removing a user that is a member (they've accepted their invite):

up org user remove alain-org 'alain+2@upbound.io'
Are you sure you want to remove this member? [y/n]: y
Removing member alain+2@upbound.io. This cannot be undone.
Member alain+2@upbound.io removed from alain-org

I have:

How has this code been tested

Manual testing

AlainRoy commented 1 year ago

Oops -- I made the PR too soon. It depends on a change to up-sdk-go. I'll post that, then update this PR to use it.