-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
feat: Support selective ssl/tls backend in rust-server to optionally remove openssl #22825
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
base: master
Are you sure you want to change the base?
Conversation
…s requiring openssl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 43 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name=".github/workflows/samples-rust-server.yaml">
<violation number="1" location=".github/workflows/samples-rust-server.yaml:71">
P2: CI doesn’t build the `client-openssl` feature even though rust-server samples define it, so OpenSSL client builds can break without detection.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
samples/server/petstore/rust-server/output/openapi-v3/bin/cli.rs
Outdated
Show resolved
Hide resolved
a1e1bb2 to
10b7300
Compare
10b7300 to
a8e6ee2
Compare
a7948fa to
421f423
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 issues found across 43 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md:151">
P3: Conflicting documentation: the new `client-tls` feature is described as not enabled by default, but the HTTPS/TLS section says HTTPS support is included by default. Clarify which is correct to avoid misleading users about default features.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml:23">
P2: `client-tls` now unconditionally enables OpenSSL deps and is part of default features; this removes target-specific gating and can pull OpenSSL on macOS/Windows/iOS where native-tls was intended, risking build/toolchain issues.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml:25">
P2: `client-tls` now unconditionally enables OpenSSL/hyper-openssl, but the target-specific dependency gating was removed. This pulls OpenSSL on macOS/Windows/iOS, defeating the intended OS-specific backend selection and potentially breaking builds without OpenSSL.</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/rust-server/README.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/rust-server/README.mustache:133">
P2: Documentation contradicts the crate defaults: `client-tls` is included in default features but the README now claims it is not enabled by default.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/ops-v3/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/ops-v3/README.md:152">
P2: README incorrectly states `client-tls` is not enabled by default, but Cargo.toml includes it in default features, which can mislead users about TLS dependency behavior.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/ping-bearer-auth/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/ping-bearer-auth/README.md:116">
P3: README incorrectly states `client-tls` is not enabled by default, but Cargo.toml default features include `client-tls`, creating contradictory guidance about TLS support.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/multipart-v3/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/multipart-v3/README.md:129">
P3: The README contains contradictory statements about whether TLS support is enabled by default (`client-tls` “Not enabled by default” vs “HTTPS support is included by default”). This inconsistency can mislead users about required features.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/no-example-v3/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/no-example-v3/README.md:115">
P2: The README introduces contradictory statements about TLS defaults (`client-tls` “Not enabled by default” vs “HTTPS support is included by default”), which can mislead users configuring features.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/openapi-v3/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/openapi-v3/README.md:146">
P2: README claims `client-tls` is not enabled by default, but Cargo.toml includes it in default features. This documentation inconsistency can mislead users about TLS being enabled by default.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/rust-server-test/README.md">
<violation number="1" location="samples/server/petstore/rust-server/output/rust-server-test/README.md:133">
P2: The README now contradicts itself about whether TLS is enabled by default (`client-tls` says not enabled by default, but the HTTPS/TLS section says HTTPS support is included by default). This can mislead users configuring Cargo features.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml:23">
P2: `client-tls` now enables OpenSSL dependencies unconditionally and is part of `default`, so macOS/Windows builds will compile `openssl`/`hyper-openssl` even though those platforms should use native-tls. This removes prior target gating and can cause build failures when OpenSSL toolchains aren’t available.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml:25">
P2: `client-tls` now unconditionally enables `dep:openssl`/`dep:hyper-openssl` while OpenSSL deps are in global `[dependencies]`, so default builds pull OpenSSL on all targets (macOS/Windows/iOS included) despite the intended per-OS backend selection.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml:25">
P2: `client-tls` now unconditionally enables OpenSSL deps after removing target-specific dependency blocks, so default builds will pull `openssl`/`hyper-openssl` on all targets, undermining the selective TLS backend goal and risking build failures on platforms without OpenSSL.</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache:60">
P2: `client-tls` unconditionally enables both OpenSSL and native-tls dependencies after removing target-specific gating, so OpenSSL crates are built on all targets when default features are enabled, contradicting the selective-backend intent and potentially reintroducing unwanted OpenSSL build requirements.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml:23">
P2: `client-tls` is now a default feature and unconditionally enables OpenSSL dependencies for all targets. That forces OpenSSL builds on macOS/Windows/iOS despite the intended native-tls backend and can break builds when OpenSSL isn’t installed.</violation>
</file>
<file name="samples/server/petstore/rust-server/output/ops-v3/Cargo.toml">
<violation number="1" location="samples/server/petstore/rust-server/output/ops-v3/Cargo.toml:23">
P2: `client-tls` is now a default feature and unconditionally enables `openssl`/`hyper-openssl` after removing target-specific dependency gating, which pulls OpenSSL on macOS/Windows/iOS and defeats the intended platform-specific TLS backend selection.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
...erver/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/rust-server/README.mustache
Outdated
Show resolved
Hide resolved
samples/server/petstore/rust-server/output/no-example-v3/README.md
Outdated
Show resolved
Hide resolved
...server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/README.md
Show resolved
Hide resolved
samples/server/petstore/rust-server/output/ping-bearer-auth/README.md
Outdated
Show resolved
Hide resolved
421f423 to
b571442
Compare
|
@cubic-dev-ai please re-review |
@dsteeley I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 43 files
The rust-server always brings in hyper-openssl as a dependency even though it's not always required.
I've therefore reconfigured the features of rust-server to support removing hyper-openssl from the dependencies. Currently this isn't backwards compatible where the default features don't specify an SSL backend. Users wanting this function for their Client must specify
client-tlsorclient-openssl.This is an anti-pattern to standard feature flagging of TLS backend. @wing328 would it be acceptable to put a "breaking" change in where we set the default to be not including openssl and document that if users want to use hyper-openssl then they should select that feature?
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Adds a single TLS feature for rust-server clients and removes the unconditional OpenSSL dependency. TLS (client-tls) is enabled by default; disable it for HTTP-only builds. Native-tls is used on macOS/Windows/iOS, OpenSSL elsewhere.
New Features
Migration
Written for commit b571442. Summary will update on new commits.