@@ -306,11 +306,6 @@ func (s consoleSTSAssumeRole) IsExpired() bool {
306306 return s .stsAssumeRole .IsExpired ()
307307}
308308
309- var (
310- MinioEndpoint = getMinIOServer ()
311- MinioRegion = getMinIORegion ()
312- )
313-
314309func newConsoleCredentials (accessKey , secretKey , location string ) (* credentials.Credentials , error ) {
315310 // Future authentication methods can be added under this switch statement
316311 switch {
@@ -326,10 +321,7 @@ func newConsoleCredentials(accessKey, secretKey, location string) (*credentials.
326321 // LDAP authentication for Console
327322 case ldap .GetLDAPEnabled ():
328323 {
329- if MinioEndpoint == "" {
330- return nil , errors .New ("endpoint cannot be empty for AssumeRoleSTS" )
331- }
332- creds , err := auth .GetCredentialsFromLDAP (GetConsoleSTSClient (), MinioEndpoint , accessKey , secretKey )
324+ creds , err := auth .GetCredentialsFromLDAP (GetConsoleSTSClient (), getMinIOServer (), accessKey , secretKey )
333325 if err != nil {
334326 return nil , err
335327 }
@@ -338,7 +330,7 @@ func newConsoleCredentials(accessKey, secretKey, location string) (*credentials.
338330 // default authentication for Console is via STS (Security Token Service) against MinIO
339331 default :
340332 {
341- if MinioEndpoint == "" || accessKey == "" || secretKey == "" {
333+ if accessKey == "" || secretKey == "" {
342334 return nil , errors .New ("credentials endpoint, access and secret key are mandatory for AssumeRoleSTS" )
343335 }
344336 opts := credentials.STSAssumeRoleOptions {
@@ -349,7 +341,7 @@ func newConsoleCredentials(accessKey, secretKey, location string) (*credentials.
349341 }
350342 stsAssumeRole := & credentials.STSAssumeRole {
351343 Client : GetConsoleSTSClient (),
352- STSEndpoint : MinioEndpoint ,
344+ STSEndpoint : getMinIOServer () ,
353345 Options : opts ,
354346 }
355347 consoleSTSWrapper := consoleSTSAssumeRole {stsAssumeRole : stsAssumeRole }
0 commit comments