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

build(deps): update tough requirement from 0.17.1 to 0.18.0 #389

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 9, 2024

Updates the requirements on tough to permit the latest version.

Release notes

Sourced from tough's releases.

tough-v0.18.0

Changes

#763: awslabs/tough#763 #765: awslabs/tough#765 #778: awslabs/tough#778 #780: awslabs/tough#780 #802: awslabs/tough#802

Commits
  • ecab7eb Merge pull request #817 from mgsharm/develop
  • 7cf66e9 Prepare for release
  • 446a460 Merge pull request #802 from jpculp/rust-1.80.0
  • 29289de Merge pull request #778 from flavio/timestamp.json-optional-fields-inside-of-...
  • f2a8cce fix: timestamp.json meta can has optional fields
  • b3f16c9 Update rust dependencies
  • 18791c1 Bump rust to stable in actions runner
  • 864be9c Bump cargo-deny in Makefile
  • 8fb4469 Merge pull request #780 from jpculp/rust-bump
  • a313b9f Bump rust to 1.78.0 in actions runner
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [tough](https://github.com/awslabs/tough) to permit the latest version.
- [Release notes](https://github.com/awslabs/tough/releases)
- [Commits](awslabs/tough@tough-v0.17.1...tough-v0.18.0)

---
updated-dependencies:
- dependency-name: tough
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Sep 9, 2024
@haydentherapper
Copy link
Contributor

@jku FYI - i know you had mentioned dependency issues, looks like tests are passing here?

@jku
Copy link
Member

jku commented Sep 10, 2024

@jku FYI - i know you had mentioned dependency issues, looks like tests are passing here?

the issue is a little complicated. I haven't tried reproducing myself but this seems to be the short of it:

  • issue comes up at runtime for a specific but common situation, https://github.com/flavio/tough-hyper-bug is flavios reproducer
  • issue comes up because sigstore-rs (and the calling code) uses new reqwest & hyper, while awslabs/toughuses older ones...
  • awslabs/tough has been resisting upgrade because it would mean they'd have to start using aws-smithy-experimental instead of the non-experimental version (these are build time dependencies). They are considering it in chore(deps): update reqwest awslabs/tough#769 but no decision yet

I suppose the test suite does not have his specific situation -- explicit use of reqwest and then use of sigstore-rs api

@flavio
Copy link
Member

flavio commented Sep 10, 2024

OMG, OMG! I found a solution to the awslabs/tough#769 problem that doesn't require any change to the aws/tough crate 🥳

I saw the comment on this PR and I immediately thought the test suite wasn't complete. I started looking into the test suite, but I found these tests are not failing.

After a lot of digging I figured it out aws/tough uses an old version of reqwest, which is rightfully imported with no default features. That causes reqwest to not have any TLS support enabled.

sigstore default features have full-native-tls, when full-native-tls is enabled the fulcio-native-tls feature is enabled. The latter one causes the oauth to be enabled, which includes openidconnect and it enables its TLS feature. The openidconnect crate depends on the same old version of reqwest used by aws/tough. The full-native-tls causes the openidconnect crate to enable TLS support into the old version of reqwest.

A quick recap.

Running with sigstore's default features enabled hides the problem:

cargo test 'trust::sigstore::tests::trust_root_fetch::cache_1_None' -- --exact --nocapture
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.17s
     Running unittests src/lib.rs (target/debug/deps/sigstore-0651a823d35f9ce7)

running 1 test
test trust::sigstore::tests::trust_root_fetch::cache_1_None ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 116 filtered out; finished in 2.36s

Running with only the sigstore-trust-root feature enabled exposes the problem:

cargo test --no-default-features -F sigstore-trust-root 'trust::sigstore::tests::trust_root_fetch::cache_1_None' -- --exact --nocapture
[long error trace]
failures:
    trust::sigstore::tests::trust_root_fetch::cache_1_None

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 64 filtered out; finished in 0.97s

I'm going to add a commit to this PR that addresses the failure

Fetching Sigstore's TUF repository is done using the `aws/tough` crate.
This crate is currently using an older version of `reqwest`, which in turn
uses an older version of `hyper`.

When building the `sigstore` crate with the default features turned off and
a limited set of "verification-related" features enabled (like
`sigstore-trust-root` and `cosign-rustls-tls`), fetching the TUF
repository causes a runtime panic. The panic happens because the old
`reqwest` crate is built without TLS support.
This was not a problem before, since both sigstore and `tough` used the
same version of `reqwest`, hence enabling `cosign-rustls-tls` led to
TLS support being enabled also for tough.

This commit introduces two new feature flags:
`sigstore-trust-root-native-tls` and `sigstore-trust-root-rustl-tls`
which enable TLS support also for the old version of reqwest being
currently used by tough.

Worth of interest, building with the default flags doesn't currently
expose this issue. That happens because of a happy coincidence.
The "feature chain reaction" is the following one:
- The "enable default features" cause the `full-native-tls` feature to be enabled
- The `full-native-tls` feature enables `fulcio-native-tls` feature
- The `fulcio-native-tls` features enables the `oauth-native-tls` feature
- The `oauth-native-tls` features causes the `openidconnect` crate to be required,
  moreover it enables TLS support of `openidconnect` by enabling the
  `openidconnect/native-tls` feature.

Currently the `openidconnect` crate depends on the same old version of `reqwest` used by
aws/tough. Hence, enabling TLS support for `openidconnect` leads to TLS support being
enabled also by tough.
This coincidental fix is going to disappear as soon as `openidconnect`
moves to the latest version of `reqwest`.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio
Copy link
Member

flavio commented Sep 10, 2024

Commit pushed, checkout the commit message for a detailed recap: d80b800

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be merged :D

@flavio
Copy link
Member

flavio commented Sep 10, 2024

@Xynnn007 can you please approve the PR? I cannot merge it since I added that commit on top of it

Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 nice catch! I'm not a cargo expert but this looks reasonable to me.

@flavio flavio merged commit f8f7b03 into main Sep 10, 2024
15 checks passed
@flavio flavio deleted the dependabot/cargo/tough-0.18.0 branch September 10, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants