Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated default_report_months #27350

Merged
merged 20 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/27350.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:change
activity log: Deprecated the field "default_report_months". Instead, the billing start time will be used to determine the start time
when querying the activity log endpoints.
```
1 change: 1 addition & 0 deletions vault/activity_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,7 @@ func (a *ActivityLog) modifyResponseMonths(months []*ResponseMonth, start time.T
type activityConfig struct {
// DefaultReportMonths are the default number of months that are returned on
// a report. The zero value uses the system default of 12.
// Deprecated: This field was removed in favor of using different default startTime and endTime values
DefaultReportMonths int `json:"default_report_months"`

// RetentionMonths defines the number of months we want to retain data. The
Expand Down
1 change: 0 additions & 1 deletion vault/activity_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ func TestActivityLog_API_ConfigCRUD_Census(t *testing.T) {
}

expected := map[string]interface{}{
"default_report_months": 12,
"retention_months": 56,
"enabled": "enable",
"queries_available": false,
Expand Down
6 changes: 3 additions & 3 deletions vault/logical_system_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (b *SystemBackend) rootActivityPaths() []*framework.Path {
Type: framework.TypeInt,
Default: 12,
Description: "Number of months to report if no start date specified.",
Deprecated: true,
},
"retention_months": {
Type: framework.TypeInt,
Expand Down Expand Up @@ -327,7 +328,6 @@ func (b *SystemBackend) handleActivityConfigRead(ctx context.Context, req *logic

return &logical.Response{
Data: map[string]interface{}{
"default_report_months": config.DefaultReportMonths,
"retention_months": config.RetentionMonths,
"enabled": config.Enabled,
"queries_available": qa,
Expand Down Expand Up @@ -357,8 +357,8 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log

{
// Parse the default report months
if defaultReportMonthsRaw, ok := d.GetOk("default_report_months"); ok {
config.DefaultReportMonths = defaultReportMonthsRaw.(int)
if _, ok := d.GetOk("default_report_months"); ok {
warnings = append(warnings, fmt.Sprintf("default_report_months is deprecated: defaulting to billing start time"))
}

if config.DefaultReportMonths <= 0 {
Expand Down
5 changes: 2 additions & 3 deletions website/content/api-docs/system/internal-counters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ The `/sys/internal/counters/config` endpoint is used to configure logging of act

### Parameters

- `default_report_months` `(integer: 12)` - The number of months to report if no `start_time` is specified in a query.
- `default_report_months` `(integer: 12)` - **DEPRECATED** The number
of months to report if no `start_time` is specified in a query.
- `enabled` `(string: enable, disable, default)` - Enable or disable counting of client activity. When set to `default`, the client
counts are enabled on Enterprise builds and disabled on community builds. Disabling the feature during the middle of a month will
discard any data recorded for that month, but does not delete previous months.
Expand All @@ -1110,7 +1111,6 @@ Any missing parameters are left at their existing value.
```json
{
"enabled": "enable",
"default_report_months": 3,
"retention_months": 54
}
```
Expand Down Expand Up @@ -1155,7 +1155,6 @@ $ curl \
"lease_duration": 0,
"renewable": false,
"data": {
"default_report_months": 12,
"enabled": "default-enabled",
"queries_available": true,
"retention_months": 48,
Expand Down
36 changes: 36 additions & 0 deletions website/content/docs/upgrading/upgrade-to-1.18.x.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: docs
page_title: Upgrade to Vault 1.18.x - Guides
description: |-
Deprecations, important or breaking changes, and remediation recommendations
for anyone upgrading to 1.18.x from Vault 1.17.x.
---

# Overview

The Vault 1.18.x upgrade guide contains information on deprecations, important
or breaking changes, and remediation recommendations for anyone upgrading from
Vault 1.17. **Please read carefully**.

## Important changes

### Activity Log Changes

The field `default_report_months` can no longer be configured or read. Any previously set values
will be ignored by the system.


Attempts to modify `default_report_months` through the
[/sys/internal/counters/config](/vault/api-docs/system/internal-counters#update-the-client-count-configuration)
endpoint, will result in the following warning from Vault:

<CodeBlockConfig hideClipboard>
```shell-session

WARNING! The following warnings were returned from Vault:

* default_report_months is deprecated: defaulting to billing start time


```
</CodeBlockConfig>
Loading