fix: checking for stale STS account under site replication (#16109)

This commit is contained in:
Anis Elleuch authored and GitHub committed 2022-11-22 07:26:33 -08:00
1 parent 98ba622679
commit 04948b4d55
3 files changed
+43 -8

No files matched your search

+2 -3
View File
@@ -1257,9 +1257,8 @@ func (c *SiteReplicationSys) PeerSTSAccHandler(ctx context.Context, stsCred *mad
}
// skip overwrite of local update if peer sent stale info
if !updatedAt.IsZero() {
if u, err := globalIAMSys.GetUserInfo(ctx, stsCred.AccessKey); err == nil {
ok, _, _ := globalIAMSys.IsTempUser(stsCred.AccessKey)
if ok && u.UpdatedAt.After(updatedAt) {
if u, _, err := globalIAMSys.getTempAccount(ctx, stsCred.AccessKey); err == nil {
if u.UpdatedAt.After(updatedAt) {
return nil
}
}