From b5eff7127d05834ab3d1a0afb1cafab7a0c37733 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 10 May 2024 09:50:24 -0700 Subject: [PATCH 1/3] Update user password validation to min length To 8 characters which matches both cloud and self-hosted default length. --- docs/resources/managed_user.md | 2 +- .../resource/user/resource_artifactory_managed_user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/managed_user.md b/docs/resources/managed_user.md index 8bacd671..a2f527fb 100644 --- a/docs/resources/managed_user.md +++ b/docs/resources/managed_user.md @@ -40,7 +40,7 @@ resource "artifactory_managed_user" "test-user" { - `disable_ui_access` (Boolean) (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges. - `groups` (Set of String) List of groups this user is a part of. **Notes:** If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically. - `internal_password_disabled` (Boolean) (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled. -- `password` (String, Sensitive) (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters +- `password` (String, Sensitive) (Optional, Sensitive) Password for the user. - `profile_updatable` (Boolean) (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members. ### Read-Only diff --git a/pkg/artifactory/resource/user/resource_artifactory_managed_user.go b/pkg/artifactory/resource/user/resource_artifactory_managed_user.go index 19b1d8f8..0b76fc17 100644 --- a/pkg/artifactory/resource/user/resource_artifactory_managed_user.go +++ b/pkg/artifactory/resource/user/resource_artifactory_managed_user.go @@ -28,7 +28,7 @@ func (r *ArtifactoryManagedUserResource) Schema(ctx context.Context, req resourc MarkdownDescription: "Password for the user.", Required: true, Sensitive: true, - Validators: []validator.String{stringvalidator.LengthAtLeast(12)}, + Validators: []validator.String{stringvalidator.LengthAtLeast(8)}, }, } From 0b1263c52099fada63215e8efb42eca67a25c177 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 10 May 2024 10:19:05 -0700 Subject: [PATCH 2/3] Fix failed test --- .../resource/security/resource_artifactory_scoped_token_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/artifactory/resource/security/resource_artifactory_scoped_token_test.go b/pkg/artifactory/resource/security/resource_artifactory_scoped_token_test.go index 2ecf9696..0f2003b3 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_scoped_token_test.go +++ b/pkg/artifactory/resource/security/resource_artifactory_scoped_token_test.go @@ -126,7 +126,7 @@ func TestAccScopedToken_UpgradeGH_818(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(fqrn, "username", "testuser"), resource.TestCheckResourceAttr(fqrn, "scopes.#", "1"), - resource.TestCheckResourceAttr(fqrn, "expires_in", "31536000"), + resource.TestCheckResourceAttr(fqrn, "expires_in", "32000000"), resource.TestCheckNoResourceAttr(fqrn, "audiences"), resource.TestCheckResourceAttrSet(fqrn, "access_token"), resource.TestCheckNoResourceAttr(fqrn, "refresh_token"), From ccad13ef70fe5a297542939a65f5d1fe2da9cec5 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 10 May 2024 10:20:28 -0700 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 560626f9..7af7d44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 10.7.6 (May 10, 2024) + +BUG FIXES: + +* resource/artifactory_managed_user: Update `password` minimum length validation to 8 characters which matches default length for both cloud and self-hosted versions. Issue: [#959](https://github.com/jfrog/terraform-provider-artifactory/issues/959) PR: [#962](https://github.com/jfrog/terraform-provider-artifactory/pull/962) + ## 10.7.5 (May 2, 2024) IMPROVEMENTS: