fix: IAM not initialized then checkKeyValid() should return 503s (#12260)

currently GetUser() returns 403 when IAM is not initialized
this can lead to applications crashing, instead return 503
so that the applications can retry and backoff.

fixes #12078
This commit is contained in:
Harshavardhana
2021-05-09 08:14:19 -07:00
committed by GitHub
parent 39d681a04a
commit 8b52d70012
4 changed files with 30 additions and 0 deletions

View File

@@ -352,6 +352,8 @@ func UnstartedTestServer(t TestErrHandler, instanceType string) TestServer {
initAllSubsystems(ctx, objLayer)
globalIAMSys.InitStore(objLayer)
return testServer
}
@@ -1571,6 +1573,8 @@ func newTestObjectLayer(ctx context.Context, endpointServerPools EndpointServerP
initAllSubsystems(ctx, z)
globalIAMSys.InitStore(z)
return z, nil
}
@@ -1617,6 +1621,8 @@ func initAPIHandlerTest(obj ObjectLayer, endpoints []string) (string, http.Handl
initAllSubsystems(context.Background(), obj)
globalIAMSys.InitStore(obj)
// get random bucket name.
bucketName := getRandomBucketName()
@@ -1909,6 +1915,8 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) {
initAllSubsystems(ctx, objLayer)
globalIAMSys.InitStore(objLayer)
// Executing the object layer tests for single node setup.
objTest(objLayer, FSTestStr, t)
@@ -1928,6 +1936,8 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) {
initAllSubsystems(ctx, objLayer)
globalIAMSys.InitStore(objLayer)
defer removeRoots(append(fsDirs, fsDir))
// Executing the object layer tests for Erasure.
objTest(objLayer, ErasureTestStr, t)