Skip to content

Commit de406f2

Browse files
committed
Revert "Updating password key to be consistent with other credential types"
This reverts commit bfae06d.
1 parent bfae06d commit de406f2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

internal/provider/resource_credential_password.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
const (
17-
credentialPasswordPassworKey = "password"
17+
credentialPasswordKey = "password"
1818
credentialPasswordHmacKey = "password_hmac"
1919
credentialPasswordCredentialType = "password"
2020
)
@@ -53,7 +53,7 @@ func resourceCredentialPassword() *schema.Resource {
5353
ForceNew: true,
5454
Required: true,
5555
},
56-
credentialPasswordPassworKey: {
56+
credentialPasswordKey: {
5757
Description: "The password of this password credential.",
5858
Type: schema.TypeString,
5959
Required: true,
@@ -87,7 +87,7 @@ func setFromCredentialPasswordResponseMap(d *schema.ResourceData, raw map[string
8787
if statePasswordHmac.(string) != boundaryPasswordHmac && fromRead {
8888
// PasswordHmac has changed in Boundary, therefore the password has changed.
8989
// Update password value to force tf to attempt update.
90-
if err := d.Set(credentialPasswordPassworKey, "(changed in Boundary)"); err != nil {
90+
if err := d.Set(credentialPasswordKey, "(changed in Boundary)"); err != nil {
9191
return err
9292
}
9393
}
@@ -112,7 +112,7 @@ func resourceCredentialPasswordCreate(ctx context.Context, d *schema.ResourceDat
112112
opts = append(opts, credentials.WithDescription(v.(string)))
113113
}
114114

115-
if v, ok := d.GetOk(credentialPasswordPassworKey); ok {
115+
if v, ok := d.GetOk(credentialPasswordKey); ok {
116116
opts = append(opts, credentials.WithPasswordCredentialPassword(v.(string)))
117117
}
118118

@@ -184,8 +184,8 @@ func resourceCredentialPasswordUpdate(ctx context.Context, d *schema.ResourceDat
184184
}
185185
}
186186

187-
if d.HasChange(credentialPasswordPassworKey) {
188-
passwordVal, ok := d.GetOk(credentialPasswordPassworKey)
187+
if d.HasChange(credentialPasswordKey) {
188+
passwordVal, ok := d.GetOk(credentialPasswordKey)
189189
if ok {
190190
opts = append(opts, credentials.WithPasswordCredentialPassword(passwordVal.(string)))
191191
}

internal/provider/resource_credential_password_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,38 @@ func TestAccCredentialPassword(t *testing.T) {
7070
Check: resource.ComposeTestCheckFunc(
7171
resource.TestCheckResourceAttr(passwordCredResc, NameKey, passwordCredName),
7272
resource.TestCheckResourceAttr(passwordCredResc, DescriptionKey, passwordCredDesc),
73-
resource.TestCheckResourceAttr(passwordCredResc, credentialPasswordPassworKey, passwordCredPassword),
73+
resource.TestCheckResourceAttr(passwordCredResc, credentialPasswordKey, passwordCredPassword),
7474

7575
testAccCheckCredentialPasswordHmac(),
7676
testAccCheckCredentialResourceExists(provider, passwordCredResc),
7777
),
7878
},
79-
importStep(passwordCredResc, credentialPasswordPassworKey),
79+
importStep(passwordCredResc, credentialPasswordKey),
8080
{
8181
// update
8282
Config: testConfig(url, fooOrg, firstProjectFoo, resUpdate),
8383
Check: resource.ComposeTestCheckFunc(
8484
resource.TestCheckResourceAttr(passwordCredResc, NameKey, passwordCredName),
8585
resource.TestCheckResourceAttr(passwordCredResc, DescriptionKey, passwordCredDesc),
86-
resource.TestCheckResourceAttr(passwordCredResc, credentialPasswordPassworKey, passwordCredPassword+passwordCredUpdate),
86+
resource.TestCheckResourceAttr(passwordCredResc, credentialPasswordKey, passwordCredPassword+passwordCredUpdate),
8787

8888
testAccCheckCredentialPasswordHmac(),
8989
testAccCheckCredentialResourceExists(provider, passwordCredResc),
9090
),
9191
},
92-
importStep(passwordCredResc, credentialPasswordPassworKey),
92+
importStep(passwordCredResc, credentialPasswordKey),
9393
{
9494
// Run a plan only update and verify no changes
9595
PlanOnly: true,
9696
Config: testConfig(url, fooOrg, firstProjectFoo, resUpdate),
9797
},
98-
importStep(passwordCredResc, credentialPasswordPassworKey),
98+
importStep(passwordCredResc, credentialPasswordKey),
9999
{
100100
// update again but apply a preConfig to externally update resource
101101
PreConfig: func() { passwordCredExternalUpdate(t, provider) },
102102
Config: testConfig(url, fooOrg, firstProjectFoo, resUpdate),
103103
},
104-
importStep(passwordCredResc, credentialPasswordPassworKey),
104+
importStep(passwordCredResc, credentialPasswordKey),
105105
},
106106
})
107107
}

0 commit comments

Comments
 (0)