fix(security): 2 improvements across 2 files#6226
Open
tomaioo wants to merge 2 commits into
Open
Conversation
- Security: Type generation errors are logged but not enforced, allowing silent schema corruption - Security: Conversion CLI wrappers swallow exceptions and may exit successfully on failure Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Type generation errors are logged but not enforced, allowing silent schema corruption - Security: Conversion CLI wrappers swallow exceptions and may exit successfully on failure Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
❌ Author of the following commits did not sign a Contributor Agreement: Please, read and sign the above mentioned agreement if you want to contribute to this project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix(security): 2 improvements across 2 files
Problem
Severity:
Medium| File:compiler-rs/openapi_to_clients_schema/src/lib.rs:L40During OpenAPI-to-clients-schema conversion, failures in individual type generation are only logged with
warn!and processing continues. Additionally,types.check_tracker()is called but its result is explicitly ignored (// TODO: actually fail). This can produce partially generated or inconsistent schemas without failing the build, which can weaken downstream validation and allow malformed API contracts to be published unnoticed.Solution
Fail closed on conversion inconsistencies: accumulate generation errors and return an
Errwhen any type fails, and enforcecheck_tracker()results instead of ignoring them. Optionally provide a strict mode defaulting to hard-fail in CI.Changes
compiler-rs/openapi_to_clients_schema/src/lib.rs(modified)compiler/src/transform/schema-to-openapi.ts(modified)