Skip to content

Commit

Permalink
azuread_application: homepage now accepts HTTP/HTTPS
Browse files Browse the repository at this point in the history
Fixes #149
  • Loading branch information
evenh committed Oct 4, 2019
1 parent 1fcdc71 commit 663d772
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion azuread/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceApplication() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validate.URLIsHTTPS,
ValidateFunc: validate.URLIsHTTPOrHTTPS,
},

"identifier_uris": {
Expand Down
41 changes: 41 additions & 0 deletions azuread/resource_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,38 @@ func TestAccAzureADApplication_basic(t *testing.T) {
})
}

func TestAccAzureADApplication_http_homepage(t *testing.T) {
resourceName := "azuread_application.test"
id := uuid.New().String()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckADApplicationDestroy,
Steps: []resource.TestStep{
{
Config: testAccADApplication_basic(id),
Check: resource.ComposeTestCheckFunc(
testCheckADApplicationExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("acctestApp-%s", id)),
resource.TestCheckResourceAttr(resourceName, "homepage", fmt.Sprintf("http://homepage-%s", id)),
resource.TestCheckResourceAttr(resourceName, "oauth2_allow_implicit_flow", "false"),
resource.TestCheckResourceAttr(resourceName, "type", "webapp/api"),
resource.TestCheckResourceAttr(resourceName, "oauth2_permissions.#", "1"),
resource.TestCheckResourceAttr(resourceName, "oauth2_permissions.0.admin_consent_description", fmt.Sprintf("Allow the application to access %s on behalf of the signed-in user.", fmt.Sprintf("acctestApp-%s", id))),
resource.TestCheckResourceAttrSet(resourceName, "application_id"),
resource.TestCheckResourceAttrSet(resourceName, "object_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureADApplication_complete(t *testing.T) {
resourceName := "azuread_application.test"
id := uuid.New().String()
Expand Down Expand Up @@ -494,6 +526,15 @@ resource "azuread_application" "test" {
`, id)
}

func testAccADApplication_http_homepage(id string) string {
return fmt.Sprintf(`
resource "azuread_application" "test" {
name = "acctestApp-%s"
homepage = "http://homepage-%s"
}
`, id)
}

func testAccADApplication_publicClient(id string) string {
return fmt.Sprintf(`
resource "azuread_application" "test" {
Expand Down

0 comments on commit 663d772

Please sign in to comment.