Skip to content

Commit ff76bc0

Browse files
committed
fix api scopes
1 parent ad60702 commit ff76bc0

12 files changed

+38
-62
lines changed

docs/data-sources/content_category_versions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |-
55
This data source provides information about available content category versions for pinning in content update policies.
66
API Scopes
77
The following API scopes are required:
8-
Content update policy | Read
8+
Content Update Policy | Read
99
---
1010

1111
# crowdstrike_content_category_versions (Data Source)
@@ -16,7 +16,7 @@ This data source provides information about available content category versions
1616

1717
The following API scopes are required:
1818

19-
- Content update policy | Read
19+
- Content Update Policy | Read
2020

2121

2222
## Example Usage

docs/data-sources/content_update_policies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |-
55
This data source provides information about content update policies in Falcon.
66
API Scopes
77
The following API scopes are required:
8-
content-update-policies | Read
8+
Content Update Policy | Read
99
---
1010

1111
# crowdstrike_content_update_policies (Data Source)
@@ -16,7 +16,7 @@ This data source provides information about content update policies in Falcon.
1616

1717
The following API scopes are required:
1818

19-
- content-update-policies | Read
19+
- Content Update Policy | Read
2020

2121

2222
## Example Usage

docs/resources/content_update_policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |-
55
This resource allows management of content update policies in the CrowdStrike Falcon platform. Content update policies control how and when CrowdStrike content updates are deployed to hosts.
66
API Scopes
77
The following API scopes are required:
8-
Content update policies | Read & Write
8+
Content Update Policy | Read & Write
99
---
1010

1111
# crowdstrike_content_update_policy (Resource)
@@ -16,7 +16,7 @@ This resource allows management of content update policies in the CrowdStrike Fa
1616

1717
The following API scopes are required:
1818

19-
- Content update policies | Read & Write
19+
- Content Update Policy | Read & Write
2020

2121

2222
## Example Usage

docs/resources/content_update_policy_precedence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |-
55
This resource allows you to set the precedence of Content Update Policies based on the order of IDs.
66
API Scopes
77
The following API scopes are required:
8-
Content update policies | Read & Write
8+
Content Update Policy | Read & Write
99
---
1010

1111
# crowdstrike_content_update_policy_precedence (Resource)
@@ -16,7 +16,7 @@ This resource allows you to set the precedence of Content Update Policies based
1616

1717
The following API scopes are required:
1818

19-
- Content update policies | Read & Write
19+
- Content Update Policy | Read & Write
2020

2121

2222
## Example Usage

docs/resources/default_content_update_policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |-
55
This resource allows management of the default content update policy in the CrowdStrike Falcon platform. Destruction of this resource will not delete the default content update policy or remove any configured settings.
66
API Scopes
77
The following API scopes are required:
8-
Content update policies | Read & Write
8+
Content Update Policy | Read & Write
99
---
1010

1111
# crowdstrike_default_content_update_policy (Resource)
@@ -16,7 +16,7 @@ This resource allows management of the default content update policy in the Crow
1616

1717
The following API scopes are required:
1818

19-
- Content update policies | Read & Write
19+
- Content Update Policy | Read & Write
2020

2121

2222
## Example Usage

internal/content_update_policy/api.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

internal/content_update_policy/content_category_versions_data_source.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,7 @@ func (d *contentCategoryVersionsDataSource) Schema(
5454
resp.Schema = schema.Schema{
5555
MarkdownDescription: fmt.Sprintf(
5656
"Content Update Policy --- This data source provides information about available content category versions for pinning in content update policies.\n\n%s",
57-
scopes.GenerateScopeDescription(
58-
[]scopes.Scope{
59-
{
60-
Name: "Content update policy",
61-
Read: true,
62-
Write: false,
63-
},
64-
},
65-
),
57+
scopes.GenerateScopeDescription(apiScopesRead),
6658
),
6759
Attributes: map[string]schema.Attribute{
6860
"sensor_operations": schema.ListAttribute{

internal/content_update_policy/content_update_policies_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (d *contentUpdatePoliciesDataSource) Schema(
215215
MarkdownDescription: utils.MarkdownDescription(
216216
dataSourceDocumentationSection,
217217
dataSourceMarkdownDescription,
218-
dataSourceApiScopes,
218+
apiScopesRead,
219219
),
220220
Attributes: map[string]schema.Attribute{
221221
"filter": schema.StringAttribute{

internal/content_update_policy/content_update_policy_precedence.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/crowdstrike/gofalcon/falcon/client"
1010
"github.com/crowdstrike/gofalcon/falcon/client/content_update_policies"
1111
"github.com/crowdstrike/gofalcon/falcon/models"
12-
"github.com/crowdstrike/terraform-provider-crowdstrike/internal/scopes"
1312
"github.com/crowdstrike/terraform-provider-crowdstrike/internal/utils"
1413
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
1514
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
@@ -29,15 +28,8 @@ var (
2928
)
3029

3130
var (
32-
precedenceDocumentationSection string = "Content Update Policy"
33-
precedenceMarkdownDescription string = "This resource allows you to set the precedence of Content Update Policies based on the order of IDs."
34-
precedencerequiredScopes []scopes.Scope = []scopes.Scope{
35-
{
36-
Name: "Content update policies",
37-
Read: true,
38-
Write: true,
39-
},
40-
}
31+
precedenceDocumentationSection string = "Content Update Policy"
32+
precedenceMarkdownDescription string = "This resource allows you to set the precedence of Content Update Policies based on the order of IDs."
4133

4234
dynamicEnforcement = "dynamic"
4335
)
@@ -113,7 +105,7 @@ func (r *contentUpdatePolicyPrecedenceResource) Schema(
113105
resp *resource.SchemaResponse,
114106
) {
115107
resp.Schema = schema.Schema{
116-
MarkdownDescription: utils.MarkdownDescription(precedenceDocumentationSection, precedenceMarkdownDescription, precedencerequiredScopes),
108+
MarkdownDescription: utils.MarkdownDescription(precedenceDocumentationSection, precedenceMarkdownDescription, apiScopesReadWrite),
117109
Attributes: map[string]schema.Attribute{
118110
"ids": schema.ListAttribute{
119111
Required: true,

internal/content_update_policy/content_update_policy_resource.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,7 @@ func (r *contentPolicyResource) Schema(
296296
resp.Schema = schema.Schema{
297297
MarkdownDescription: fmt.Sprintf(
298298
"Content Update Policy --- This resource allows management of content update policies in the CrowdStrike Falcon platform. Content update policies control how and when CrowdStrike content updates are deployed to hosts.\n\n%s",
299-
scopes.GenerateScopeDescription(
300-
[]scopes.Scope{
301-
{
302-
Name: "Content update policies",
303-
Read: true,
304-
Write: true,
305-
},
306-
},
307-
),
299+
scopes.GenerateScopeDescription(apiScopesReadWrite),
308300
),
309301
Attributes: map[string]schema.Attribute{
310302
"id": schema.StringAttribute{

0 commit comments

Comments
 (0)