Skip to content

Commit 3b82079

Browse files
authored
Adding additional fields for openid configuration (#1132)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
1 parent 854468a commit 3b82079

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

portal-ui/src/screens/Console/Configurations/utils.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ export const fieldsConfigurations: any = {
315315
name: "config_url",
316316
required: false,
317317
label: "Config URL",
318-
tooltip: "Config URL for Client ID configuration",
318+
tooltip: "Config URL for identity provider configuration",
319319
type: "string",
320-
placeholder: "Enter Config URL",
320+
placeholder:
321+
"https://identity-provider-url/.well-known/openid-configuration",
321322
},
322323
{
323324
name: "client_id",
@@ -326,11 +327,18 @@ export const fieldsConfigurations: any = {
326327
type: "string",
327328
placeholder: "Enter Client ID",
328329
},
330+
{
331+
name: "client_secret",
332+
required: false,
333+
label: "Secret ID",
334+
type: "string",
335+
placeholder: "Enter Secret ID",
336+
},
329337
{
330338
name: "claim_name",
331339
required: false,
332340
label: "Claim Name",
333-
tooltip: "Claim Name",
341+
tooltip: "Claim from which MinIO will read the policy or role to use",
334342
type: "string",
335343
placeholder: "Enter Claim Name",
336344
},
@@ -342,6 +350,26 @@ export const fieldsConfigurations: any = {
342350
type: "string",
343351
placeholder: "Enter Claim Prefix",
344352
},
353+
{
354+
name: "claim_userinfo",
355+
required: false,
356+
label: "Claim UserInfo",
357+
type: "on|off",
358+
},
359+
{
360+
name: "redirect_uri",
361+
required: false,
362+
label: "Redirect URI",
363+
type: "string",
364+
placeholder: "https://console-endpoint-url/oauth_callback",
365+
},
366+
{
367+
name: "scopes",
368+
required: false,
369+
label: "Scopes",
370+
type: "string",
371+
placeholder: "openid,profile,email",
372+
},
345373
],
346374
identity_ldap: [
347375
{

restapi/admin_config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ func setConfigWithARNAccountID(ctx context.Context, client MinioAdmin, configNam
169169
func buildConfig(configName *string, kvs []*models.ConfigurationKV) *string {
170170
configElements := []string{*configName}
171171
for _, kv := range kvs {
172-
configElements = append(configElements, fmt.Sprintf("%s=%s", kv.Key, kv.Value))
172+
key := kv.Key
173+
val := fmt.Sprintf("\"%s\"", kv.Value)
174+
if key != "" {
175+
configElements = append(configElements, fmt.Sprintf("%s=%s", key, val))
176+
}
173177
}
174178
config := strings.Join(configElements, " ")
175179
return &config

restapi/admin_config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func Test_buildConfig(t *testing.T) {
191191
},
192192
},
193193
},
194-
want: swag.String("notify_postgres enable=off connection_string="),
194+
want: swag.String("notify_postgres enable=\"off\" connection_string=\"\""),
195195
},
196196
// Test-2: buildConfig() format correctly configuration as "config_name k=v k2=v2 k2=v3" with duplicate keys
197197
{
@@ -213,7 +213,7 @@ func Test_buildConfig(t *testing.T) {
213213
},
214214
},
215215
},
216-
want: swag.String("notify_postgres enable=off connection_string= connection_string=x"),
216+
want: swag.String("notify_postgres enable=\"off\" connection_string=\"\" connection_string=\"x\""),
217217
},
218218
}
219219
for _, tt := range tests {

0 commit comments

Comments
 (0)