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

chore: Bump Rust and Node deps #233

Merged
merged 5 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
748 changes: 507 additions & 241 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 13 additions & 12 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 = [
k8s-openapi = { version = "0.21", default-features = false, features = [
sbernauer marked this conversation as resolved.
Show resolved Hide resolved
"v1_28",
] }
kube = { version = "0.87", default-features = false, features = [
kube = { version = "0.88.1", 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.66.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
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
12 changes: 12 additions & 0 deletions rust/stackablectl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

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

[#232]: https://github.com/stackabletech/stackable-cockpit/pull/232
sbernauer marked this conversation as resolved.
Show resolved Hide resolved

### Changed

- Bump Rust and Node dependencies ([#233]).

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

## [24.3.1] - 2024-03-21

### Added
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
Loading