From ff2a3d0bc1fcad0b4f4f5aa3edfdc17dbec18507 Mon Sep 17 00:00:00 2001 From: Frida Safran Date: Sun, 17 Dec 2023 15:21:21 +0200 Subject: [PATCH] NSOF-8280 provider: remove deprecated ufr catalog_app_risk field --- docs/data-sources/url_filtering_rule.md | 1 - docs/resources/url_filtering_rule.md | 1 - internal/client/url_filtering_rule.go | 2 -- internal/provider/url_filtering_rule/common.go | 5 ++--- internal/provider/url_filtering_rule/data_source.go | 5 ----- internal/provider/url_filtering_rule/resource.go | 6 ------ 6 files changed, 2 insertions(+), 18 deletions(-) diff --git a/docs/data-sources/url_filtering_rule.md b/docs/data-sources/url_filtering_rule.md index beeef39d..463b7088 100644 --- a/docs/data-sources/url_filtering_rule.md +++ b/docs/data-sources/url_filtering_rule.md @@ -37,7 +37,6 @@ This action determines what must be done according to this URL filtering rule if - `apply_to_org` (Boolean) indicates whether this URL filtering rule applies to the org. - `catalog_app_categories` (List of String) ENUM: `Instant Messaging`, `eCommerce`, `Content Management`, `Software Development`, `Project Management`, `Marketing`, `CRM`, `Telecommunications`, `Social and Communication`, `Productivity`, `Collaboration`, `Business and Finance`, `Utilities`, `IT Service Management`, `Social Networking`, `Office Document and Productivity`, `Cloud File Sharing`, `Web Meetings`, `Identity and Access Management`, `IT Services and Hosting`, `Webmail`, `Website Builder`, `Human Capital Management`, `Sales and CRM`, `E-commerce and Accounting`, `Streaming Media`, `Cloud Storage`, `Operations Management`, `Online Meeting`, `Supply Chain`, `Security and Compliance`, `Entertainment and Lifestyle`, `System and Network`, `Retail and Consumer Services`, `Health and Benefits`, `Data and Analytics`, `Education and References`, `Personal instant messaging`, `Legal`, `Other`, `Hosting Services`, `News and Media`, `Sales`, `Enterprise Resource Planning`, `Advertising`, `Travel and Transportation`, `Property Management`, `Government Services`, `Games`, `Code Hosting`. List of catalog app categories that the URL filtering rule must restrict. -- `catalog_app_risk` (Number) Risk threshold to be used to restrict all catalog apps which has that risk or higher. - `cloud_apps` (List of String) List of [cloud app](https://registry.terraform.io/providers/nsofnetworks/pfptmeta/latest/docs/resources/cloud_app) IDs which the URL filtering rule should restrict. - `countries` (List of String) A list of countries in which this rule should be applied. Each country should be represented by a Alpha-2 code (ISO-3166). Enum: `AD`,`AE`,`AF`,`AG`,`AI`,`AL`,`AM`,`AO`,`AQ`,`AR`,`AS`,`AT`,`AU`,`AW`,`AX`,`AZ`,`BA`,`BB`,`BD`,`BE`,`BF`,`BG`,`BH`,`BI`,`BJ`,`BL`,`BM`,`BN`,`BO`,`BQ`,`BR`,`BS`,`BT`,`BV`,`BW`,`BY`,`BZ`,`CA`,`CC`,`CD`,`CF`,`CG`,`CH`,`CI`,`CK`,`CL`,`CM`,`CN`,`CO`,`CR`,`CU`,`CV`,`CW`,`CX`,`CY`,`CZ`,`DE`,`DJ`,`DK`,`DM`,`DO`,`DZ`,`EC`,`EE`,`EG`,`EH`,`ER`,`ES`,`ET`,`FI`,`FJ`,`FK`,`FM`,`FO`,`FR`,`GA`,`GB`,`GD`,`GE`,`GF`,`GG`,`GH`,`GI`,`GL`,`GM`,`GN`,`GP`,`GQ`,`GR`,`GS`,`GT`,`GU`,`GW`,`GY`,`HK`,`HM`,`HN`,`HR`,`HT`,`HU`,`ID`,`IE`,`IL`,`IM`,`IN`,`IO`,`IQ`,`IR`,`IS`,`IT`,`JE`,`JM`,`JO`,`JP`,`KE`,`KG`,`KH`,`KI`,`KM`,`KN`,`KP`,`KR`,`KW`,`KY`,`KZ`,`LA`,`LB`,`LC`,`LI`,`LK`,`LR`,`LS`,`LT`,`LU`,`LV`,`LY`,`MA`,`MC`,`MD`,`ME`,`MF`,`MG`,`MH`,`MK`,`ML`,`MM`,`MN`,`MO`,`MP`,`MQ`,`MR`,`MS`,`MT`,`MU`,`MV`,`MW`,`MX`,`MY`,`MZ`,`NA`,`NC`,`NE`,`NF`,`NG`,`NI`,`NL`,`NO`,`NP`,`NR`,`NU`,`NZ`,`OM`,`PA`,`PE`,`PF`,`PG`,`PH`,`PK`,`PL`,`PM`,`PN`,`PR`,`PS`,`PT`,`PW`,`PY`,`QA`,`RE`,`RO`,`RS`,`RU`,`RW`,`SA`,`SB`,`SC`,`SD`,`SE`,`SG`,`SH`,`SI`,`SJ`,`SK`,`SL`,`SM`,`SN`,`SO`,`SR`,`SS`,`ST`,`SV`,`SX`,`SY`,`SZ`,`TC`,`TD`,`TF`,`TG`,`TH`,`TJ`,`TK`,`TL`,`TM`,`TN`,`TO`,`TR`,`TT`,`TV`,`TW`,`TZ`,`UA`,`UG`,`UM`,`US`,`UY`,`UZ`,`VA`,`VC`,`VE`,`VG`,`VI`,`VN`,`VU`,`WF`,`WS`,`YE`,`YT`,`ZA`,`ZM`,`ZW` - `description` (String) diff --git a/docs/resources/url_filtering_rule.md b/docs/resources/url_filtering_rule.md index 0af41870..e9d71292 100644 --- a/docs/resources/url_filtering_rule.md +++ b/docs/resources/url_filtering_rule.md @@ -229,7 +229,6 @@ This action determines what must be done according to this URL filtering rule if - `apply_to_org` (Boolean) indicates whether this URL filtering rule applies to the org. - `catalog_app_categories` (List of String) ENUM: `Instant Messaging`, `eCommerce`, `Content Management`, `Software Development`, `Project Management`, `Marketing`, `CRM`, `Telecommunications`, `Social and Communication`, `Productivity`, `Collaboration`, `Business and Finance`, `Utilities`, `IT Service Management`, `Social Networking`, `Office Document and Productivity`, `Cloud File Sharing`, `Web Meetings`, `Identity and Access Management`, `IT Services and Hosting`, `Webmail`, `Website Builder`, `Human Capital Management`, `Sales and CRM`, `E-commerce and Accounting`, `Streaming Media`, `Cloud Storage`, `Operations Management`, `Online Meeting`, `Supply Chain`, `Security and Compliance`, `Entertainment and Lifestyle`, `System and Network`, `Retail and Consumer Services`, `Health and Benefits`, `Data and Analytics`, `Education and References`, `Personal instant messaging`, `Legal`, `Other`, `Hosting Services`, `News and Media`, `Sales`, `Enterprise Resource Planning`, `Advertising`, `Travel and Transportation`, `Property Management`, `Government Services`, `Games`, `Code Hosting`. List of catalog app categories that the URL filtering rule must restrict. -- `catalog_app_risk` (Number) Risk threshold to be used to restrict all catalog apps which has that risk or higher. - `cloud_apps` (List of String) List of [cloud app](https://registry.terraform.io/providers/nsofnetworks/pfptmeta/latest/docs/resources/cloud_app) IDs which the URL filtering rule should restrict. - `countries` (List of String) A list of countries in which this rule should be applied. Each country should be represented by a Alpha-2 code (ISO-3166). Enum: `AD`,`AE`,`AF`,`AG`,`AI`,`AL`,`AM`,`AO`,`AQ`,`AR`,`AS`,`AT`,`AU`,`AW`,`AX`,`AZ`,`BA`,`BB`,`BD`,`BE`,`BF`,`BG`,`BH`,`BI`,`BJ`,`BL`,`BM`,`BN`,`BO`,`BQ`,`BR`,`BS`,`BT`,`BV`,`BW`,`BY`,`BZ`,`CA`,`CC`,`CD`,`CF`,`CG`,`CH`,`CI`,`CK`,`CL`,`CM`,`CN`,`CO`,`CR`,`CU`,`CV`,`CW`,`CX`,`CY`,`CZ`,`DE`,`DJ`,`DK`,`DM`,`DO`,`DZ`,`EC`,`EE`,`EG`,`EH`,`ER`,`ES`,`ET`,`FI`,`FJ`,`FK`,`FM`,`FO`,`FR`,`GA`,`GB`,`GD`,`GE`,`GF`,`GG`,`GH`,`GI`,`GL`,`GM`,`GN`,`GP`,`GQ`,`GR`,`GS`,`GT`,`GU`,`GW`,`GY`,`HK`,`HM`,`HN`,`HR`,`HT`,`HU`,`ID`,`IE`,`IL`,`IM`,`IN`,`IO`,`IQ`,`IR`,`IS`,`IT`,`JE`,`JM`,`JO`,`JP`,`KE`,`KG`,`KH`,`KI`,`KM`,`KN`,`KP`,`KR`,`KW`,`KY`,`KZ`,`LA`,`LB`,`LC`,`LI`,`LK`,`LR`,`LS`,`LT`,`LU`,`LV`,`LY`,`MA`,`MC`,`MD`,`ME`,`MF`,`MG`,`MH`,`MK`,`ML`,`MM`,`MN`,`MO`,`MP`,`MQ`,`MR`,`MS`,`MT`,`MU`,`MV`,`MW`,`MX`,`MY`,`MZ`,`NA`,`NC`,`NE`,`NF`,`NG`,`NI`,`NL`,`NO`,`NP`,`NR`,`NU`,`NZ`,`OM`,`PA`,`PE`,`PF`,`PG`,`PH`,`PK`,`PL`,`PM`,`PN`,`PR`,`PS`,`PT`,`PW`,`PY`,`QA`,`RE`,`RO`,`RS`,`RU`,`RW`,`SA`,`SB`,`SC`,`SD`,`SE`,`SG`,`SH`,`SI`,`SJ`,`SK`,`SL`,`SM`,`SN`,`SO`,`SR`,`SS`,`ST`,`SV`,`SX`,`SY`,`SZ`,`TC`,`TD`,`TF`,`TG`,`TH`,`TJ`,`TK`,`TL`,`TM`,`TN`,`TO`,`TR`,`TT`,`TV`,`TW`,`TZ`,`UA`,`UG`,`UM`,`US`,`UY`,`UZ`,`VA`,`VC`,`VE`,`VG`,`VI`,`VN`,`VU`,`WF`,`WS`,`YE`,`YT`,`ZA`,`ZM`,`ZW` - `description` (String) diff --git a/internal/client/url_filtering_rule.go b/internal/client/url_filtering_rule.go index cedd5e39..c93bf9a1 100644 --- a/internal/client/url_filtering_rule.go +++ b/internal/client/url_filtering_rule.go @@ -21,7 +21,6 @@ type UrlFilteringRule struct { ExemptSources []string `json:"exempt_sources,omitempty"` AdvancedThreatProtection bool `json:"advanced_threat_protection"` CatalogAppCategories []string `json:"catalog_app_categories"` - CatalogAppRisk int `json:"catalog_app_risk,omitempty"` CloudApps []string `json:"cloud_apps"` Countries []string `json:"countries,omitempty"` ExpiresAt string `json:"expires_at,omitempty"` @@ -48,7 +47,6 @@ func NewUrlFilteringRule(d *schema.ResourceData) *UrlFilteringRule { res.ExemptSources = ConfigToStringSlice("exempt_sources", d) res.AdvancedThreatProtection = d.Get("advanced_threat_protection").(bool) res.CatalogAppCategories = ConfigToStringSlice("catalog_app_categories", d) - res.CatalogAppRisk = d.Get("catalog_app_risk").(int) res.CloudApps = ConfigToStringSlice("cloud_apps", d) res.Countries = ConfigToStringSlice("countries", d) res.ExpiresAt = d.Get("expires_at").(string) diff --git a/internal/provider/url_filtering_rule/common.go b/internal/provider/url_filtering_rule/common.go index c9c7dec9..106699a4 100644 --- a/internal/provider/url_filtering_rule/common.go +++ b/internal/provider/url_filtering_rule/common.go @@ -31,9 +31,8 @@ With these measures, you can enforce company security policies and filter malici "`News and Media`, `Sales`, `Enterprise Resource Planning`, `Advertising`, `Travel and Transportation`, " + "`Property Management`, `Government Services`, `Games`, `Code Hosting`.\n" + "List of catalog app categories that the URL filtering rule must restrict." - catalogAppRiskDesc = "Risk threshold to be used to restrict all catalog apps which has that risk or higher." - cloudAppsDesc = "List of [cloud app](https://registry.terraform.io/providers/nsofnetworks/pfptmeta/latest/docs/resources/cloud_app) IDs which the URL filtering rule should restrict. " - countriesDesc = "A list of countries in which this rule should be applied. Each country should be represented by a Alpha-2 code (ISO-3166). " + + cloudAppsDesc = "List of [cloud app](https://registry.terraform.io/providers/nsofnetworks/pfptmeta/latest/docs/resources/cloud_app) IDs which the URL filtering rule should restrict. " + countriesDesc = "A list of countries in which this rule should be applied. Each country should be represented by a Alpha-2 code (ISO-3166). " + "Enum: " + common.CountriesDoc expiresAtDesc = "Defines the rule expiration time. " + "This can be useful when creating exceptions for users who need them for a limited period of time as an alternative for full disconnection from the proxy. " + diff --git a/internal/provider/url_filtering_rule/data_source.go b/internal/provider/url_filtering_rule/data_source.go index 57710d08..30ae39b5 100644 --- a/internal/provider/url_filtering_rule/data_source.go +++ b/internal/provider/url_filtering_rule/data_source.go @@ -61,11 +61,6 @@ func DataSource() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Computed: true, }, - "catalog_app_risk": { - Description: catalogAppRiskDesc, - Type: schema.TypeInt, - Computed: true, - }, "cloud_apps": { Description: cloudAppsDesc, Type: schema.TypeList, diff --git a/internal/provider/url_filtering_rule/resource.go b/internal/provider/url_filtering_rule/resource.go index c354b751..c213c390 100644 --- a/internal/provider/url_filtering_rule/resource.go +++ b/internal/provider/url_filtering_rule/resource.go @@ -97,12 +97,6 @@ func Resource() *schema.Resource { }, Optional: true, }, - "catalog_app_risk": { - Description: catalogAppRiskDesc, - Type: schema.TypeInt, - ValidateDiagFunc: common.ValidateIntRange(1, 8), - Optional: true, - }, "cloud_apps": { Description: cloudAppsDesc, Type: schema.TypeList,