Skip to content

Commit f01a5ac

Browse files
authored
chore: support write only (#195)
* chore: support write only * fix: lint * fix: test
1 parent 2446990 commit f01a5ac

23 files changed

Lines changed: 76 additions & 52 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
go-version-file: "go.mod"
4444
- uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
4545
with:
46-
terraform_version: "1.3.*"
46+
terraform_version: "1.11.*"
4747
terraform_wrapper: false
4848
- run: |
4949
go generate ./...

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ provider "bytebase" {
2929
### Prerequisites
3030

3131
- [Go](https://golang.org/doc/install) (1.19 or later)
32-
- [Terraform](https://developer.hashicorp.com/terraform/downloads?product_intent=terraform) (1.3.5 or later)
32+
- [Terraform](https://developer.hashicorp.com/terraform/downloads?product_intent=terraform) (1.11 or later, required for write-only attributes)
3333
- [Bytebase](https://github.com/bytebase/bytebase) (3.17.1 or later)
3434

3535
> If you have problems running `terraform` in MacOS with Apple Silicon, you can following https://stackoverflow.com/questions/66281882/how-can-i-get-terraform-init-to-run-on-my-apple-silicon-macbook-pro-for-the-go and use the `tfenv`.
@@ -56,6 +56,11 @@ air -c scripts/.air.toml
5656
# install the provider in your local machine
5757
cd terraform-provider-bytebase && make install
5858

59+
# build for darwin_arm64
60+
go build -o terraform-provider-bytebase . && \
61+
mkdir -p ~/.terraform.d/plugins/terraform.local/bytebase/bytebase/3.17.5/darwin_arm64 && \
62+
cp terraform-provider-bytebase ~/.terraform.d/plugins/terraform.local/bytebase/bytebase/3.17.5/darwin_arm64/
63+
5964
# test
6065
# Any BYTEBASE_SERVICE_ACCOUNT/BYTEBASE_SERVICE_KEY/BYTEBASE_URL value should work since the service is mocked
6166
TF_ACC=1 BYTEBASE_SERVICE_ACCOUNT=test@service.bytebase.com BYTEBASE_SERVICE_KEY=test_secret BYTEBASE_URL=https://bytebase.example.com go test -v ./...

docs/resources/idp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Required:
4040

4141
- `base_dn` (String) The base DN to search for users.
4242
- `bind_dn` (String) The DN of the user to bind as a service account.
43-
- `bind_password` (String, Sensitive) The password of the bind user.
43+
- `bind_password` (String) The password of the bind user.
4444
- `field_mapping` (Block List, Min: 1, Max: 1) Mapping configuration for user attributes from LDAP response. (see [below for nested schema](#nestedblock--ldap_config--field_mapping))
4545
- `host` (String) The hostname or IP address of the LDAP server.
4646
- `user_filter` (String) The filter to search for users, e.g. (uid=%s).
@@ -73,7 +73,7 @@ Required:
7373

7474
- `auth_url` (String) The authorization endpoint URL.
7575
- `client_id` (String) The OAuth2 client identifier.
76-
- `client_secret` (String, Sensitive) The OAuth2 client secret.
76+
- `client_secret` (String) The OAuth2 client secret.
7777
- `field_mapping` (Block List, Min: 1, Max: 1) Mapping configuration for user attributes. (see [below for nested schema](#nestedblock--oauth2_config--field_mapping))
7878
- `token_url` (String) The token endpoint URL.
7979
- `user_info_url` (String) The user information endpoint URL.
@@ -105,7 +105,7 @@ Optional:
105105
Required:
106106

107107
- `client_id` (String) The OIDC client identifier.
108-
- `client_secret` (String, Sensitive) The OIDC client secret.
108+
- `client_secret` (String) The OIDC client secret.
109109
- `field_mapping` (Block List, Min: 1, Max: 1) Mapping configuration for user attributes from OIDC claims. (see [below for nested schema](#nestedblock--oidc_config--field_mapping))
110110
- `issuer` (String) The OIDC issuer URL.
111111

docs/resources/user.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The user resource.
2222

2323
### Optional
2424

25-
- `password` (String, Sensitive) The user login password.
25+
- `password` (String) The user login password. This value is write-only and will not be stored in Terraform state.
2626
- `phone` (String) The user phone.
2727

2828
### Read-Only

docs/resources/workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The workspace resource.
1717

1818
### Optional
1919

20-
- `license` (String, Sensitive) The license key for the workspace. Upload to activate a subscription plan.
20+
- `license` (String) The license key for the workspace. Upload to activate a subscription plan. This value is write-only and will not be stored in Terraform state.
2121
- `logo` (String) The branding logo as a data URI (e.g. data:image/png;base64,...).
2222
- `title` (String) The workspace title.
2323

examples/approval/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
terraform {
2+
required_version = ">= 1.11"
23
required_providers {
34
bytebase = {
45
version = "3.17.4"

examples/database/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Examples for query the database
22
terraform {
3+
required_version = ">= 1.11"
34
required_providers {
45
bytebase = {
56
version = "3.17.4"

examples/database_group/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
terraform {
2+
required_version = ">= 1.11"
23
required_providers {
34
bytebase = {
45
version = "3.17.4"

examples/environments/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
terraform {
2+
required_version = ">= 1.11"
23
required_providers {
34
bytebase = {
45
version = "3.17.4"

examples/groups/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
terraform {
2+
required_version = ">= 1.11"
23
required_providers {
34
bytebase = {
45
version = "3.17.4"

0 commit comments

Comments
 (0)