Skip to content

Commit

Permalink
chore: Bump Rust and Node deps (#233)
Browse files Browse the repository at this point in the history
* chore: Bump Rust and Node deps

* Update changelog link

* Remove outdated comment

* Move PR link

* Bump stackable-operator and kube deps
  • Loading branch information
Techassi authored Apr 25, 2024
1 parent fd42c54 commit 60dc13a
Show file tree
Hide file tree
Showing 12 changed files with 1,617 additions and 1,443 deletions.
952 changes: 556 additions & 396 deletions Cargo.lock

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ repository = "https://github.com/stackabletech/stackable-cockpit/"

[workspace.dependencies]
async-trait = "0.1"
axum = { version = "0.6", features = ["http2", "headers"] }
axum = { version = "0.7", features = ["http2"] }
axum-extra = { version = "0.9", features = ["typed-header"] }
bcrypt = "0.15"
bindgen = "0.68.1"
bindgen = "0.69.4"
cc = "1.0.83"
clap = { version = "4.2.1", features = ["derive", "env"] }
clap_complete = "4.2"
Expand All @@ -27,10 +28,10 @@ directories = "5.0"
dotenvy = "0.15"
futures = "0.3"
indexmap = { version = "2.0", features = ["serde"] }
k8s-openapi = { version = "0.20", default-features = false, features = [
"v1_28",
k8s-openapi = { version = "0.21", default-features = false, features = [
"v1_29",
] }
kube = { version = "0.87", default-features = false, features = [
kube = { version = "0.90", default-features = false, features = [
"client",
"rustls-tls",
"ws",
Expand All @@ -42,17 +43,17 @@ phf = "0.11"
phf_codegen = "0.11"
rand = "0.8"
regex = "1.9"
reqwest = { version = "0.11", default-features = false, features = [
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
] }
rstest = "0.18"
rstest = "0.19"
semver = { version = "1.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
sha2 = "0.10"
snafu = { version = "0.7", features = ["futures"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
snafu = { version = "0.8", features = ["futures"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.67.0" }
tera = "1.18"
termion = "3.0.0"
tokio = { version = "1.29.0", features = [
Expand All @@ -62,14 +63,14 @@ tokio = { version = "1.29.0", features = [
"process",
"io-std",
] }
tower-http = "0.4"
tower-http = { version = "0.5", features = ["validate-request"] }
tracing = "0.1"
tracing-subscriber = "0.3"
url = "2.3"
utoipa = { version = "3.3", features = ["indexmap"] }
utoipa-swagger-ui = { version = "3.1", features = ["axum"] }
utoipa = { version = "4.2", features = ["indexmap"] }
utoipa-swagger-ui = { version = "6.0", features = ["axum"] }
uuid = { version = "1.4.0", features = ["v4"] }
which = "4.4"
which = "6.0"

# [patch."https://github.com/stackabletech/operator-rs.git"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
Expand Down
2 changes: 1 addition & 1 deletion rust/helm-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() {

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

Expand Down
4 changes: 2 additions & 2 deletions rust/stackable-cockpit/src/platform/cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ type Result<T, E = Error> = std::result::Result<T, E>;
pub enum Error {
#[snafu(display("failed to parse node cpu quantity"))]
ParseNodeCpuQuantity {
source: stackable_operator::error::Error,
source: stackable_operator::cpu::Error,
},

#[snafu(display("failed to parse node memory quantity"))]
ParseNodeMemoryQuantity {
source: stackable_operator::error::Error,
source: stackable_operator::memory::Error,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ pub enum ResourceRequestsError {

#[snafu(display("failed to parse cpu resource requirements"))]
ParseCpuResourceRequirements {
source: stackable_operator::error::Error,
source: stackable_operator::cpu::Error,
},

#[snafu(display("failed to parse memory resource requirements"))]
ParseMemoryResourceRequirements {
source: stackable_operator::error::Error,
source: stackable_operator::memory::Error,
},

#[snafu(display("invalid resource requirements"))]
Expand Down
1 change: 1 addition & 0 deletions rust/stackable-cockpitd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ stackable-cockpit = { path = "../stackable-cockpit", features = ["openapi"] }
stackable-cockpit-web = { path = "../../web", optional = true }

axum.workspace = true
axum-extra.workspace = true
bcrypt.workspace = true
clap.workspace = true
futures.workspace = true
Expand Down
11 changes: 6 additions & 5 deletions rust/stackable-cockpitd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::net::SocketAddr;
use axum::{
response::Redirect,
routing::{get, post},
Router, Server,
Router,
};
use clap::Parser;
use futures::FutureExt;
Expand All @@ -12,6 +12,7 @@ use stackable_cockpitd::{
api_doc, handlers,
middleware::{self, authentication::Authenticator},
};
use tokio::net::TcpListener;
use tracing::{info, metadata::LevelFilter};
use tracing_subscriber::{fmt, EnvFilter};
use utoipa_swagger_ui::SwaggerUi;
Expand Down Expand Up @@ -59,11 +60,11 @@ async fn main() -> Result<(), Whatever> {
let listen_addr = SocketAddr::new(cli.address, cli.port);
info!(addr = %listen_addr, "Starting server");

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

if let Err(err) = Server::bind(&listen_addr)
.serve(router.into_make_service())
if let Err(err) = axum::serve(tcp_listener, router)
.with_graceful_shutdown(wait_for_shutdown_signal())
.await
{
Expand Down
17 changes: 8 additions & 9 deletions rust/stackable-cockpitd/src/middleware/authentication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ use std::{
};

use axum::{
body::BoxBody,
body::Body,
extract::Extension,
headers::{
authorization::{Basic, Bearer},
HeaderMapExt,
},
http::{HeaderMap, HeaderValue, StatusCode},
response::IntoResponse,
Json,
};
use axum_extra::headers::{
authorization::{Basic, Bearer},
Authorization, HeaderMapExt,
};
use serde::Serialize;
use tower_http::validate_request::{ValidateRequest, ValidateRequestHeaderLayer};
use utoipa::ToSchema;
Expand Down Expand Up @@ -67,7 +67,7 @@ impl Authenticator {
}

fn validate_login(&self, headers: &HeaderMap<HeaderValue>) -> Result<Username, &'static str> {
if let Some(session_token) = headers.typed_get::<axum::headers::Authorization<Bearer>>() {
if let Some(session_token) = headers.typed_get::<Authorization<Bearer>>() {
if let Some(username) = self
.state
.sessions
Expand All @@ -79,8 +79,7 @@ impl Authenticator {
} else {
Err("request authentication failed: invalid session token")
}
} else if let Some(basic_creds) = headers.typed_get::<axum::headers::Authorization<Basic>>()
{
} else if let Some(basic_creds) = headers.typed_get::<Authorization<Basic>>() {
let username = basic_creds.username();
let password_hash = self.state.accounts.get(username);
if password_hash
Expand All @@ -104,7 +103,7 @@ impl Authenticator {
}

impl<B> ValidateRequest<B> for Authenticator {
type ResponseBody = BoxBody;
type ResponseBody = Body;

fn validate(
&mut self,
Expand Down
11 changes: 11 additions & 0 deletions rust/stackablectl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add pre-built binary for `aarch64-unknown-linux-gnu` ([#232]).

### Changed

- Bump Rust dependencies ([#233]).

[#232]: https://github.com/stackabletech/stackable-cockpit/pull/232
[#233]: https://github.com/stackabletech/stackable-cockpit/pull/233

## [24.3.1] - 2024-03-21

### Added
Expand Down
2 changes: 1 addition & 1 deletion rust/stackablectl/src/cmds/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use futures::{
use rand::Rng;
use snafu::{futures::TryFutureExt as _, OptionExt, ResultExt, Snafu};
use stackable_operator::{
builder::SecurityContextBuilder,
builder::pod::security::SecurityContextBuilder,
k8s_openapi::api::core::v1::{ContainerStatus, EphemeralContainer, Pod, PodSpec},
kube::{
self,
Expand Down
2 changes: 2 additions & 0 deletions web/src/api/schema.d.ts

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

Loading

0 comments on commit 60dc13a

Please sign in to comment.