Skip to content

Commit

Permalink
OCM-7673 | fix: Provide the default value to the external auth
Browse files Browse the repository at this point in the history
Signed-off-by: Maggie Chen <magchen@redhat.com>

fix const

Signed-off-by: Maggie Chen <magchen@redhat.com>
  • Loading branch information
chenz4027 committed May 1, 2024
1 parent cd2d1ab commit 56e4b45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/externalauthprovider/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const (
claimValidationRuleFlag = "claim-validation-rule"
consoleClientIdFlag = "console-client-id"
consoleClientSecretFlag = "console-client-secret"
defaultClaimMappingUsername = "email"
defaultClaimMappingGroups = "groups"
)

type ExternalAuthServiceImpl struct {
Expand Down Expand Up @@ -256,7 +258,7 @@ func GetExternalAuthOptions(
if interactive.Enabled() && !cmd.Changed(claimMappingUsernameClaimFlag) {
result.claimMappingUsernameClaim, err = interactive.GetString(interactive.Input{
Question: "Claim mapping username",
Default: result.claimMappingUsernameClaim,
Default: defaultClaimMappingUsername,
Help: cmd.Lookup(claimMappingUsernameClaimFlag).Usage,
Required: true,
})
Expand All @@ -268,7 +270,7 @@ func GetExternalAuthOptions(
if interactive.Enabled() && !cmd.Changed(claimMappingGroupsClaimFlag) {
result.claimMappingGroupsClaim, err = interactive.GetString(interactive.Input{
Question: "Claim mapping groups",
Default: result.claimMappingGroupsClaim,
Default: defaultClaimMappingGroups,
Help: cmd.Lookup(claimMappingGroupsClaimFlag).Usage,
Required: true,
})
Expand Down

0 comments on commit 56e4b45

Please sign in to comment.