Repository: cloudflare/cloudflare-go
Pull request #1832 (2024-04-22 22:47:56)

Add Fonts and Disable Rum to Configuration Rules
<!-- 
Provide a general summary of your changes in the title above. You should
remove this overview, any sections and any section descriptions you
don't need below before submitting. There isn't a strict requirement to
use this template if you can structure your description and still cover
these points. 
-->

## Description

<!--
Describe your changes in detail through motivation and context. Why is
this change required? What problem does it solve? If it fixes an open
issue, link to the issue using GitHub's closing issues keywords[1].
-->
## Has your change been tested?

<!--
Explain how the change has been tested and what you ran to confirm your
change affects other parts of the code. Automated tests are generally
expected and changes without tests should explain why they aren't
required.
-->

## Screenshots (if appropriate):

## Types of changes

What sort of change does your code introduce/modify?

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] This change is using publicly documented in [cloudflare/api-schemas](https://github.com/cloudflare/api-schemas) 
      and relies on stable APIs.

[1]: https://help.github.com/articles/closing-issues-using-keywords/


github-actions[bot]: Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example: 

~~~
```release-note:TYPE
Release note
```
~~~

If you do not require a release note to be included, please add the `workflow/skip-changelog-entry` label.

Patch:
diff --git a/.changelog/1832.txt b/.changelog/1832.txt
new file mode 100644
index 000000000..4f09ea2c1
--- /dev/null
+++ b/.changelog/1832.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+ruleset: add support for action parameters `fonts` and `disable_rum`
+```
diff --git a/rulesets.go b/rulesets.go
index c8a476251..8b1ad430a 100644
--- a/rulesets.go
+++ b/rulesets.go
@@ -246,7 +246,9 @@ type RulesetRuleActionParameters struct {
 	DisableApps              *bool                                             `json:"disable_apps,omitempty"`
 	DisableZaraz             *bool                                             `json:"disable_zaraz,omitempty"`
 	DisableRailgun           *bool                                             `json:"disable_railgun,omitempty"`
+	DisableRUM               *bool                                             `json:"disable_rum,omitempty"`
 	EmailObfuscation         *bool                                             `json:"email_obfuscation,omitempty"`
+	Fonts                    *bool                                             `json:"fonts,omitempty"`
 	Mirage                   *bool                                             `json:"mirage,omitempty"`
 	OpportunisticEncryption  *bool                                             `json:"opportunistic_encryption,omitempty"`
 	Polish                   *Polish                                           `json:"polish,omitempty"`


Test patch:
diff --git a/rulesets_test.go b/rulesets_test.go
index 91f432529..dbaf2b4f1 100644
--- a/rulesets_test.go
+++ b/rulesets_test.go
@@ -403,7 +403,9 @@ func TestGetRuleset_SetConfig(t *testing.T) {
 				"server_side_excludes":true,
 				"ssl":"off",
 				"sxg":true,
-				"hotlink_protection":true
+				"hotlink_protection":true,
+				"fonts":true,
+				"disable_rum":true
             },
 			"description": "Set all available config rules in one rule",
 			"last_updated": "2020-12-18T09:28:09.655749Z",
@@ -440,7 +442,9 @@ func TestGetRuleset_SetConfig(t *testing.T) {
 			DisableApps:             BoolPtr(true),
 			DisableZaraz:            BoolPtr(true),
 			DisableRailgun:          BoolPtr(true),
+			DisableRUM:              BoolPtr(true),
 			EmailObfuscation:        BoolPtr(true),
+			Fonts:                   BoolPtr(true),
 			Mirage:                  BoolPtr(true),
 			OpportunisticEncryption: BoolPtr(true),
 			Polish:                  PolishOff.IntoRef(),