Skip to content

Commit

Permalink
Added fix for AS3 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
urohit011 committed May 7, 2024
1 parent 00709a1 commit b209d45
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bigip/datasource_bigip_waf_entity_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func dataSourceBigipWafEntityUrl() *schema.Resource {
},
},
},
"cross_domain_allowed_origins": {
"cross_origin_requests_enforcement": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Expand Down Expand Up @@ -160,14 +160,14 @@ func dataSourceBigipWafEntityUrlRead(ctx context.Context, d *schema.ResourceData
urlJson.MethodsOverrideOnUrlCheck = true
}

allowedOriginsCount := d.Get("cross_domain_allowed_origins.#").(int)
allowedOriginsCount := d.Get("cross_origin_requests_enforcement.#").(int)
if allowedOriginsCount > 0 {
urlJson.HTML5CrossOriginRequestsEnforcement.EnforcementMode = "enforce"

allowedOrigins := make([]bigip.WafUrlAllowedOrigins, 0, allowedOriginsCount)
for i := 0; i < allowedOriginsCount; i++ {
var a bigip.WafUrlAllowedOrigins
prefix := fmt.Sprintf("cross_domain_allowed_origins.%d", i)
prefix := fmt.Sprintf("cross_origin_requests_enforcement.%d", i)
a.IncludeSubdomains = d.Get(prefix + ".include_subdomains").(bool)
a.OriginName = d.Get(prefix + ".origin_name").(string)
a.OriginPort = d.Get(prefix + ".origin_port").(string)
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/bigip_waf_entity_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ data "bigip_waf_entity_url" "WAFURL1" {
allow = true
method = "BDELETE"
}
cross_domain_allowed_origins {
cross_origin_requests_enforcement {
include_subdomains = true
origin_name = "app1.com"
origin_port = "80"
origin_protocol = "http"
}
cross_domain_allowed_origins {
cross_origin_requests_enforcement {
include_subdomains = true
origin_name = "app2.com"
origin_port = "443"
Expand All @@ -58,7 +58,7 @@ data "bigip_waf_entity_url" "WAFURL1" {
* `method_overrides` - (Optional) A list of methods that are allowed or disallowed for a specific URL.
* `allow` - (Required) Specifies that the system allows or disallows a method for this URL
* `method` - (Required) Specifies an HTTP method.
* `cross_domain_allowed_origins` - (Optional) A list of options that enables your web-application to share data with a website hosted on a
* `cross_origin_requests_enforcement` - (Optional) A list of options that enables your web-application to share data with a website hosted on a
different domain.
* `include_subdomains` - (Required) Determines whether the subdomains are allowed to receive data from the web application.
* `origin_name` - (Required) Specifies the name of the origin with which you want to share your data.
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/f5devcentral/go-bigip/awaf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/f5devcentral/go-bigip/bigiq.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b209d45

Please sign in to comment.