mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 09:42:25 +00:00
Require activity log retention months at least the minimum (#20078)
* reject retention month updates that are less than min retention months * add changelog * reword error * switch to retention_months
This commit is contained in:
3
changelog/20078.txt
Normal file
3
changelog/20078.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
core/activity: error when attempting to update retention configuration below the minimum
|
||||
```
|
||||
@@ -351,6 +351,10 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log
|
||||
return logical.ErrorResponse("retention_months cannot be 0 while enabled"), logical.ErrInvalidRequest
|
||||
}
|
||||
|
||||
if a.core.censusLicensingEnabled && config.RetentionMonths < a.configOverrides.MinimumRetentionMonths {
|
||||
return logical.ErrorResponse("retention_months must be at least %d while Reporting is enabled", a.configOverrides.MinimumRetentionMonths), logical.ErrInvalidRequest
|
||||
}
|
||||
|
||||
// Store the config
|
||||
entry, err := logical.StorageEntryJSON(path.Join(activitySubPath, activityConfigKey), config)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user