Adding additional fields for openid configuration (#1132)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
@@ -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",
|
||||
@@ -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",
|
||||
},
|
||||
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user