From 19822781cc11b0d97356bca6f95d5408e20190c0 Mon Sep 17 00:00:00 2001 From: Hridoy Roy Date: Fri, 15 Oct 2021 14:04:55 -0700 Subject: [PATCH] use IsRoot helper before clientID generation in activity log (#12846) * use IsRoot helper in activity log * use IsRoot helper in activity log --- vault/activity_log.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vault/activity_log.go b/vault/activity_log.go index fb866640a..026ad3500 100644 --- a/vault/activity_log.go +++ b/vault/activity_log.go @@ -1600,9 +1600,8 @@ func (a *ActivityLog) HandleTokenUsage(entry *logical.TokenEntry) { return } - // Do not count root tokens in client count. This includes generated root tokens - // as well. - if len(entry.Policies) == 1 && entry.Policies[0] == "root" { + // Do not count root tokens in client count. + if entry.IsRoot() { return }