Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: appfwprofile_sqlinjection_binding #1172

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ func deleteAppfwprofile_sqlinjection_bindingFunc(d *schema.ResourceData, meta in
args["sqlinjection"] = sqlinjection
args["formactionurl_sql"] = url.QueryEscape(d.Get("formactionurl_sql").(string))
args["as_scan_location_sql"] = d.Get("as_scan_location_sql").(string)
if val, ok := d.GetOk("as_value_type_sql"); ok {
args["as_value_type_sql"] = val.(string)
}
if val, ok := d.GetOk("as_value_expr_sql"); ok {
args["as_value_expr_sql"] = val.(string)
}

err := client.DeleteResourceWithArgsMap(service.Appfwprofile_sqlinjection_binding.Type(), appFwName, args)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,51 @@ const testAccAppfwprofile_sqlinjection_binding_basic = `
}
`

const testAccAppfwprofile_sqlinjection_binding_as_value_type_sql = `
resource citrixadc_appfwprofile_sqlinjection_binding demo_as_value_type_sql_binding {
name = citrixadc_appfwprofile.demo_appfw_as_value_type_sql.name
sqlinjection= "demo_binding"
as_scan_location_sql= "HEADER"
as_value_type_sql= "Keyword"
as_value_expr_sql= "example1"
formactionurl_sql= "www.example.com"
state= "ENABLED"
isregex_sql= "NOTREGEX"
}
resource citrixadc_appfwprofile demo_appfw_as_value_type_sql {
name = "demo_appfw_as_value_type_sql"
bufferoverflowaction = ["none"]
contenttypeaction = ["none"]
cookieconsistencyaction = ["none"]
creditcard = ["none"]
creditcardaction = ["none"]
crosssitescriptingaction = ["none"]
csrftagaction = ["none"]
denyurlaction = ["none"]
dynamiclearning = ["none"]
fieldconsistencyaction = ["none"]
fieldformataction = ["none"]
fileuploadtypesaction = ["none"]
inspectcontenttypes = ["none"]
jsondosaction = ["none"]
jsonsqlinjectionaction = ["none"]
jsonxssaction = ["none"]
multipleheaderaction = ["none"]
sqlinjectionaction = ["none"]
starturlaction = ["none"]
type = ["HTML"]
xmlattachmentaction = ["none"]
xmldosaction = ["none"]
xmlformataction = ["none"]
xmlsoapfaultaction = ["none"]
xmlsqlinjectionaction = ["none"]
xmlvalidationaction = ["none"]
xmlwsiaction = ["none"]
xmlxssaction = ["none"]
}
`

func TestAccAppfwprofile_sqlinjection_binding_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -84,6 +129,17 @@ func TestAccAppfwprofile_sqlinjection_binding_basic(t *testing.T) {
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_binding", "formactionurl_sql", "www.example.com"),
),
},
{
Config: testAccAppfwprofile_sqlinjection_binding_as_value_type_sql,
Check: resource.ComposeTestCheckFunc(
testAccCheckAppfwprofile_sqlinjection_bindingExist("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", nil),
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", "name", "demo_appfw_as_value_type_sql"),
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", "as_scan_location_sql", "HEADER"),
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", "formactionurl_sql", "www.example.com"),
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", "as_value_type_sql", "Keyword"),
resource.TestCheckResourceAttr("citrixadc_appfwprofile_sqlinjection_binding.demo_as_value_type_sql_binding", "as_value_expr_sql", "example1"),
),
},
},
})
}
Expand Down