Skip to content

Commit 60dc13a

Browse files
authored
chore: Bump Rust and Node deps (#233)
* chore: Bump Rust and Node deps * Update changelog link * Remove outdated comment * Move PR link * Bump stackable-operator and kube deps
1 parent fd42c54 commit 60dc13a

File tree

12 files changed

+1617
-1443
lines changed

12 files changed

+1617
-1443
lines changed

Cargo.lock

Lines changed: 556 additions & 396 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ repository = "https://github.com/stackabletech/stackable-cockpit/"
1616

1717
[workspace.dependencies]
1818
async-trait = "0.1"
19-
axum = { version = "0.6", features = ["http2", "headers"] }
19+
axum = { version = "0.7", features = ["http2"] }
20+
axum-extra = { version = "0.9", features = ["typed-header"] }
2021
bcrypt = "0.15"
21-
bindgen = "0.68.1"
22+
bindgen = "0.69.4"
2223
cc = "1.0.83"
2324
clap = { version = "4.2.1", features = ["derive", "env"] }
2425
clap_complete = "4.2"
@@ -27,10 +28,10 @@ directories = "5.0"
2728
dotenvy = "0.15"
2829
futures = "0.3"
2930
indexmap = { version = "2.0", features = ["serde"] }
30-
k8s-openapi = { version = "0.20", default-features = false, features = [
31-
"v1_28",
31+
k8s-openapi = { version = "0.21", default-features = false, features = [
32+
"v1_29",
3233
] }
33-
kube = { version = "0.87", default-features = false, features = [
34+
kube = { version = "0.90", default-features = false, features = [
3435
"client",
3536
"rustls-tls",
3637
"ws",
@@ -42,17 +43,17 @@ phf = "0.11"
4243
phf_codegen = "0.11"
4344
rand = "0.8"
4445
regex = "1.9"
45-
reqwest = { version = "0.11", default-features = false, features = [
46+
reqwest = { version = "0.12", default-features = false, features = [
4647
"rustls-tls",
4748
] }
48-
rstest = "0.18"
49+
rstest = "0.19"
4950
semver = { version = "1.0", features = ["serde"] }
5051
serde = { version = "1.0", features = ["derive"] }
5152
serde_json = "1.0"
5253
serde_yaml = "0.9"
5354
sha2 = "0.10"
54-
snafu = { version = "0.7", features = ["futures"] }
55-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
55+
snafu = { version = "0.8", features = ["futures"] }
56+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.67.0" }
5657
tera = "1.18"
5758
termion = "3.0.0"
5859
tokio = { version = "1.29.0", features = [
@@ -62,14 +63,14 @@ tokio = { version = "1.29.0", features = [
6263
"process",
6364
"io-std",
6465
] }
65-
tower-http = "0.4"
66+
tower-http = { version = "0.5", features = ["validate-request"] }
6667
tracing = "0.1"
6768
tracing-subscriber = "0.3"
6869
url = "2.3"
69-
utoipa = { version = "3.3", features = ["indexmap"] }
70-
utoipa-swagger-ui = { version = "3.1", features = ["axum"] }
70+
utoipa = { version = "4.2", features = ["indexmap"] }
71+
utoipa-swagger-ui = { version = "6.0", features = ["axum"] }
7172
uuid = { version = "1.4.0", features = ["v4"] }
72-
which = "4.4"
73+
which = "6.0"
7374

7475
# [patch."https://github.com/stackabletech/operator-rs.git"]
7576
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }

rust/helm-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn main() {
5555

5656
let bindings = bindgen::builder()
5757
.header(build_path.join("libgo-helm-wrapper.h").to_str().unwrap())
58-
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
58+
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
5959
.generate()
6060
.expect("Failed to generate Rust bindings from Go header file");
6161

rust/stackable-cockpit/src/platform/cluster/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ type Result<T, E = Error> = std::result::Result<T, E>;
1313
pub enum Error {
1414
#[snafu(display("failed to parse node cpu quantity"))]
1515
ParseNodeCpuQuantity {
16-
source: stackable_operator::error::Error,
16+
source: stackable_operator::cpu::Error,
1717
},
1818

1919
#[snafu(display("failed to parse node memory quantity"))]
2020
ParseNodeMemoryQuantity {
21-
source: stackable_operator::error::Error,
21+
source: stackable_operator::memory::Error,
2222
},
2323
}
2424

rust/stackable-cockpit/src/platform/cluster/resource_request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ pub enum ResourceRequestsError {
5151

5252
#[snafu(display("failed to parse cpu resource requirements"))]
5353
ParseCpuResourceRequirements {
54-
source: stackable_operator::error::Error,
54+
source: stackable_operator::cpu::Error,
5555
},
5656

5757
#[snafu(display("failed to parse memory resource requirements"))]
5858
ParseMemoryResourceRequirements {
59-
source: stackable_operator::error::Error,
59+
source: stackable_operator::memory::Error,
6060
},
6161

6262
#[snafu(display("invalid resource requirements"))]

rust/stackable-cockpitd/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ stackable-cockpit = { path = "../stackable-cockpit", features = ["openapi"] }
1818
stackable-cockpit-web = { path = "../../web", optional = true }
1919

2020
axum.workspace = true
21+
axum-extra.workspace = true
2122
bcrypt.workspace = true
2223
clap.workspace = true
2324
futures.workspace = true

rust/stackable-cockpitd/src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::net::SocketAddr;
33
use axum::{
44
response::Redirect,
55
routing::{get, post},
6-
Router, Server,
6+
Router,
77
};
88
use clap::Parser;
99
use futures::FutureExt;
@@ -12,6 +12,7 @@ use stackable_cockpitd::{
1212
api_doc, handlers,
1313
middleware::{self, authentication::Authenticator},
1414
};
15+
use tokio::net::TcpListener;
1516
use tracing::{info, metadata::LevelFilter};
1617
use tracing_subscriber::{fmt, EnvFilter};
1718
use utoipa_swagger_ui::SwaggerUi;
@@ -59,11 +60,11 @@ async fn main() -> Result<(), Whatever> {
5960
let listen_addr = SocketAddr::new(cli.address, cli.port);
6061
info!(addr = %listen_addr, "Starting server");
6162

62-
// Needed in next axum version
63-
// let listener = TcpListener::bind("127.0.0.1:8000").await?;
63+
let tcp_listener = TcpListener::bind(listen_addr)
64+
.await
65+
.whatever_context("failed to bind to listen address")?;
6466

65-
if let Err(err) = Server::bind(&listen_addr)
66-
.serve(router.into_make_service())
67+
if let Err(err) = axum::serve(tcp_listener, router)
6768
.with_graceful_shutdown(wait_for_shutdown_signal())
6869
.await
6970
{

rust/stackable-cockpitd/src/middleware/authentication/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ use std::{
66
};
77

88
use axum::{
9-
body::BoxBody,
9+
body::Body,
1010
extract::Extension,
11-
headers::{
12-
authorization::{Basic, Bearer},
13-
HeaderMapExt,
14-
},
1511
http::{HeaderMap, HeaderValue, StatusCode},
1612
response::IntoResponse,
1713
Json,
1814
};
15+
use axum_extra::headers::{
16+
authorization::{Basic, Bearer},
17+
Authorization, HeaderMapExt,
18+
};
1919
use serde::Serialize;
2020
use tower_http::validate_request::{ValidateRequest, ValidateRequestHeaderLayer};
2121
use utoipa::ToSchema;
@@ -67,7 +67,7 @@ impl Authenticator {
6767
}
6868

6969
fn validate_login(&self, headers: &HeaderMap<HeaderValue>) -> Result<Username, &'static str> {
70-
if let Some(session_token) = headers.typed_get::<axum::headers::Authorization<Bearer>>() {
70+
if let Some(session_token) = headers.typed_get::<Authorization<Bearer>>() {
7171
if let Some(username) = self
7272
.state
7373
.sessions
@@ -79,8 +79,7 @@ impl Authenticator {
7979
} else {
8080
Err("request authentication failed: invalid session token")
8181
}
82-
} else if let Some(basic_creds) = headers.typed_get::<axum::headers::Authorization<Basic>>()
83-
{
82+
} else if let Some(basic_creds) = headers.typed_get::<Authorization<Basic>>() {
8483
let username = basic_creds.username();
8584
let password_hash = self.state.accounts.get(username);
8685
if password_hash
@@ -104,7 +103,7 @@ impl Authenticator {
104103
}
105104

106105
impl<B> ValidateRequest<B> for Authenticator {
107-
type ResponseBody = BoxBody;
106+
type ResponseBody = Body;
108107

109108
fn validate(
110109
&mut self,

rust/stackablectl/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Add pre-built binary for `aarch64-unknown-linux-gnu` ([#232]).
10+
11+
### Changed
12+
13+
- Bump Rust dependencies ([#233]).
14+
15+
[#232]: https://github.com/stackabletech/stackable-cockpit/pull/232
16+
[#233]: https://github.com/stackabletech/stackable-cockpit/pull/233
17+
718
## [24.3.1] - 2024-03-21
819

920
### Added

rust/stackablectl/src/cmds/debug.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use futures::{
1212
use rand::Rng;
1313
use snafu::{futures::TryFutureExt as _, OptionExt, ResultExt, Snafu};
1414
use stackable_operator::{
15-
builder::SecurityContextBuilder,
15+
builder::pod::security::SecurityContextBuilder,
1616
k8s_openapi::api::core::v1::{ContainerStatus, EphemeralContainer, Pod, PodSpec},
1717
kube::{
1818
self,

0 commit comments

Comments
 (0)