-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
cmd: Add clients list command #1311
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome changes! Just some nitpicks, then this can get merged!
cmd/cli/handler_client.go
Outdated
@@ -148,3 +148,25 @@ func (h *ClientHandler) GetClient(cmd *cobra.Command, args []string) { | |||
checkResponse(err, http.StatusOK, response) | |||
fmt.Println(cmdx.FormatResponse(&cl)) | |||
} | |||
|
|||
func (h *ClientHandler) ListClient(cmd *cobra.Command, args []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this to ListClients :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... I fixed!
cmd/cli/handler_client.go
Outdated
checkResponse(err, http.StatusOK, response) | ||
|
||
table := newTable() | ||
table.SetHeader([]string{"Client ID", "Name", "Response Type", "Scope"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response Type
should be Response Types
. I also think it would be important to add the following fields:
RedirectUris
GrantTypes
TokenEndpointAuthMethod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! Have added :)
Signed-off-by: Shota SAWADA <xiootas@gmail.com>
… TokenEndpointAuthMethod Signed-off-by: Shota SAWADA <xiootas@gmail.com>
1aa9d12
to
ff8145d
Compare
Awesome, thank you! |
Related issue
#1310
Proposed changes
Add
hydra clients list
command.In this PR, command renders columns only
client_id
,name
,response type
,scope
,RedirectUris
,GrantTypes
,TokenEndpointAuthMethod
.The command behaves like following.
Checklist
vulnerability, I confirm that I got green light (please contact hi@ory.sh) from the maintainers to push the changes.
by signing my commit(s). You can amend your signature to the most recent commit by using
git commit --amend -s
. If youamend the commit, you might need to force push using
git push --force HEAD:<branch>
. Please be very careful when usingforce push.
Further comments
To render table, added following package.
https://github.com/olekukonko/tablewriter