use IsRoot helper before clientID generation in activity log (#12846)

* use IsRoot helper in activity log

* use IsRoot helper in activity log
This commit is contained in:
Hridoy Roy 2021-10-15 14:04:55 -07:00 committed by GitHub
parent 74eba6fa56
commit 19822781cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}