Skip to content

Commit 72ca6df

Browse files
authored
chore: support configure classification (#85)
* chore: support set roles for user in workspace level * fix: lint * fix: test * chore: support group * fix: test * fix: test * chore: update examples * chore: support database catalog * fix: lint * chore: support workspace profile setting * fix: lint * chore: support configure classification * fix: lint
1 parent beabcce commit 72ca6df

File tree

16 files changed

+351
-17
lines changed

16 files changed

+351
-17
lines changed

api/setting.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const (
1010
SettingWorkspaceProfile SettingName = "bb.workspace.profile"
1111
// SettingWorkspaceExternalApproval is the setting name for workspace external approval config.
1212
SettingWorkspaceExternalApproval SettingName = "bb.workspace.approval.external"
13+
// SettingDataClassification is the setting name for data classification.
14+
SettingDataClassification SettingName = "bb.workspace.data-classification"
1315
)
1416

1517
// RiskLevel is the approval risk level.

docs/data-sources/setting.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The setting data source.
2121

2222
### Optional
2323

24+
- `classification` (Block List, Max: 1) Classification for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--classification))
2425
- `workspace_profile` (Block List, Max: 1) (see [below for nested schema](#nestedblock--workspace_profile))
2526

2627
### Read-Only
@@ -29,6 +30,39 @@ The setting data source.
2930
- `external_approval_nodes` (Block List) Configure external nodes in the approval flow. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--external_approval_nodes))
3031
- `id` (String) The ID of this resource.
3132

33+
<a id="nestedblock--classification"></a>
34+
### Nested Schema for `classification`
35+
36+
Optional:
37+
38+
- `classification_from_config` (Boolean) If true, we will only store the classification in the config. Otherwise we will get the classification from table/column comment, and write back to the schema metadata.
39+
- `classifications` (Block List) (see [below for nested schema](#nestedblock--classification--classifications))
40+
- `id` (String) The classification unique uuid.
41+
- `levels` (Block List) (see [below for nested schema](#nestedblock--classification--levels))
42+
- `title` (String) The classification title. Optional.
43+
44+
<a id="nestedblock--classification--classifications"></a>
45+
### Nested Schema for `classification.classifications`
46+
47+
Optional:
48+
49+
- `description` (String) The classification description.
50+
- `id` (String) The classification unique id, must in {number}-{number} format.
51+
- `level` (String) The classification level id.
52+
- `title` (String) The classification title.
53+
54+
55+
<a id="nestedblock--classification--levels"></a>
56+
### Nested Schema for `classification.levels`
57+
58+
Optional:
59+
60+
- `description` (String) The classification level description.
61+
- `id` (String) The classification level unique uuid.
62+
- `title` (String) The classification level title.
63+
64+
65+
3266
<a id="nestedblock--workspace_profile"></a>
3367
### Nested Schema for `workspace_profile`
3468

docs/resources/setting.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The setting resource.
2222
### Optional
2323

2424
- `approval_flow` (Block List) Configure risk level and approval flow for different tasks. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--approval_flow))
25+
- `classification` (Block List, Max: 1) Classification for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--classification))
2526
- `external_approval_nodes` (Block List) Configure external nodes in the approval flow. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--external_approval_nodes))
2627
- `workspace_profile` (Block List, Max: 1) (see [below for nested schema](#nestedblock--workspace_profile))
2728

@@ -84,6 +85,39 @@ Optional:
8485

8586

8687

88+
<a id="nestedblock--classification"></a>
89+
### Nested Schema for `classification`
90+
91+
Optional:
92+
93+
- `classification_from_config` (Boolean) If true, we will only store the classification in the config. Otherwise we will get the classification from table/column comment, and write back to the schema metadata.
94+
- `classifications` (Block List) (see [below for nested schema](#nestedblock--classification--classifications))
95+
- `id` (String) The classification unique uuid.
96+
- `levels` (Block List) (see [below for nested schema](#nestedblock--classification--levels))
97+
- `title` (String) The classification title. Optional.
98+
99+
<a id="nestedblock--classification--classifications"></a>
100+
### Nested Schema for `classification.classifications`
101+
102+
Optional:
103+
104+
- `description` (String) The classification description.
105+
- `id` (String) The classification unique id, must in {number}-{number} format.
106+
- `level` (String) The classification level id.
107+
- `title` (String) The classification title.
108+
109+
110+
<a id="nestedblock--classification--levels"></a>
111+
### Nested Schema for `classification.levels`
112+
113+
Optional:
114+
115+
- `description` (String) The classification level description.
116+
- `id` (String) The classification level unique uuid.
117+
- `title` (String) The classification level title.
118+
119+
120+
87121
<a id="nestedblock--external_approval_nodes"></a>
88122
### Nested Schema for `external_approval_nodes`
89123

examples/database/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
terraform {
33
required_providers {
44
bytebase = {
5-
version = "1.0.6"
5+
version = "1.0.7"
66
# For local development, please use "terraform.local/bytebase/bytebase" instead
77
source = "registry.terraform.io/bytebase/bytebase"
88
}

examples/environments/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
terraform {
33
required_providers {
44
bytebase = {
5-
version = "1.0.6"
5+
version = "1.0.7"
66
# For local development, please use "terraform.local/bytebase/bytebase" instead
77
source = "registry.terraform.io/bytebase/bytebase"
88
}

examples/groups/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "1.0.6"
4+
version = "1.0.7"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

examples/instances/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
terraform {
33
required_providers {
44
bytebase = {
5-
version = "1.0.6"
5+
version = "1.0.7"
66
# For local development, please use "terraform.local/bytebase/bytebase" instead
77
source = "registry.terraform.io/bytebase/bytebase"
88
}

examples/policies/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "1.0.6"
4+
version = "1.0.7"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

examples/projects/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
terraform {
33
required_providers {
44
bytebase = {
5-
version = "1.0.6"
5+
version = "1.0.7"
66
# For local development, please use "terraform.local/bytebase/bytebase" instead
77
source = "registry.terraform.io/bytebase/bytebase"
88
}

examples/settings/main.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "1.0.6"
4+
version = "1.0.7"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}
@@ -29,6 +29,10 @@ data "bytebase_setting" "workspace_profile" {
2929
name = "bb.workspace.profile"
3030
}
3131

32+
data "bytebase_setting" "classification" {
33+
name = "bb.workspace.data-classification"
34+
}
35+
3236
output "approval_flow" {
3337
value = data.bytebase_setting.approval_flow
3438
}
@@ -40,3 +44,7 @@ output "external_approval" {
4044
output "workspace_profile" {
4145
value = data.bytebase_setting.workspace_profile
4246
}
47+
48+
output "classification" {
49+
value = data.bytebase_setting.classification
50+
}

0 commit comments

Comments
 (0)