Skip to content

Commit 7029a42

Browse files
authored
chore: update docs for 3.16.3 (#178)
1 parent d04e2a3 commit 7029a42

7 files changed

Lines changed: 53 additions & 6 deletions

File tree

docs/data-sources/project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The project data source.
2121

2222
### Read-Only
2323

24+
- `allow_just_in_time_access` (Boolean) Whether to allow just-in-time access in this project.
2425
- `allow_request_role` (Boolean) Whether to allow requesting roles in this project.
2526
- `allow_self_approval` (Boolean) Whether to allow the issue creator to self-approve the issue.
2627
- `data_classification_config_id` (String) The data classification configuration ID for the project.

docs/data-sources/project_list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ The project data source list.
3131

3232
Read-Only:
3333

34+
- `allow_just_in_time_access` (Boolean)
3435
- `allow_request_role` (Boolean)
3536
- `allow_self_approval` (Boolean)
3637
- `data_classification_config_id` (String)

docs/data-sources/setting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Required:
144144

145145
Optional:
146146

147+
- `access_token_duration_in_seconds` (Number) The duration for access token in seconds. Default is 3600 (1 hour). The duration should be at least 60 (one minute).
147148
- `announcement` (Block List, Max: 1) Custom announcement. Will show as a banner in the Bytebase UI. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--workspace_profile--announcement))
148149
- `branding_logo` (String) The branding logo as a data URI (e.g. data:image/png;base64,...).
149150
- `database_change_mode` (String) The workspace database change mode, support EDITOR or PIPELINE. Default PIPELINE
@@ -155,7 +156,6 @@ Optional:
155156
- `external_url` (String) The URL user visits Bytebase. The external URL is used for: 1. Constructing the correct callback URL when configuring the VCS provider. The callback URL points to the frontend; 2. Creating the correct webhook endpoint when configuring the project GitOps workflow. The webhook endpoint points to the backend.
156157
- `maximum_role_expiration_in_seconds` (Number) The max duration in seconds for role expired. If the value is less than or equal to 0, we will remove the setting. AKA no limit.
157158
- `password_restriction` (Block List, Max: 1) Password restriction settings. (see [below for nested schema](#nestedblock--workspace_profile--password_restriction))
158-
- `access_token_duration_in_seconds` (Number) The duration for access token in seconds. Default is 3600 (1 hour). The duration should be at least 60 (one minute).
159159
- `query_timeout_in_seconds` (Number) The maximum time allowed for a query to run in SQL Editor, in seconds. No limit when the value <= 0.
160160
- `refresh_token_duration_in_seconds` (Number) The duration for refresh token in seconds. Default is 604800 (7 days). The duration should be at least 3600 (one hour).
161161
- `sql_result_size` (Number) The size limit in bytes for SQL query results. The default value is 100MB.

docs/resources/project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The project resource.
2222

2323
### Optional
2424

25+
- `allow_just_in_time_access` (Boolean) Whether to allow just-in-time access in this project.
2526
- `allow_request_role` (Boolean) Whether to allow requesting roles in this project.
2627
- `allow_self_approval` (Boolean) Whether to allow the issue creator to self-approve the issue.
2728
- `ci_sampling_size` (Number) The maximum databases of rows to sample during CI data validation. Without specification, sampling is disabled, resulting in a full validation.

docs/resources/setting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Required:
204204

205205
Optional:
206206

207+
- `access_token_duration_in_seconds` (Number) The duration for access token in seconds. Default is 3600 (1 hour). The duration should be at least 60 (one minute).
207208
- `announcement` (Block List, Max: 1) Custom announcement. Will show as a banner in the Bytebase UI. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--workspace_profile--announcement))
208209
- `branding_logo` (String) The branding logo as a data URI (e.g. data:image/png;base64,...).
209210
- `database_change_mode` (String) The workspace database change mode, support EDITOR or PIPELINE. Default PIPELINE
@@ -215,7 +216,6 @@ Optional:
215216
- `external_url` (String) The URL user visits Bytebase. The external URL is used for: 1. Constructing the correct callback URL when configuring the VCS provider. The callback URL points to the frontend; 2. Creating the correct webhook endpoint when configuring the project GitOps workflow. The webhook endpoint points to the backend.
216217
- `maximum_role_expiration_in_seconds` (Number) The max duration in seconds for role expired. If the value is less than or equal to 0, we will remove the setting. AKA no limit.
217218
- `password_restriction` (Block List, Max: 1) Password restriction settings. (see [below for nested schema](#nestedblock--workspace_profile--password_restriction))
218-
- `access_token_duration_in_seconds` (Number) The duration for access token in seconds. Default is 3600 (1 hour). The duration should be at least 60 (one minute).
219219
- `query_timeout_in_seconds` (Number) The maximum time allowed for a query to run in SQL Editor, in seconds. No limit when the value <= 0.
220220
- `refresh_token_duration_in_seconds` (Number) The duration for refresh token in seconds. Default is 604800 (7 days). The duration should be at least 3600 (one hour).
221221
- `sql_result_size` (Number) The size limit in bytes for SQL query results. The default value is 100MB.

examples/setup/main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ resource "bytebase_setting" "workspace_profile" {
3131
name = "settings/WORKSPACE_PROFILE"
3232

3333
workspace_profile {
34-
external_url = "https://bytebase.example.com"
35-
domains = ["bytebase.com"]
36-
sql_result_size = 200 * 1024 * 1024 # 200MB
37-
query_timeout_in_seconds = 60 # 60 seconds
34+
external_url = "https://bytebase.example.com"
35+
domains = ["bytebase.com"]
36+
sql_result_size = 200 * 1024 * 1024 # 200MB
37+
query_timeout_in_seconds = 60 # 60 seconds
38+
refresh_token_duration_in_seconds = 604800 # 7 days
39+
access_token_duration_in_seconds = 3600 # 1 hour
3840

3941
password_restriction {
4042
min_length = 8

migration/3.16.3.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Migrate from 3.16.1 to 3.16.3
2+
3+
## Bug Fixes
4+
5+
### Fix perpetual Terraform plan diffs for workspace_profile and data_sources
6+
7+
Previously, several `workspace_profile` fields and instance `data_sources` would show spurious diffs on every `terraform plan`, even when no actual changes were made. This has been fixed in two ways:
8+
9+
1. **Workspace profile fields now have `Computed: true`**: The following fields are set by the server when not explicitly configured, so they are now marked as both `Optional` and `Computed` to prevent Terraform from detecting phantom changes:
10+
11+
- `external_url`
12+
- `maximum_role_expiration_in_seconds`
13+
- `sql_result_size`
14+
- `query_timeout_in_seconds`
15+
- `password_restriction` (and all its nested fields: `min_length`, `require_number`, `require_letter`, `require_uppercase_letter`, `require_special_character`, `require_reset_password_for_first_login`, `password_rotation_in_seconds`)
16+
17+
2. **Redis-specific fields are no longer set for non-Redis instances**: The `redis_type`, `master_name`, and `master_username` data source fields are now only populated when the instance engine is `REDIS`. Previously, the API would return spurious default values for these fields on non-Redis instances, causing unexpected diffs.
18+
19+
No action is required. After upgrading, run `terraform plan` to confirm the spurious diffs are resolved.
20+
21+
## Features
22+
23+
### Add `refresh_token_duration` and `access_token_duration` to workspace profile settings
24+
25+
The `workspace_profile` block in the `bytebase_setting` resource and data source now supports two new fields for controlling token lifetimes:
26+
27+
- `refresh_token_duration_in_seconds` - The duration for refresh tokens. Default is 604800 (7 days). Minimum value is 3600 (1 hour).
28+
- `access_token_duration_in_seconds` - The duration for access tokens. Default is 3600 (1 hour). Minimum value is 60 (1 minute).
29+
30+
```terraform
31+
resource "bytebase_setting" "profile" {
32+
name = "settings/WORKSPACE_PROFILE"
33+
34+
workspace_profile {
35+
external_url = "https://bytebase.example.com"
36+
37+
# New fields
38+
refresh_token_duration_in_seconds = 604800 # 7 days
39+
access_token_duration_in_seconds = 3600 # 1 hour
40+
}
41+
}
42+
```

0 commit comments

Comments
 (0)