Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sentry_key): mark secret and dsn_secret fields as sensitive #565

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/data-sources/key.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ data "sentry_key" "first" {
- `dsn` (Map of String) This is a map of DSN values. The keys include `public`, `secret`, `csp`, `security`, `minidump`, `nel`, `unreal`, `cdn`, and `crons`.
- `dsn_csp` (String, Deprecated) Security header endpoint for features like CSP and Expect-CT reports. **Deprecated** Use `dsn["csp"]` instead.
- `dsn_public` (String, Deprecated) The DSN tells the SDK where to send the events to. **Deprecated** Use `dsn["public"]` instead.
- `dsn_secret` (String, Deprecated) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn["secret"]` instead.
- `dsn_secret` (String, Sensitive, Deprecated) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn["secret"]` instead.
- `javascript_loader_script` (Attributes) The JavaScript loader script configuration. (see [below for nested schema](#nestedatt--javascript_loader_script))
- `project_id` (String) The ID of the project that the key belongs to.
- `public` (String) The public key.
- `rate_limit_count` (Number) Number of events that can be reported within the rate limit window.
- `rate_limit_window` (Number) Length of time in seconds that will be considered when checking the rate limit.
- `secret` (String) The secret key.
- `secret` (String, Sensitive) The secret key.

<a id="nestedatt--javascript_loader_script"></a>
### Nested Schema for `javascript_loader_script`
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/key.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ resource "sentry_key" "default" {
- `dsn` (Map of String) This is a map of DSN values. The keys include `public`, `secret`, `csp`, `security`, `minidump`, `nel`, `unreal`, `cdn`, and `crons`.
- `dsn_csp` (String, Deprecated) Security header endpoint for features like CSP and Expect-CT reports. **Deprecated** Use `dsn["csp"]` instead.
- `dsn_public` (String, Deprecated) The DSN tells the SDK where to send the events to. **Deprecated** Use `dsn["public"]` instead.
- `dsn_secret` (String, Deprecated) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn["secret"] instead.
- `dsn_secret` (String, Sensitive, Deprecated) Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn["secret"] instead.
- `id` (String) The ID of this resource.
- `project_id` (String) The ID of the project that the key belongs to.
- `public` (String) The public key.
- `secret` (String) The secret key.
- `secret` (String, Sensitive) The secret key.

<a id="nestedatt--javascript_loader_script"></a>
### Nested Schema for `javascript_loader_script`
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/data_source_client_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (d *ClientKeyDataSource) Schema(ctx context.Context, req datasource.SchemaR
"secret": schema.StringAttribute{
MarkdownDescription: "The secret key.",
Computed: true,
Sensitive: true,
},
"rate_limit_window": schema.Int64Attribute{
MarkdownDescription: "Length of time in seconds that will be considered when checking the rate limit.",
Expand Down Expand Up @@ -181,6 +182,7 @@ func (d *ClientKeyDataSource) Schema(ctx context.Context, req datasource.SchemaR
MarkdownDescription: "Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn[\"secret\"]` instead.",
DeprecationMessage: "This field is deprecated and will be removed in a future version. Use `dsn[\"secret\"]` instead.",
Computed: true,
Sensitive: true,
},
"dsn_csp": schema.StringAttribute{
MarkdownDescription: "Security header endpoint for features like CSP and Expect-CT reports. **Deprecated** Use `dsn[\"csp\"]` instead.",
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/resource_client_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func (r *ClientKeyResource) Schema(ctx context.Context, req resource.SchemaReque
"secret": schema.StringAttribute{
MarkdownDescription: "The secret key.",
Computed: true,
Sensitive: true,
},
"dsn": schema.MapAttribute{
MarkdownDescription: "This is a map of DSN values. The keys include `public`, `secret`, `csp`, `security`, `minidump`, `nel`, `unreal`, `cdn`, and `crons`.",
Expand All @@ -237,6 +238,7 @@ func (r *ClientKeyResource) Schema(ctx context.Context, req resource.SchemaReque
MarkdownDescription: "Deprecated DSN includes a secret which is no longer required by newer SDK versions. If you are unsure which to use, follow installation instructions for your language. **Deprecated** Use `dsn[\"secret\"] instead.",
DeprecationMessage: "This field is deprecated and will be removed in a future version. Use `dsn[\"secret\"]` instead.",
Computed: true,
Sensitive: true,
},
"dsn_csp": schema.StringAttribute{
MarkdownDescription: "Security header endpoint for features like CSP and Expect-CT reports. **Deprecated** Use `dsn[\"csp\"]` instead.",
Expand Down