Skip to content

Commit

Permalink
VAULT-23468: Bill on number of secrets currently being synced (#25069)
Browse files Browse the repository at this point in the history
* first pass

* launch correctly and add tests
  • Loading branch information
miagilepner authored Feb 26, 2024
1 parent 67c1634 commit ebe9ccf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions vault/activity_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,7 @@ func (c *Core) ResetActivityLog() []*activity.LogFragment {

allFragments = append(allFragments, a.standbyFragmentsReceived...)
a.standbyFragmentsReceived = make([]*activity.LogFragment, 0)
a.partialMonthClientTracker = make(map[string]*activity.EntityRecord)
a.fragmentLock.Unlock()
return allFragments
}
Expand Down
5 changes: 5 additions & 0 deletions vault/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,11 @@ func (c *Core) postUnseal(ctx context.Context, ctxCancelFunc context.CancelFunc,
if c.systemBackend != nil && c.systemBackend.mfaBackend != nil {
c.systemBackend.mfaBackend.usedCodes = cache.New(0, 30*time.Second)
}
if c.systemBackend != nil {
// all mounts need to be initialized before activity log reporting
// starts, which happens in the post-unseal functions above.
sysActivityLogReporting(c.systemBackend)
}
c.logger.Info("post-unseal setup complete")
return nil
}
Expand Down
2 changes: 2 additions & 0 deletions vault/logical_system_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ var (
return nil
}

sysActivityLogReporting = func(b *SystemBackend) {}

getSystemSchemas = func() []func() *memdb.TableSchema { return nil }

getEGPListResponseKeyInfo = func(*SystemBackend, *namespace.Namespace) map[string]interface{} { return nil }
Expand Down

0 comments on commit ebe9ccf

Please sign in to comment.