Merge pull request #4344 from swordqiu/hotfix/qj-reduce-authenticate-action-log

fix: reduce action log for keystone authentication event
This commit is contained in:
Zexi Li
2019-12-26 21:12:03 +08:00
committed by GitHub
+5 -4
View File
@@ -646,12 +646,13 @@ func (manager *SUserManager) traceLoginEvent(ctx context.Context, token mcclient
usr.LastLoginSource = authCtx.Source
return nil
})
// ignore operator auth source
if authCtx.Source == mcclient.AuthSourceOperator {
db.OpsLog.LogEvent(usr, "auth", &s, token)
// to reduce auth event, log web console login only
if authCtx.Source == mcclient.AuthSourceWeb {
logclient.AddActionLogWithContext(ctx, usr, logclient.ACT_AUTHENTICATE, &s, token, true)
return
}
db.OpsLog.LogEvent(usr, "auth", &s, token)
logclient.AddActionLogWithContext(ctx, usr, logclient.ACT_AUTHENTICATE, &s, token, true)
// ignore any other auth source
}
type sLoginSession struct {