Skip to content

Commit

Permalink
Add password import inline hook type (okta#168)
Browse files Browse the repository at this point in the history
Co-authored-by: noi narisak <noi.narisak@users.noreply.github.com>
  • Loading branch information
2 people authored and ymylei committed Sep 20, 2020
1 parent bbdec98 commit 1e5a66e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/okta_inline_hook/password_import.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource okta_inline_hook test {
name = "testAcc_replace_with_uuid"
status = "ACTIVE"
type = "com.okta.user.credential.password.import"
version = "1.0.0"

channel = {
type = "HTTP"
version = "1.0.0"
uri = "https://example.com/test1"
method = "POST"
}
}
1 change: 1 addition & 0 deletions okta/resource_okta_inline_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func resourceInlineHook() *schema.Resource {
"com.okta.import.transform",
"com.okta.saml.tokens.transform",
"com.okta.user.pre-registration",
"com.okta.user.credential.password.import",
},
false,
),
Expand Down
15 changes: 15 additions & 0 deletions okta/resource_okta_inline_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func TestAccOktaInlineHook_crud(t *testing.T) {
updatedConfig := mgr.GetFixtures("basic_updated.tf", ri, t)
activatedConfig := mgr.GetFixtures("basic_activated.tf", ri, t)
registration := mgr.GetFixtures("registration.tf", ri, t)
passwordImport := mgr.GetFixtures("password_import.tf", ri, t)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -80,6 +81,20 @@ func TestAccOktaInlineHook_crud(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "channel.method", "POST"),
),
},
{
Config: passwordImport,
Check: resource.ComposeTestCheckFunc(
ensureResourceExists(resourceName, inlineHookExists),
resource.TestCheckResourceAttr(resourceName, "name", buildResourceName(ri)),
resource.TestCheckResourceAttr(resourceName, "status", "ACTIVE"),
resource.TestCheckResourceAttr(resourceName, "type", "com.okta.user.credential.password.import"),
resource.TestCheckResourceAttr(resourceName, "version", "1.0.0"),
resource.TestCheckResourceAttr(resourceName, "channel.type", "HTTP"),
resource.TestCheckResourceAttr(resourceName, "channel.version", "1.0.0"),
resource.TestCheckResourceAttr(resourceName, "channel.uri", "https://example.com/test1"),
resource.TestCheckResourceAttr(resourceName, "channel.method", "POST"),
),
},
},
})
}
Expand Down

0 comments on commit 1e5a66e

Please sign in to comment.