From 083d518cf51240c8977f0d9226897a9886cfbb50 Mon Sep 17 00:00:00 2001 From: Matt Potter Date: Mon, 17 Apr 2023 09:22:39 +0100 Subject: [PATCH] feat: add --skip-consent flag to hydra cli (#3492) --- cmd/cmd_create_client.go | 1 + cmd/cmd_helper_client.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmd/cmd_create_client.go b/cmd/cmd_create_client.go index 8523d48d965..d9125cb80ac 100644 --- a/cmd/cmd_create_client.go +++ b/cmd/cmd_create_client.go @@ -38,6 +38,7 @@ const ( flagClientResponseType = "response-type" flagClientScope = "scope" flagClientSectorIdentifierURI = "sector-identifier-uri" + flagClientSkipConsent = "skip-consent" flagClientSubjectType = "subject-type" flagClientTokenEndpointAuthMethod = "token-endpoint-auth-method" flagClientSecret = "secret" diff --git a/cmd/cmd_helper_client.go b/cmd/cmd_helper_client.go index 1e5f85b048b..2e09e610ad7 100644 --- a/cmd/cmd_helper_client.go +++ b/cmd/cmd_helper_client.go @@ -40,6 +40,7 @@ func clientFromFlags(cmd *cobra.Command) hydra.OAuth2Client { RequestUris: flagx.MustGetStringSlice(cmd, flagClientRequestURI), ResponseTypes: flagx.MustGetStringSlice(cmd, flagClientResponseType), Scope: pointerx.String(strings.Join(flagx.MustGetStringSlice(cmd, flagClientScope), " ")), + SkipConsent: pointerx.Bool(flagx.MustGetBool(cmd, flagClientSkipConsent)), SectorIdentifierUri: pointerx.String(flagx.MustGetString(cmd, flagClientSectorIdentifierURI)), SubjectType: pointerx.String(flagx.MustGetString(cmd, flagClientSubjectType)), TokenEndpointAuthMethod: pointerx.String(flagx.MustGetString(cmd, flagClientTokenEndpointAuthMethod)), @@ -77,6 +78,7 @@ func registerClientFlags(flags *pflag.FlagSet) { flags.String(flagClientSecret, "", "Provide the client's secret.") flags.String(flagClientName, "", "The client's name.") flags.StringSlice(flagClientPostLogoutCallback, []string{}, "List of allowed URLs to be redirected to after a logout.") + flags.Bool(flagClientSkipConsent, false, "Boolean flag specifying whether to skip the consent screen for this client. If omitted, the default value is false.") // back-channel logout options flags.Bool(flagClientBackChannelLogoutSessionRequired, false, "Boolean flag specifying whether the client requires that a sid (session ID) Claim be included in the Logout Token to identify the client session with the OP when the backchannel-logout-callback is used. If omitted, the default value is false.")