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

Add missing deny unknown fields #371

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Conversation

schneems
Copy link
Contributor

These were added as a part of the RubyConf hackweek, but I just merged that PR in. Between then and now, I added metadata that didn't include the container attribute.

The attribute is described here: https://serde.rs/container-attrs.html.

Always error during deserialization when encountering unknown fields. When this attribute is not present, by default unknown fields are ignored for self-describing formats like JSON.

Note: this attribute is not supported in combination with flatten, neither on the outer struct nor on the flattened field.

I proposed adding it to all structs here heroku/buildpacks#23

@schneems schneems marked this pull request as ready for review December 13, 2024 21:11
@schneems schneems requested a review from a team as a code owner December 13, 2024 21:11
@schneems schneems enabled auto-merge (squash) December 13, 2024 21:11
@schneems schneems merged commit a79408d into main Dec 13, 2024
6 checks passed
@schneems schneems deleted the schneems/add-missing-deny-unknown branch December 13, 2024 21:15
heroku-linguist bot added a commit that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](#371))
@heroku-linguist heroku-linguist bot mentioned this pull request Dec 16, 2024
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](heroku/buildpacks-ruby#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](heroku/buildpacks-ruby#371))
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Dec 16, 2024
## heroku/ruby

### Fixed

- Ruby pre-release verssions like `3.4.0.rc1` now work as expected. ([#372](heroku/buildpacks-ruby#372))
- Layer metadata deserialization to Rust structs is now using `#[serde(deny_unknown_fields)]` this prevents the accidental scenario where metadata containing a superset of fields could accidentally be deserialized to the wrong struct. It's unlikely this is currently happening with the current buildpack, but it's a possibly-observable difference so it's being listed ([#371](heroku/buildpacks-ruby#371))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants