Skip to content

Commit

Permalink
upgrade dependencies (incl. to latest rustls)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Jun 4, 2024
1 parent fc2360a commit 126b152
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 39 deletions.
4 changes: 2 additions & 2 deletions postgres-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pgvector = { version = "0.3", features = ["postgres"], optional = true }
postgres = "0.19"
proc-macro2 = { version = "1.0", features = ["span-locations"] }
quote = "1.0"
rustls = { version = "0.22" }
rustls = { version = "0.23" }
serde_json = { version = "1.0", optional = true }
syn = { version = "2.0", features = ["full", "extra-traits"] }
time = { version = "0.3", optional = true }
tokio-postgres-rustls = "0.11"
tokio-postgres-rustls = "0.12"
uuid = { version = "1.4", optional = true }

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions postgres-macros/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[rustversion::nightly]
fn main() {
println!("cargo:rustc-cfg=nightly_column_names");
println!("cargo::rustc-check-cfg=cfg(nightly_column_names)");
}

#[rustversion::not(nightly)]
Expand Down
9 changes: 6 additions & 3 deletions postgres-macros/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,16 @@ impl Parse for Input {

#[derive(Debug)]
struct NoServerCertVerify {
crypto_provider: rustls::crypto::CryptoProvider,
crypto_provider: Arc<rustls::crypto::CryptoProvider>,
}

impl Default for NoServerCertVerify {
fn default() -> Self {
Self {
crypto_provider: rustls::crypto::ring::default_provider(),
crypto_provider: Arc::clone(
rustls::crypto::CryptoProvider::get_default()
.expect("no default provider for rustls installed"),
),
}
}
}
Expand Down Expand Up @@ -571,7 +574,7 @@ impl rustls::client::danger::ServerCertVerifier for NoServerCertVerify {
}

fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
rustls::crypto::ring::default_provider()
self.crypto_provider
.signature_verification_algorithms
.supported_schemes()
}
Expand Down
4 changes: 1 addition & 3 deletions postgres-macros/tests/fail-nightly/enum_extra_variant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, "id">,
<Vec<Vec<u8>> as Query<Primitive<Bytea>>>
<Vec<Vec<u8>> as Query<sqlm_postgres::types::Array<Vec<Bytea>>>>
<Vec<u8> as Query<Primitive<Bytea>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<Enum<(EnumVariant<"admin">, ...)>, "role">)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-4ffcc67694e213f1.long-type-11745197285905521998.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<"admin">, EnumVariant<"user">)>, "role">)>, Vec<User>>` to implement `IntoFuture`
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, "id">,
<Vec<Vec<u8>> as Query<Primitive<Bytea>>>
<Vec<Vec<u8>> as Query<sqlm_postgres::types::Array<Vec<Bytea>>>>
<Vec<u8> as Query<Primitive<Bytea>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<Enum<(EnumVariant<"admin">, ...)>, "role">)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-6f9d778168733bb2.long-type-11135974624108269593.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<"admin">, EnumVariant<"user">)>, "role">)>, Vec<User>>` to implement `IntoFuture`
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, "id">,
<Vec<Vec<u8>> as Query<Primitive<Bytea>>>
<Vec<Vec<u8>> as Query<sqlm_postgres::types::Array<Vec<Bytea>>>>
<Vec<u8> as Query<Primitive<Bytea>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<Enum<(EnumVariant<"admin">, ...)>, "role">)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-108a3d1f17e7e28e.long-type-6590895828837905940.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, "id">, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<"admin">, EnumVariant<"user">)>, "role">)>, Vec<User>>` to implement `IntoFuture`
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ error[E0277]: the trait bound `Role: Query<sqlm_postgres::types::Array<Vec<sqlm_
<Option<Vec<u8>> as Query<Primitive<Bytea>>>
<Option<T> as Query<Struct<Cols>>>
and $N others
= note: required for `Sql<'_, Array<Vec<Enum<(EnumVariant<5755620910692865178>, EnumVariant<10465144470622129318>)>>>, Role>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-4bc7215b1b514162.long-type-14335032845333733167.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, sqlm_postgres::types::Array<Vec<sqlm_postgres::types::Enum<(EnumVariant<5755620910692865178>, EnumVariant<10465144470622129318>)>>>, Role>` to implement `IntoFuture`
4 changes: 1 addition & 3 deletions postgres-macros/tests/fail-stable/enum_extra_variant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, 689821
<Vec<T> as Query<Struct<Cols>>>
<Vec<T> as Query<Primitive<<T as SqlType>::Type>>>
<Vec<T> as Query<sqlm_postgres::types::Array<Vec<<T as SqlType>::Type>>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<Enum<...>, 18137070463969723500>)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-b0dd2e997e73b906.long-type-10761428105402107117.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<5755620910692865178>, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, Vec<User>>` to implement `IntoFuture`
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, 689821
<Vec<T> as Query<Struct<Cols>>>
<Vec<T> as Query<Primitive<<T as SqlType>::Type>>>
<Vec<T> as Query<sqlm_postgres::types::Array<Vec<<T as SqlType>::Type>>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<Enum<...>, 18137070463969723500>)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-23861a9b6cd68f51.long-type-6152349442456453118.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<5755620910692865178>, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, Vec<User>>` to implement `IntoFuture`
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ error[E0277]: the trait bound `Vec<User>: Query<Struct<(StructColumn<i64, 689821
<Vec<T> as Query<Struct<Cols>>>
<Vec<T> as Query<Primitive<<T as SqlType>::Type>>>
<Vec<T> as Query<sqlm_postgres::types::Array<Vec<<T as SqlType>::Type>>>>
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<Enum<...>, 18137070463969723500>)>, ...>` to implement `IntoFuture`
= note: the full name for the type has been written to '$WORKSPACE/target/tests/trybuild/aarch64-apple-darwin/debug/deps/$CRATE-07e210c716d12d34.long-type-3071872696375387707.txt'
= note: consider using `--verbose` to print the full type name to the console
= note: required for `Sql<'_, Struct<(StructColumn<i64, 6898215271518772730>, StructColumn<sqlm_postgres::types::Enum<(EnumVariant<5755620910692865178>, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, Vec<User>>` to implement `IntoFuture`
12 changes: 6 additions & 6 deletions postgres-macros/tests/fail/literal_array_to_literal.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ error[E0277]: the trait bound `String: Query<sqlm_postgres::types::Array<Vec<Str
| help: remove the `.await`
|
= help: the following other types implement trait `Query<Cols>`:
<Vec<u8> as Query<Primitive<Bytea>>>
<Vec<Vec<u8>> as Query<Primitive<Bytea>>>
<Vec<Vec<u8>> as Query<sqlm_postgres::types::Array<Vec<Bytea>>>>
<Vec<T> as Query<Struct<Cols>>>
<() as Query<()>>
<Option<T> as Query<Primitive<<T as SqlType>::Type>>>
<Option<T> as Query<Struct<Cols>>>
<Option<Vec<u8>> as Query<Primitive<Bytea>>>
<Vec<T> as Query<Primitive<<T as SqlType>::Type>>>
<Vec<T> as Query<Struct<Cols>>>
<Vec<T> as Query<sqlm_postgres::types::Array<Vec<<T as SqlType>::Type>>>>
<Option<Vec<u8>> as Query<Primitive<Bytea>>>
<Option<T> as Query<Struct<Cols>>>
<Vec<Vec<u8>> as Query<Primitive<Bytea>>>
and $N others
= note: required for `Sql<'_, sqlm_postgres::types::Array<Vec<String>>, String>` to implement `IntoFuture`
6 changes: 3 additions & 3 deletions postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ uuid = ["sqlm-postgres-macros/uuid", "tokio-postgres/with-uuid-1", "dep:uuid"]
pgvector = ["sqlm-postgres-macros/pgvector", "dep:pgvector"]

