Skip to content

Commit

Permalink
Bump a few more dependencies (#1510)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik authored Sep 11, 2024
1 parent a6b5ee8 commit 9f06f55
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ postgres-protocol = "0.6"
pprof = { version = "0.13", features = ["flamegraph", "criterion"] }
pretty_assertions = "1"
regex = "1"
rstest = "0.21"
rstest = "0.22"
rustls = "0.23.12"
# ring feature does not require NASM windows executable, but works slower
#rustls = { version = "0.23", default-features = false, features = ["logging", "std", "tls12", "ring"] }
rustls-native-certs = "0.7"
rustls-native-certs = "0.8"
rustls-pemfile = "2"
semver = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
26 changes: 15 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -299,30 +299,34 @@ fmt2:

# Run cargo check
check:
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin-tile-utils
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p mbtiles
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p mbtiles --no-default-features
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features --features fonts
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features --features mbtiles
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features --features pmtiles
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features --features postgres
RUSTFLAGS='-D warnings' cargo check --bins --tests --lib --benches --examples -p martin --no-default-features --features sprites
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin-tile-utils
RUSTFLAGS='-D warnings' cargo check --all-targets -p mbtiles
RUSTFLAGS='-D warnings' cargo check --all-targets -p mbtiles --no-default-features
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features --features fonts
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features --features mbtiles
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features --features pmtiles
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features --features postgres
RUSTFLAGS='-D warnings' cargo check --all-targets -p martin --no-default-features --features sprites

# Verify doc build
check-doc:
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace

# Run cargo clippy
clippy:
cargo clippy --workspace --all-targets --bins --tests --lib --benches --examples -- -D warnings
cargo clippy --workspace --all-targets -- -D warnings

# Validate markdown URLs with markdown-link-check
clippy-md:
docker run -it --rm -v ${PWD}:/workdir --entrypoint sh ghcr.io/tcort/markdown-link-check -c \
'echo -e "/workdir/README.md\n$(find /workdir/docs/src -name "*.md")" | tr "\n" "\0" | xargs -0 -P 5 -n1 -I{} markdown-link-check --config /workdir/.github/files/markdown.links.config.json {}'

# Update all dependencies including the breaking ones
update-breaking:
cargo +nightly -Z unstable-options update --breaking

# These steps automatically run before git push via a git hook
git-pre-push: env-info restart fmt clippy check-doc test check

Expand Down
4 changes: 2 additions & 2 deletions martin/src/pg/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub type PgResult<T> = Result<T, PgError>;

#[derive(thiserror::Error, Debug)]
pub enum PgError {
#[error("Cannot load platform root certificates: {0}")]
CannotLoadRoots(#[source] io::Error),
#[error("Cannot load platform root certificates: {0:?}")]
CannotLoadRoots(Vec<rustls_native_certs::Error>),

#[error("Cannot open certificate file {}: {0}", .1.display())]
CannotOpenCert(#[source] io::Error, PathBuf),
Expand Down
8 changes: 5 additions & 3 deletions martin/src/pg/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use deadpool_postgres::tokio_postgres::Config;
use log::{info, warn};
use regex::Regex;
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
// use rustls::crypto::ring::default_provider;
use rustls::crypto::aws_lc_rs::default_provider;
use rustls::crypto::{verify_tls12_signature, verify_tls13_signature};
use rustls::pki_types::{CertificateDer, ServerName, UnixTime};
Expand Down Expand Up @@ -156,8 +155,11 @@ pub fn make_connector(
}

if verify_ca || pg_certs.ssl_root_cert.is_some() || pg_certs.ssl_cert.is_some() {
let certs = load_native_certs().map_err(CannotLoadRoots)?;
for cert in certs {
let certs = load_native_certs();
if !certs.errors.is_empty() {
return Err(CannotLoadRoots(certs.errors));
}
for cert in certs.certs {
roots.add(cert)?;
}
}
Expand Down

0 comments on commit 9f06f55

Please sign in to comment.