AuthN: Cleanup authn package (#63456)
* AuthN: Update comments for ClientParams * AuthN: Update flag name from SyncTeamMembers to SyncTeams * UserSync: rename function and fix order of parameters so it is correct * UserSync: Fix so we skip check if no authModule or authID is passed * UserSync: move quota check to create user function * UserSync: Move FetchSyncedUserHook to UserSync * UserSync: Move last seen user hook to user sync service * ApiKey: Implement last seen hook as a client hook instead
This commit is contained in:
@@ -24,13 +24,13 @@ type OrgSync struct {
|
||||
log log.Logger
|
||||
}
|
||||
|
||||
func (s *OrgSync) SyncOrgUser(ctx context.Context, id *authn.Identity, _ *authn.Request) error {
|
||||
func (s *OrgSync) SyncOrgRolesHook(ctx context.Context, id *authn.Identity, _ *authn.Request) error {
|
||||
if !id.ClientParams.SyncUser {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespace, userID := id.NamespacedID()
|
||||
if namespace != "user" || userID <= 0 {
|
||||
if namespace != authn.NamespaceUser || userID <= 0 {
|
||||
s.log.Warn("invalid namespace %q for user ID %q", namespace, userID)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user