From a8003384b2f80907eccc9c2b7a1b47a50562a29c Mon Sep 17 00:00:00 2001 From: AMAZZAL Date: Tue, 30 May 2023 17:23:28 +0100 Subject: [PATCH] feat:re-enroll user on password update (#244) * feat:re-enroll user on password update * (Fix) Update changelog and release-notes --------- Co-authored-by: William Guilherme --- CHANGELOG.md | 11 +++++++++++ GNUmakefile | 6 +++--- docs/guides/release-notes.md | 13 ++++++++++++- zia/resource_zia_user_management_users.go | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 034931f3..2118f84f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 2.5.5 (May, 29 2023) + +### Notes + +- Release date: **(May, 29 2023)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #244](https://github.com/zscaler/terraform-provider-zia/pull/244) Fix ``zia_user_management`` to ensure when the ``auth_methods``attribute is set, and user password is changed, the provide will re-enroll the user to update the password. + ## 2.5.4 (May, 25 2023) ### Notes diff --git a/GNUmakefile b/GNUmakefile index 3ba69f38..a3b5821f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,15 +16,15 @@ build: fmtcheck build13: GOOS=$(shell go env GOOS) build13: GOARCH=$(shell go env GOARCH) ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... -build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.5.4/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.5.5/$(GOOS)_$(GOARCH) else -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.5.4/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.5.5/$(GOOS)_$(GOARCH) endif build13: fmtcheck go mod tidy && go mod vendor @echo "==> Installing plugin to $(DESTINATION)" @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-zia_v2.5.4 + go build -o $(DESTINATION)/terraform-provider-zia_v2.5.5 test: fmtcheck go test $(TEST) || exit 1 diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index 1616d17c..ac7aca6c 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -12,10 +12,21 @@ description: |- Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here. --- -``Last updated: v2.5.4`` +``Last updated: v2.5.5`` --- +## 2.5.5 (May, 29 2023) + +### Notes + +- Release date: **(May, 29 2023)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #244](https://github.com/zscaler/terraform-provider-zia/pull/244) Fix ``zia_user_management`` to ensure when the ``auth_methods``attribute is set, and user password is changed, the provide will re-enroll the user to update the password. + ## 2.5.4 (May, 25 2023) ### Notes diff --git a/zia/resource_zia_user_management_users.go b/zia/resource_zia_user_management_users.go index 2a236a4f..b3a87b1c 100644 --- a/zia/resource_zia_user_management_users.go +++ b/zia/resource_zia_user_management_users.go @@ -213,7 +213,7 @@ func resourceUserManagementUpdate(d *schema.ResourceData, m interface{}) error { return err } authMethods := SetToStringList(d, "auth_methods") - if d.HasChange("auth_methods") && len(authMethods) > 0 { + if (d.HasChange("password") || d.HasChange("auth_methods")) && len(authMethods) > 0 { _, err := zClient.usermanagement.EnrollUser(id, usermanagement.EnrollUserRequest{ AuthMethods: authMethods, Password: req.Password,