Skip to content

Commit

Permalink
fixup! fixup! feature: add LDAP auth-method, accounts and managed gro…
Browse files Browse the repository at this point in the history
…ups support
  • Loading branch information
jimlambrt committed Mar 15, 2023
1 parent 7b67490 commit 909a0ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions internal/provider/resource_account_ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func resourceAccountLdap() *schema.Resource {
Description: "The login name for this account.",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
},
}
Expand Down
14 changes: 8 additions & 6 deletions internal/provider/resource_account_ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
const (
testAccountLdapDesc = "test account"
testAccountLdapDescUpdate = "test account update"
testAccountLdapName = "test account name"
testAccountLdapNameUpdate = "test account name updated"
)

var (
Expand All @@ -30,12 +32,12 @@ resource "boundary_auth_method_ldap" "foo" {
}
resource "boundary_account_ldap" "foo" {
name = "test"
name = "%s"
description = "%s"
type = "ldap"
login_name = "foo"
auth_method_id = boundary_auth_method_ldap.foo.id
}`, testAccountLdapDesc)
}`, testAccountLdapName, testAccountLdapDesc)

testAccountLdapUpdate = fmt.Sprintf(`
resource "boundary_auth_method_ldap" "foo" {
Expand All @@ -48,12 +50,12 @@ resource "boundary_auth_method_ldap" "foo" {
}
resource "boundary_account_ldap" "foo" {
name = "test"
name = "%s"
description = "%s"
type = "ldap"
login_name = "foo"
auth_method_id = boundary_auth_method_ldap.foo.id
}`, testAccountLdapDescUpdate)
}`, testAccountLdapNameUpdate, testAccountLdapDescUpdate)
)

func TestAccLdapAccount(t *testing.T) {
Expand All @@ -72,7 +74,7 @@ func TestAccLdapAccount(t *testing.T) {
Config: testConfig(url, fooOrg, testAccountLdap),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "description", testAccountLdapDesc),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "name", testAccountLdapName),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "type", "ldap"),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "login_name", "foo"),
testAccCheckAccountResourceExists(provider, "boundary_account_ldap.foo"),
Expand All @@ -84,7 +86,7 @@ func TestAccLdapAccount(t *testing.T) {
Config: testConfig(url, fooOrg, testAccountLdapUpdate),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "description", testAccountLdapDescUpdate),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "name", testAccountLdapNameUpdate),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "type", "ldap"),
resource.TestCheckResourceAttr("boundary_account_ldap.foo", "login_name", "foo"),
testAccCheckAccountResourceExists(provider, "boundary_account_ldap.foo"),
Expand Down

0 comments on commit 909a0ff

Please sign in to comment.