Skip to content

Commit

Permalink
refactor(cli): remove id flag and rename callback name
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Command `hydra create client` no longer supports flag `--id` and flag `--callbacks` has been renamed to `--redirect-uris`.
  • Loading branch information
aeneasr committed Jun 15, 2022
1 parent beb0838 commit 92236d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/cli/handler_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,11 @@ func (h *ClientHandler) CreateClient(cmd *cobra.Command, args []string) {
cmdx.Must(err, "Failed to load encryption key: %s", err)

cc := models.OAuth2Client{
ClientID: flagx.MustGetString(cmd, "id"),
ClientSecret: secret,
ResponseTypes: flagx.MustGetStringSlice(cmd, "response-types"),
Scope: strings.Join(flagx.MustGetStringSlice(cmd, "scope"), " "),
GrantTypes: flagx.MustGetStringSlice(cmd, "grant-types"),
RedirectUris: flagx.MustGetStringSlice(cmd, "callbacks"),
RedirectUris: flagx.MustGetStringSlice(cmd, "redirect-uris"),
ClientName: flagx.MustGetString(cmd, "name"),
TokenEndpointAuthMethod: flagx.MustGetString(cmd, "token-endpoint-auth-method"),
JwksURI: flagx.MustGetString(cmd, "jwks-uri"),
Expand Down
3 changes: 1 addition & 2 deletions cmd/clients_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ To encrypt auto generated client secret, use "--pgp-key", "--pgp-key-url" or "--
`,
Run: cli.NewHandler().Clients.CreateClient,
}
cmd.Flags().String("id", "", "Give the client this id")
cmd.Flags().StringSliceP("callbacks", "c", []string{}, "REQUIRED list of allowed callback URLs")
cmd.Flags().StringSliceP("redirect-uris", "c", []string{}, "List of allowed OAuth2 Redirect URIs.")
cmd.Flags().StringSliceP("grant-types", "g", []string{"authorization_code"}, "A list of allowed grant types")
cmd.Flags().StringSliceP("response-types", "r", []string{"code"}, "A list of allowed response types")
cmd.Flags().StringSliceP("scope", "a", []string{""}, "The scope the client is allowed to request")
Expand Down

0 comments on commit 92236d9

Please sign in to comment.