-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ith-no-password Explicitly set state value for 'password' attribute
- Loading branch information
Showing
13 changed files
with
94 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ func TestAccAccessTokenAudienceBad(t *testing.T) { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -52,7 +52,7 @@ func TestAccAccessTokenAudienceGood(t *testing.T) { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -95,7 +95,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -142,7 +142,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -185,7 +185,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -216,7 +216,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -249,7 +249,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -354,7 +354,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -386,7 +386,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
@@ -433,7 +433,7 @@ resource "artifactory_managed_user" "existinguser" { | |
email = "[email protected]" | ||
admin = false | ||
groups = ["readers"] | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_access_token" "foobar" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ const permissionFull = ` | |
resource "artifactory_managed_user" "test-user" { | ||
name = "terraform" | ||
email = "[email protected]" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
} | ||
resource "artifactory_permission_target" "{{ .permission_name }}" { | ||
|
@@ -250,7 +250,7 @@ func TestAccPermissionTarget_GitHubIssue126(t *testing.T) { | |
admin = false | ||
disable_ui_access = true | ||
internal_password_disabled = false | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_permission_target" "{{ .perm_name }}" { | ||
|
@@ -500,7 +500,7 @@ func TestAccPermissionTarget_MissingRepositories(t *testing.T) { | |
admin = false | ||
disable_ui_access = true | ||
internal_password_disabled = true | ||
password = "Passw0rd!" | ||
password = "Passw0rd!123" | ||
} | ||
resource "artifactory_permission_target" "{{ .perm_name }}" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ func TestAccManagedUser_UpgradeFromSDKv2(t *testing.T) { | |
resource "artifactory_managed_user" "{{ .name }}" { | ||
name = "{{ .name }}" | ||
email = "{{ .email }}" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
} | ||
`, params) | ||
|
||
|
@@ -64,7 +64,7 @@ func TestAccManagedUser_no_groups(t *testing.T) { | |
resource "artifactory_managed_user" "%s" { | ||
name = "%s" | ||
email = "dummy%[email protected]" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
} | ||
` | ||
id, fqrn, name := testutil.MkNames("foobar-", "artifactory_managed_user") | ||
|
@@ -97,7 +97,7 @@ func TestAccManagedUser_empty_groups(t *testing.T) { | |
resource "artifactory_managed_user" "%s" { | ||
name = "%s" | ||
email = "dummy%[email protected]" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
groups = [] | ||
} | ||
` | ||
|
@@ -138,16 +138,17 @@ func TestAccManagedUser_invalidName(t *testing.T) { | |
} | ||
|
||
for _, tc := range testCase { | ||
t.Run(tc.name, testAccManagedUserInvalidName(t, tc.username, tc.errorRegex)) | ||
t.Run(tc.name, testAccManagedUserInvalidName(tc.username, tc.errorRegex)) | ||
} | ||
} | ||
|
||
func testAccManagedUserInvalidName(t *testing.T, username, errorRegex string) func(t *testing.T) { | ||
func testAccManagedUserInvalidName(username, errorRegex string) func(t *testing.T) { | ||
return func(t *testing.T) { | ||
const userNoGroups = ` | ||
resource "artifactory_managed_user" "%s" { | ||
name = "%s" | ||
email = "dummy%[email protected]" | ||
password = "Passsw0rd!12" | ||
} | ||
` | ||
id, fqrn, name := testutil.MkNames("test-", "artifactory_managed_user") | ||
|
@@ -187,7 +188,7 @@ func TestAccManagedUser_basic(t *testing.T) { | |
resource "artifactory_managed_user" "{{ .name }}" { | ||
name = "{{ .username }}" | ||
email = "{{ .email }}" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
admin = true | ||
profile_updatable = true | ||
disable_ui_access = false | ||
|
@@ -205,7 +206,7 @@ func TestAccManagedUser_basic(t *testing.T) { | |
resource "artifactory_managed_user" "{{ .name }}" { | ||
name = "{{ .username }}" | ||
email = "{{ .email }}" | ||
password = "Passsw0rd!" | ||
password = "Passsw0rd!12" | ||
admin = false | ||
profile_updatable = false | ||
groups = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,10 +118,17 @@ func TestAccUnmanagedUser_basic(t *testing.T) { | |
} | ||
|
||
func TestAccUnmanagedUserShouldCreateWithoutPassword(t *testing.T) { | ||
const userBasic = ` | ||
const config = ` | ||
resource "artifactory_unmanaged_user" "%s" { | ||
name = "%s" | ||
email = "dummy_user%[email protected]" | ||
} | ||
` | ||
const updatedConfig = ` | ||
resource "artifactory_unmanaged_user" "%s" { | ||
name = "%s" | ||
email = "dummy_user%[email protected]" | ||
profile_updatable = false | ||
} | ||
` | ||
id := testutil.RandomInt() | ||
|
@@ -134,13 +141,19 @@ func TestAccUnmanagedUserShouldCreateWithoutPassword(t *testing.T) { | |
CheckDestroy: testAccCheckUserDestroy(fqrn), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: fmt.Sprintf(userBasic, name, username, id), | ||
Config: fmt.Sprintf(config, name, username, id), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr(fqrn, "name", username), | ||
resource.TestCheckResourceAttr(fqrn, "email", fmt.Sprintf("dummy_user%[email protected]", id)), | ||
resource.TestCheckNoResourceAttr(fqrn, "groups"), | ||
), | ||
}, | ||
{ | ||
Config: fmt.Sprintf(updatedConfig, name, username, id), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr(fqrn, "profile_updatable", "false"), | ||
), | ||
}, | ||
{ | ||
ResourceName: fqrn, | ||
ImportState: true, | ||
|
@@ -283,11 +296,11 @@ func TestAccUnmanagedUser_invalidName(t *testing.T) { | |
} | ||
|
||
for _, tc := range testCase { | ||
t.Run(tc.name, testAccUnmanagedUserInvalidName(t, tc.username, tc.errorRegex)) | ||
t.Run(tc.name, testAccUnmanagedUserInvalidName(tc.username, tc.errorRegex)) | ||
} | ||
} | ||
|
||
func testAccUnmanagedUserInvalidName(t *testing.T, username, errorRegex string) func(t *testing.T) { | ||
func testAccUnmanagedUserInvalidName(username, errorRegex string) func(t *testing.T) { | ||
return func(t *testing.T) { | ||
const userNoGroups = ` | ||
resource "artifactory_unmanaged_user" "%s" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.