Skip to content

Commit

Permalink
Merge branch 'master' into add-content-scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz authored Dec 26, 2024
2 parents ec5c9e3 + 7bf2738 commit 6d23268
Show file tree
Hide file tree
Showing 23 changed files with 599 additions and 245 deletions.
3 changes: 3 additions & 0 deletions .changelog/4734.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
cloudflare_content_scanning_expression
```
3 changes: 3 additions & 0 deletions .changelog/4743.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/access_application: support multi-valued + Access service token authentication for SCIM provisioning to Access applications
```
3 changes: 3 additions & 0 deletions .changelog/4814.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_ruleset: handle when `disable_stale_while_updating` is an empty object but not nil
```
3 changes: 3 additions & 0 deletions .changelog/4817.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
resource/cloudflare_teams_location: remove unusable `policy_ids` attribute
```
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
## 4.49.0 (Unreleased)
## 4.50.0 (Unreleased)

## 4.49.0 (December 25th, 2025)

NOTES:

* resource/cloudflare_teams_location: remove unusable `policy_ids` attribute ([#4817](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4817))

FEATURES:

* **New Resource:** `cloudflare_content_scanning_expression` ([#4734](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4734))

ENHANCEMENTS:

* resource/access_application: support multi-valued + Access service token authentication for SCIM provisioning to Access applications ([#4743](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4743))

BUG FIXES:

* resource/cloudflare_ruleset: handle when `disable_stale_while_updating` is an empty object but not nil ([#4814](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4814))

DEPENDENCIES:

* provider: bump github.com/cloudflare/cloudflare-go from 0.111.0 to 0.112.0 ([#4803](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4803))
* provider: bump github.com/hashicorp/terraform-plugin-framework-validators from 0.15.0 to 0.16.0 ([#4762](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4762))
* provider: bump golang.org/x/crypto from 0.21.0 to 0.31.0 in /tools ([#4755](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4755))
* provider: bump golang.org/x/crypto from 0.30.0 to 0.31.0 ([#4756](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4756))
* provider: bump golang.org/x/net from 0.32.0 to 0.33.0 ([#4802](https://github.com/cloudflare/terraform-provider-cloudflare/issues/4802))

## 4.48.0 (December 11th, 2024)

Expand Down
18 changes: 9 additions & 9 deletions docs/resources/access_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Required:

Optional:

- `authentication` (Block List, Max: 1) Attributes for configuring HTTP Basic, OAuth Bearer token, or OAuth 2 authentication schemes for SCIM provisioning to an application. (see [below for nested schema](#nestedblock--scim_config--authentication))
- `authentication` (Block List) Attributes for configuring HTTP Basic, OAuth Bearer token, or OAuth 2 authentication schemes for SCIM provisioning to an application. (see [below for nested schema](#nestedblock--scim_config--authentication))
- `deactivate_on_delete` (Boolean) If false, propagates DELETE requests to the target application for SCIM resources. If true, sets 'active' to false on the SCIM resource. Note: Some targets do not support DELETE operations.
- `enabled` (Boolean) Whether SCIM provisioning is turned on for this application.
- `mappings` (Block List) A list of mappings to apply to SCIM resources before provisioning them in this application. These can transform or filter the resources to be provisioned. (see [below for nested schema](#nestedblock--scim_config--mappings))
Expand All @@ -295,14 +295,14 @@ Required:

Optional:

- `authorization_url` (String) URL used to generate the auth code used during token generation. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `client_id` (String) Client ID used to authenticate when generating a token for authenticating with the remote SCIM service. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `client_secret` (String) Secret used to authenticate when generating a token for authenticating with the remove SCIM service. Required when using `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `password` (String) Required when using `scim_config.0.authentication.0.user`. Conflicts with `scim_config.0.authentication.0.token`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `scopes` (Set of String) The authorization scopes to request when generating the token used to authenticate with the remove SCIM service. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `token` (String) Token used to authenticate with the remote SCIM service. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `token_url` (String) URL used to generate the token used to authenticate with the remote SCIM service. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.client_id`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `user` (String) User name used to authenticate with the remote SCIM service. Required when using `scim_config.0.authentication.0.password`. Conflicts with `scim_config.0.authentication.0.token`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `authorization_url` (String) URL used to generate the auth code used during token generation.
- `client_id` (String) Client ID used to authenticate when generating a token for authenticating with the remote SCIM service.
- `client_secret` (String) Secret used to authenticate when generating a token for authenticating with the remove SCIM service.
- `password` (String)
- `scopes` (Set of String) The authorization scopes to request when generating the token used to authenticate with the remove SCIM service.
- `token` (String) Token used to authenticate with the remote SCIM service.
- `token_url` (String) URL used to generate the token used to authenticate with the remote SCIM service.
- `user` (String) User name used to authenticate with the remote SCIM service.


<a id="nestedblock--scim_config--mappings"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/cloud_connector_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
page_title: "cloudflare_cloud_connector_rules Resource - Cloudflare"
subcategory: ""
description: |-
The Cloud Connector Rules resource allows you to create and manage cloud connector rules for a zone.
The Cloud Connector Rules https://developers.cloudflare.com/rules/cloud-connector/ resource allows you to create and manage cloud connector rules for a zone.
---

# cloudflare_cloud_connector_rules (Resource)
Expand Down
49 changes: 49 additions & 0 deletions docs/resources/content_scanning_expression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
page_title: "cloudflare_content_scanning_expression Resource - Cloudflare"
subcategory: ""
description: |-
Provides a Cloudflare Content Scanning Expression resource for managing custom scan expression within a specific zone.
---

# cloudflare_content_scanning_expression (Resource)

Provides a Cloudflare Content Scanning Expression resource for managing custom scan expression within a specific zone.

## Example Usage

```terraform
# Enable Content Scanning before trying to add custom scan expressions
resource "cloudflare_content_scanning" "example" {
zone_id = "399c6f4950c01a5a141b99ff7fbcbd8b"
enabled = true
}
resource "cloudflare_content_scanning_expression" "first_example" {
zone_id = cloudflare_content_scanning.example.zone_id
payload = "lookup_json_string(http.request.body.raw, \"file\")"
}
resource "cloudflare_content_scanning_expression" "second_example" {
zone_id = cloudflare_content_scanning.example.zone_id
payload = "lookup_json_string(http.request.body.raw, \"document\")"
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `payload` (String) Custom scan expression to tell the content scanner where to find the content objects.
- `zone_id` (String) The zone identifier to target for the resource.

### Read-Only

- `id` (String) The identifier of this resource.

## Import

Import is supported using the following syntax:

```shell
terraform import cloudflare_content_scanning_expression.example <zone_id>/<resource_id>
```
1 change: 0 additions & 1 deletion docs/resources/teams_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ resource "cloudflare_teams_location" "example" {
- `id` (String) The ID of this resource.
- `ip` (String) Client IP address.
- `ipv4_destination` (String) IP to direct all IPv4 DNS queries to.
- `policy_ids` (List of String)

<a id="nestedblock--networks"></a>
### Nested Schema for `networks`
Expand Down
18 changes: 9 additions & 9 deletions docs/resources/zero_trust_access_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Required:

Optional:

- `authentication` (Block List, Max: 1) Attributes for configuring HTTP Basic, OAuth Bearer token, or OAuth 2 authentication schemes for SCIM provisioning to an application. (see [below for nested schema](#nestedblock--scim_config--authentication))
- `authentication` (Block List) Attributes for configuring HTTP Basic, OAuth Bearer token, or OAuth 2 authentication schemes for SCIM provisioning to an application. (see [below for nested schema](#nestedblock--scim_config--authentication))
- `deactivate_on_delete` (Boolean) If false, propagates DELETE requests to the target application for SCIM resources. If true, sets 'active' to false on the SCIM resource. Note: Some targets do not support DELETE operations.
- `enabled` (Boolean) Whether SCIM provisioning is turned on for this application.
- `mappings` (Block List) A list of mappings to apply to SCIM resources before provisioning them in this application. These can transform or filter the resources to be provisioned. (see [below for nested schema](#nestedblock--scim_config--mappings))
Expand All @@ -276,14 +276,14 @@ Required:

Optional:

- `authorization_url` (String) URL used to generate the auth code used during token generation. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `client_id` (String) Client ID used to authenticate when generating a token for authenticating with the remote SCIM service. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `client_secret` (String) Secret used to authenticate when generating a token for authenticating with the remove SCIM service. Required when using `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `password` (String) Required when using `scim_config.0.authentication.0.user`. Conflicts with `scim_config.0.authentication.0.token`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `scopes` (Set of String) The authorization scopes to request when generating the token used to authenticate with the remove SCIM service. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `token` (String) Token used to authenticate with the remote SCIM service. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `token_url` (String) URL used to generate the token used to authenticate with the remote SCIM service. Required when using `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.client_id`. Conflicts with `scim_config.0.authentication.0.user`, `scim_config.0.authentication.0.password`, `scim_config.0.authentication.0.token`.
- `user` (String) User name used to authenticate with the remote SCIM service. Required when using `scim_config.0.authentication.0.password`. Conflicts with `scim_config.0.authentication.0.token`, `scim_config.0.authentication.0.client_id`, `scim_config.0.authentication.0.client_secret`, `scim_config.0.authentication.0.authorization_url`, `scim_config.0.authentication.0.token_url`, `scim_config.0.authentication.0.scopes`.
- `authorization_url` (String) URL used to generate the auth code used during token generation.
- `client_id` (String) Client ID used to authenticate when generating a token for authenticating with the remote SCIM service.
- `client_secret` (String) Secret used to authenticate when generating a token for authenticating with the remove SCIM service.
- `password` (String)
- `scopes` (Set of String) The authorization scopes to request when generating the token used to authenticate with the remove SCIM service.
- `token` (String) Token used to authenticate with the remote SCIM service.
- `token_url` (String) URL used to generate the token used to authenticate with the remote SCIM service.
- `user` (String) User name used to authenticate with the remote SCIM service.


<a id="nestedblock--scim_config--mappings"></a>
Expand Down
1 change: 0 additions & 1 deletion docs/resources/zero_trust_dns_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ resource "cloudflare_zero_trust_dns_location" "example" {
- `id` (String) The ID of this resource.
- `ip` (String) Client IP address.
- `ipv4_destination` (String) IP to direct all IPv4 DNS queries to.
- `policy_ids` (List of String)

<a id="nestedblock--networks"></a>
### Nested Schema for `networks`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import cloudflare_content_scanning_expression.example <zone_id>/<resource_id>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Enable Content Scanning before trying to add custom scan expressions
resource "cloudflare_content_scanning" "example" {
zone_id = "399c6f4950c01a5a141b99ff7fbcbd8b"
enabled = true
}

resource "cloudflare_content_scanning_expression" "first_example" {
zone_id = cloudflare_content_scanning.example.zone_id
payload = "lookup_json_string(http.request.body.raw, \"file\")"
}

resource "cloudflare_content_scanning_expression" "second_example" {
zone_id = cloudflare_content_scanning.example.zone_id
payload = "lookup_json_string(http.request.body.raw, \"document\")"
}
2 changes: 2 additions & 0 deletions internal/framework/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/api_token_permissions_groups"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/cloud_connector_rules"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/content_scanning"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/content_scanning_expression"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/d1"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/dcv_delegation"
"github.com/cloudflare/terraform-provider-cloudflare/internal/framework/service/dlp_datasets"
Expand Down Expand Up @@ -397,6 +398,7 @@ func (p *CloudflareProvider) Resources(ctx context.Context) []func() resource.Re
leaked_credential_check.NewResource,
leaked_credential_check_rule.NewResource,
content_scanning.NewResource,
content_scanning_expression.NewResource,
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package content_scanning_expression

import "github.com/hashicorp/terraform-plugin-framework/types"

type ContentScanningExpressionModel struct {
ZoneID types.String `tfsdk:"zone_id"`
ID types.String `tfsdk:"id"`
Payload types.String `tfsdk:"payload"`
}
Loading

0 comments on commit 6d23268

Please sign in to comment.