Skip to content

Commit 4d159fb

Browse files
committed
fix iam can not init global OpenID cfg 🌈
1 parent c5b83f4 commit 4d159fb

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

‎cmd/server-main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ func serverMain(ctx *cli.Context) {
567567
logger.LogIf(GlobalContext, err)
568568
}
569569

570+
// Initialize users credentials and policies in background right after config has initialized.
571+
go globalIAMSys.Init(GlobalContext, newObject, globalEtcdClient, globalRefreshIAMInterval)
572+
570573
if globalBrowserEnabled {
571574
srv, err := initConsoleServer()
572575
if err != nil {
@@ -580,9 +583,6 @@ func serverMain(ctx *cli.Context) {
580583
}()
581584
}
582585

583-
// Initialize users credentials and policies in background right after config has initialized.
584-
go globalIAMSys.Init(GlobalContext, newObject, globalEtcdClient, globalRefreshIAMInterval)
585-
586586
// Background all other operations such as initializing bucket metadata etc.
587587
go func() {
588588
// Initialize transition tier configuration manager

‎go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ require (
4343
github.com/lib/pq v1.10.4
4444
github.com/miekg/dns v1.1.48
4545
github.com/minio/cli v1.22.0
46-
github.com/minio/console v0.19.4
46+
github.com/minio/console v0.19.5
4747
github.com/minio/csvparser v1.0.0
4848
github.com/minio/dperf v0.4.2
4949
github.com/minio/highwayhash v1.0.2
5050
github.com/minio/kes v0.20.0
5151
github.com/minio/madmin-go v1.4.13
52-
github.com/minio/minio v0.0.0-20220809221743-172e63dbb67a
5352
github.com/minio/minio-go/v7 v7.0.34
5453
github.com/minio/pkg v1.3.0
5554
github.com/minio/selfupdate v0.5.0

‎go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ github.com/minio/colorjson v1.0.2 h1:Em3IM68MTm3h+Oxa0nxrV9VQqDgbxvC5iq5A+pqzDeI
608608
github.com/minio/colorjson v1.0.2/go.mod h1:JWxcL2n8T8JVf+NY6awl6kn5nK49aAzHOeQEM33dL0k=
609609
github.com/minio/console v0.19.4 h1:2sSXCU4z95QEaLQOTbSX80BNZOoKj7Jw4DPid+7oPp4=
610610
github.com/minio/console v0.19.4/go.mod h1:1qeA/u15v0TE/uC27o/jVK6MCpGpK97avKxp+SKBsuI=
611+
github.com/minio/console v0.19.5 h1:YbIorVtQ3s3lAG/yVyOPJz1ZG3VZq4vPrHlbREHzXQo=
612+
github.com/minio/console v0.19.5/go.mod h1:1qeA/u15v0TE/uC27o/jVK6MCpGpK97avKxp+SKBsuI=
611613
github.com/minio/csvparser v1.0.0 h1:xJEHcYK8ZAjeW4hNV9Zu30u+/2o4UyPnYgyjWp8b7ZU=
612614
github.com/minio/csvparser v1.0.0/go.mod h1:lKXskSLzPgC5WQyzP7maKH7Sl1cqvANXo9YCto8zbtM=
613615
github.com/minio/dperf v0.4.2 h1:u2fcdXViX3+alZcEYSOh1crNbGtVU5drQ24lP3Xx6j8=

‎internal/config/identity/openid/openid.go

+1
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ func LookupConfig(s config.Config, transport http.RoundTripper, closeRespFn func
358358
return c, config.Errorf("A role policy or claim name must be specified")
359359
}
360360

361+
// Initialize AUTH provider cfg
361362
if err = p.initializeProvider(getCfgVal, c.transport); err != nil {
362363
return c, err
363364
}

‎internal/config/identity/openid/providercfg.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"errors"
2323
"fmt"
24+
"github.com/GuinsooLab/annastore/internal/logger"
2425
"net/http"
2526

2627
"github.com/GuinsooLab/annastore/internal/arn"
@@ -74,6 +75,7 @@ const (
7475
// was provided, initialization will return an error initial login fails.
7576
func (p *providerCfg) initializeProvider(cfgGet func(string) string, transport http.RoundTripper) error {
7677
vendor := cfgGet(Vendor)
78+
logger.Info("Provider vendor: %s", vendor)
7779
if vendor == "" {
7880
return nil
7981
}

0 commit comments

Comments
 (0)