[dependencies]
deadpool-postgres = "0.12"
deadpool-postgres = "0.13"
dotenvy = "0.15"
http-error = { version = "0.3.0-alpha.1", features = [
"tracing",
] } # git = "https://github.com/rkusa/http-error.git", rev = "1f0630c" } # path = "../../http-error" }
once_cell = "1.17"
pgvector = { version = "0.3", features = ["postgres"], optional = true }
rustls = { version = "0.22" }
rustls = { version = "0.23" }
serde_json = { version = "1.0", optional = true }
sqlm-postgres-macros = { path = "../postgres-macros", default-features = false }
time = { version = "0.3", optional = true }
tokio-postgres = "0.7"
tokio-postgres-rustls = "0.11"
tokio-postgres-rustls = "0.12"
tracing = "0.1"
uuid = { version = "1.4", optional = true }

Expand Down
1 change: 1 addition & 0 deletions postgres/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[rustversion::nightly]
fn main() {
println!("cargo:rustc-cfg=nightly_column_names");
println!("cargo::rustc-check-cfg=cfg(nightly_column_names)");
}

#[rustversion::not(nightly)]
Expand Down
10 changes: 6 additions & 4 deletions postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub use future::SqlFuture;
use once_cell::sync::OnceCell;
pub use query::Query;
pub use row::{FromRow, Row};
use rustls::crypto::CryptoProvider;
pub use sqlm_postgres_macros::{sql, Enum, FromRow};
pub use tokio_postgres;
use tokio_postgres::config::SslMode;
Expand Down Expand Up @@ -101,13 +100,16 @@ impl<'a, Cols, T> Sql<'a, Cols, T> {

#[derive(Debug)]
struct NoServerCertVerify {
crypto_provider: CryptoProvider,
crypto_provider: Arc<rustls::crypto::CryptoProvider>,
}

impl Default for NoServerCertVerify {
fn default() -> Self {
Self {
crypto_provider: rustls::crypto::ring::default_provider(),
crypto_provider: Arc::clone(
rustls::crypto::CryptoProvider::get_default()
.expect("no default provider for rustls installed"),
),
}
}
}
Expand Down Expand Up @@ -153,7 +155,7 @@ impl rustls::client::danger::ServerCertVerifier for NoServerCertVerify {
}

fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
rustls::crypto::ring::default_provider()
self.crypto_provider
.signature_verification_algorithms
.supported_schemes()
}
Expand Down

0 comments on commit 126b152

Please sign in to comment.