Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions portal-ui/src/screens/Console/Configurations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ export const fieldsConfigurations: any = {
name: "config_url",
required: false,
label: "Config URL",
tooltip: "Config URL for Client ID configuration",
tooltip: "Config URL for identity provider configuration",
type: "string",
placeholder: "Enter Config URL",
placeholder:
"https://identity-provider-url/.well-known/openid-configuration",
},
{
name: "client_id",
Expand All @@ -326,11 +327,18 @@ export const fieldsConfigurations: any = {
type: "string",
placeholder: "Enter Client ID",
},
{
name: "client_secret",
required: false,
label: "Secret ID",
type: "string",
placeholder: "Enter Secret ID",
},
{
name: "claim_name",
required: false,
label: "Claim Name",
tooltip: "Claim Name",
tooltip: "Claim from which MinIO will read the policy or role to use",
type: "string",
placeholder: "Enter Claim Name",
},
Expand All @@ -342,6 +350,26 @@ export const fieldsConfigurations: any = {
type: "string",
placeholder: "Enter Claim Prefix",
},
{
name: "claim_userinfo",
required: false,
label: "Claim UserInfo",
type: "on|off",
},
{
name: "redirect_uri",
required: false,
label: "Redirect URI",
type: "string",
placeholder: "https://console-endpoint-url/oauth_callback",
},
{
name: "scopes",
required: false,
label: "Scopes",
type: "string",
placeholder: "openid,profile,email",
},
],
identity_ldap: [
{
Expand Down
6 changes: 5 additions & 1 deletion restapi/admin_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ func setConfigWithARNAccountID(ctx context.Context, client MinioAdmin, configNam
func buildConfig(configName *string, kvs []*models.ConfigurationKV) *string {
configElements := []string{*configName}
for _, kv := range kvs {
configElements = append(configElements, fmt.Sprintf("%s=%s", kv.Key, kv.Value))
key := kv.Key
val := fmt.Sprintf("\"%s\"", kv.Value)
if key != "" {
configElements = append(configElements, fmt.Sprintf("%s=%s", key, val))
}
}
config := strings.Join(configElements, " ")
return &config
Expand Down
4 changes: 2 additions & 2 deletions restapi/admin_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func Test_buildConfig(t *testing.T) {
},
},
},
want: swag.String("notify_postgres enable=off connection_string="),
want: swag.String("notify_postgres enable=\"off\" connection_string=\"\""),
},
// Test-2: buildConfig() format correctly configuration as "config_name k=v k2=v2 k2=v3" with duplicate keys
{
Expand All @@ -213,7 +213,7 @@ func Test_buildConfig(t *testing.T) {
},
},
},
want: swag.String("notify_postgres enable=off connection_string= connection_string=x"),
want: swag.String("notify_postgres enable=\"off\" connection_string=\"\" connection_string=\"x\""),
},
}
for _, tt := range tests {
Expand Down