Skip to content

Commit c7292d7

Browse files
committed
feat: add --skip-consent flag to hydra cli
1 parent be8f726 commit c7292d7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

cmd/cmd_create_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const (
3838
flagClientResponseType = "response-type"
3939
flagClientScope = "scope"
4040
flagClientSectorIdentifierURI = "sector-identifier-uri"
41+
flagClientSkipConsent = "skip-consent"
4142
flagClientSubjectType = "subject-type"
4243
flagClientTokenEndpointAuthMethod = "token-endpoint-auth-method"
4344
flagClientSecret = "secret"

cmd/cmd_helper_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func clientFromFlags(cmd *cobra.Command) hydra.OAuth2Client {
4040
RequestUris: flagx.MustGetStringSlice(cmd, flagClientRequestURI),
4141
ResponseTypes: flagx.MustGetStringSlice(cmd, flagClientResponseType),
4242
Scope: pointerx.String(strings.Join(flagx.MustGetStringSlice(cmd, flagClientScope), " ")),
43+
SkipConsent: pointerx.Bool(flagx.MustGetBool(cmd, flagClientSkipConsent)),
4344
SectorIdentifierUri: pointerx.String(flagx.MustGetString(cmd, flagClientSectorIdentifierURI)),
4445
SubjectType: pointerx.String(flagx.MustGetString(cmd, flagClientSubjectType)),
4546
TokenEndpointAuthMethod: pointerx.String(flagx.MustGetString(cmd, flagClientTokenEndpointAuthMethod)),
@@ -77,6 +78,7 @@ func registerClientFlags(flags *pflag.FlagSet) {
7778
flags.String(flagClientSecret, "", "Provide the client's secret.")
7879
flags.String(flagClientName, "", "The client's name.")
7980
flags.StringSlice(flagClientPostLogoutCallback, []string{}, "List of allowed URLs to be redirected to after a logout.")
81+
flags.Bool(flagClientSkipConsent, false, "Boolean flag specifying whether to skip the consent screen for this client. If omitted, the default value is false.")
8082

8183
// back-channel logout options
8284
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.")

0 commit comments

Comments
 (0)