[v10.1.x] UserSync: Avoid UpdateLastSeenAt with invalid user ids (#72784)
UserSync: Avoid UpdateLastSeenAt with invalid user ids (#72776)
* avoid user zero
* more errors
* more tests
* split
(cherry picked from commit 7431c0ddb1)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
db44383a77
commit
c30f9216b1
@@ -136,9 +136,13 @@ func (s *UserSync) SyncLastSeenHook(ctx context.Context, identity *authn.Identit
|
||||
|
||||
namespace, id := identity.NamespacedID()
|
||||
|
||||
// do not sync invalid users
|
||||
if id <= 0 {
|
||||
return nil // skip sync
|
||||
}
|
||||
|
||||
if namespace != authn.NamespaceUser && namespace != authn.NamespaceServiceAccount {
|
||||
// skip sync
|
||||
return nil
|
||||
return nil // skip sync
|
||||
}
|
||||
|
||||
go func(userID int64) {
|
||||
|
||||
Reference in New Issue
Block a user