|
@ -27,6 +27,7 @@ type IdentityAccessManagement struct { |
|
|
m sync.RWMutex |
|
|
m sync.RWMutex |
|
|
|
|
|
|
|
|
identities []*Identity |
|
|
identities []*Identity |
|
|
|
|
|
isAuthEnabled bool |
|
|
domain string |
|
|
domain string |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -137,14 +138,15 @@ func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3Api |
|
|
iam.m.Lock() |
|
|
iam.m.Lock() |
|
|
// atomically switch
|
|
|
// atomically switch
|
|
|
iam.identities = identities |
|
|
iam.identities = identities |
|
|
|
|
|
if !iam.isAuthEnabled { // one-directional, no toggling
|
|
|
|
|
|
iam.isAuthEnabled = len(identities) > 0 |
|
|
|
|
|
} |
|
|
iam.m.Unlock() |
|
|
iam.m.Unlock() |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (iam *IdentityAccessManagement) isEnabled() bool { |
|
|
func (iam *IdentityAccessManagement) isEnabled() bool { |
|
|
iam.m.RLock() |
|
|
|
|
|
defer iam.m.RUnlock() |
|
|
|
|
|
return len(iam.identities) > 0 |
|
|
|
|
|
|
|
|
return iam.isAuthEnabled |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (iam *IdentityAccessManagement) lookupByAccessKey(accessKey string) (identity *Identity, cred *Credential, found bool) { |
|
|
func (iam *IdentityAccessManagement) lookupByAccessKey(accessKey string) (identity *Identity, cred *Credential, found bool) { |
|
|