mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-23 03:44:04 +03:00
chore: update deps across repo
This commit is contained in:
parent
b699f3fe9e
commit
064d6bb45a
1401
Cargo.lock
generated
1401
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -37,27 +37,26 @@ alloy-sol-types = "0.6.2"
|
|||||||
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
||||||
anyhow = "1.0.71"
|
anyhow = "1.0.71"
|
||||||
async-trait = "0.1.71"
|
async-trait = "0.1.71"
|
||||||
base64 = "0.13"
|
base64 = "0.22.0"
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
blake3 = "1.4.1"
|
blake3 = "1.4.1"
|
||||||
bytes = "1.4.0"
|
bytes = "1.4.0"
|
||||||
cap-std = "2.0.0"
|
|
||||||
chacha20poly1305 = "0.10.1"
|
chacha20poly1305 = "0.10.1"
|
||||||
chrono = "0.4.31"
|
chrono = "0.4.31"
|
||||||
clap = { version = "4.4", features = ["derive"] }
|
clap = { version = "4.4", features = ["derive"] }
|
||||||
crossterm = { version = "0.26.1", features = ["event-stream", "bracketed-paste"] }
|
crossterm = { version = "0.27.0", features = ["event-stream", "bracketed-paste"] }
|
||||||
curve25519-dalek = "^4.1.2"
|
curve25519-dalek = "^4.1.2"
|
||||||
dashmap = "5.5.3"
|
dashmap = "5.5.3"
|
||||||
digest = "0.10"
|
digest = "0.10"
|
||||||
elliptic-curve = { version = "0.13.8", features = ["ecdh"] }
|
elliptic-curve = { version = "0.13.8", features = ["ecdh"] }
|
||||||
flate2 = "1.0"
|
flate2 = "1.0"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
generic-array = "0.14"
|
generic-array = "1.0.0"
|
||||||
getrandom = "0.2.10"
|
getrandom = "0.2.10"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
hkdf = "0.12.3"
|
hkdf = "0.12.3"
|
||||||
hmac = "0.12"
|
hmac = "0.12"
|
||||||
http = "0.2.9"
|
http = "1.1.0"
|
||||||
jwt = "0.16"
|
jwt = "0.16"
|
||||||
lib = { path = "../lib" }
|
lib = { path = "../lib" }
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
@ -67,12 +66,12 @@ num-traits = "0.2"
|
|||||||
open = "5.0.0"
|
open = "5.0.0"
|
||||||
public-ip = "0.2.2"
|
public-ip = "0.2.2"
|
||||||
rand = "0.8.4"
|
rand = "0.8.4"
|
||||||
reqwest = "0.11.18"
|
reqwest = "0.12.4"
|
||||||
ring = "0.16.20"
|
ring = "0.17.8"
|
||||||
rmp-serde = "1.1.2"
|
rmp-serde = "1.1.2"
|
||||||
rocksdb = { version = "0.21.0", features = ["multi-threaded-cf"] }
|
rocksdb = { version = "0.22.0", features = ["multi-threaded-cf"] }
|
||||||
route-recognizer = "0.3.1"
|
route-recognizer = "0.3.1"
|
||||||
rusqlite = { version = "0.30.0", features = ["bundled"] }
|
rusqlite = { version = "0.31.0", features = ["bundled"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_urlencoded = "0.7"
|
serde_urlencoded = "0.7"
|
||||||
@ -81,12 +80,11 @@ snow = { version = "0.9.3", features = ["ring-resolver"] }
|
|||||||
static_dir = "0.2.0"
|
static_dir = "0.2.0"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tokio = { version = "1.28", features = ["fs", "macros", "rt-multi-thread", "signal", "sync"] }
|
tokio = { version = "1.28", features = ["fs", "macros", "rt-multi-thread", "signal", "sync"] }
|
||||||
tokio-stream = "0.1.14"
|
tokio-tungstenite = "0.21.0"
|
||||||
tokio-tungstenite = "0.20.1"
|
|
||||||
url = "2.4.1"
|
url = "2.4.1"
|
||||||
uuid = { version = "1.1.2", features = ["serde", "v4"] }
|
uuid = { version = "1.1.2", features = ["serde", "v4"] }
|
||||||
warp = "0.3.5"
|
warp = "0.3.5"
|
||||||
wasi-common = "19.0.1"
|
wasi-common = "19.0.1"
|
||||||
wasmtime = "19.0.1"
|
wasmtime = "19.0.1"
|
||||||
wasmtime-wasi = "19.0.1"
|
wasmtime-wasi = "19.0.1"
|
||||||
zip = "0.6"
|
zip = "1.1.1"
|
||||||
|
@ -20,7 +20,7 @@ sha3 = "0.10.8"
|
|||||||
url = "2.4.1"
|
url = "2.4.1"
|
||||||
urlencoding = "2.1.0"
|
urlencoding = "2.1.0"
|
||||||
wit-bindgen = "0.24.0"
|
wit-bindgen = "0.24.0"
|
||||||
zip = { version = "0.6.6", default-features = false }
|
zip = { version = "1.1.1", default-features = false }
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
@ -8,7 +8,7 @@ simulation-mode = []
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
base64 = "0.13"
|
base64 = "0.22.0"
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" }
|
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.6.1" }
|
||||||
pleco = "0.5"
|
pleco = "0.5"
|
||||||
|
@ -2,6 +2,7 @@ use crate::http::server_types::*;
|
|||||||
use crate::http::utils::*;
|
use crate::http::utils::*;
|
||||||
use crate::{keygen, register};
|
use crate::{keygen, register};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use base64::{engine::general_purpose::STANDARD as base64_standard, Engine};
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use futures::{SinkExt, StreamExt};
|
use futures::{SinkExt, StreamExt};
|
||||||
use http::uri::Authority;
|
use http::uri::Authority;
|
||||||
@ -343,14 +344,14 @@ async fn login_handler(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut response = warp::reply::with_status(
|
let mut response = warp::reply::with_status(
|
||||||
warp::reply::json(&base64::encode(encoded_keyfile.to_vec())),
|
warp::reply::json(&base64_standard.encode(encoded_keyfile.to_vec())),
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
)
|
)
|
||||||
.into_response();
|
.into_response();
|
||||||
|
|
||||||
match HeaderValue::from_str(&format!("kinode-auth_{}={};", our.as_ref(), &token)) {
|
match HeaderValue::from_str(&format!("kinode-auth_{}={};", our.as_ref(), &token)) {
|
||||||
Ok(v) => {
|
Ok(v) => {
|
||||||
response.headers_mut().append(http::header::SET_COOKIE, v);
|
response.headers_mut().append("set-cookie", v);
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
Err(_) => Ok(warp::reply::with_status(
|
Err(_) => Ok(warp::reply::with_status(
|
||||||
@ -372,7 +373,7 @@ async fn ws_handler(
|
|||||||
ws_connection: Ws,
|
ws_connection: Ws,
|
||||||
socket_addr: Option<SocketAddr>,
|
socket_addr: Option<SocketAddr>,
|
||||||
path: warp::path::FullPath,
|
path: warp::path::FullPath,
|
||||||
host: Option<Authority>,
|
host: Option<warp::host::Authority>,
|
||||||
headers: warp::http::HeaderMap,
|
headers: warp::http::HeaderMap,
|
||||||
our: Arc<String>,
|
our: Arc<String>,
|
||||||
jwt_secret_bytes: Arc<Vec<u8>>,
|
jwt_secret_bytes: Arc<Vec<u8>>,
|
||||||
@ -468,7 +469,7 @@ async fn ws_handler(
|
|||||||
async fn http_handler(
|
async fn http_handler(
|
||||||
method: warp::http::Method,
|
method: warp::http::Method,
|
||||||
socket_addr: Option<SocketAddr>,
|
socket_addr: Option<SocketAddr>,
|
||||||
host: Option<Authority>,
|
host: Option<warp::host::Authority>,
|
||||||
path: warp::path::FullPath,
|
path: warp::path::FullPath,
|
||||||
query_params: HashMap<String, String>,
|
query_params: HashMap<String, String>,
|
||||||
headers: warp::http::HeaderMap,
|
headers: warp::http::HeaderMap,
|
||||||
@ -529,7 +530,7 @@ async fn http_handler(
|
|||||||
"Location",
|
"Location",
|
||||||
format!(
|
format!(
|
||||||
"http://{}/login",
|
"http://{}/login",
|
||||||
host.unwrap_or(Authority::from_static("localhost"))
|
host.unwrap_or(warp::host::Authority::from_static("localhost"))
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.body(vec![])
|
.body(vec![])
|
||||||
@ -619,7 +620,7 @@ async fn http_handler(
|
|||||||
method: method.to_string(),
|
method: method.to_string(),
|
||||||
url: format!(
|
url: format!(
|
||||||
"http://{}{}",
|
"http://{}{}",
|
||||||
host.unwrap_or(Authority::from_static("localhost")),
|
host.unwrap_or(warp::host::Authority::from_static("localhost")),
|
||||||
original_path
|
original_path
|
||||||
),
|
),
|
||||||
bound_path: bound_path.path.clone(),
|
bound_path: bound_path.path.clone(),
|
||||||
@ -735,7 +736,7 @@ async fn handle_rpc_message(
|
|||||||
|
|
||||||
let blob: Option<LazyLoadBlob> = match rpc_message.data {
|
let blob: Option<LazyLoadBlob> = match rpc_message.data {
|
||||||
None => None,
|
None => None,
|
||||||
Some(b64_bytes) => match base64::decode(b64_bytes) {
|
Some(b64_bytes) => match base64_standard.decode(b64_bytes) {
|
||||||
Ok(bytes) => Some(LazyLoadBlob {
|
Ok(bytes) => Some(LazyLoadBlob {
|
||||||
mime: rpc_message.mime,
|
mime: rpc_message.mime,
|
||||||
bytes,
|
bytes,
|
||||||
@ -1069,7 +1070,7 @@ async fn handle_app_message(
|
|||||||
if path == "/rpc:distro:sys/message" {
|
if path == "/rpc:distro:sys/message" {
|
||||||
let blob = km.lazy_load_blob.map(|p| LazyLoadBlob {
|
let blob = km.lazy_load_blob.map(|p| LazyLoadBlob {
|
||||||
mime: p.mime,
|
mime: p.mime,
|
||||||
bytes: base64::encode(p.bytes).into_bytes(),
|
bytes: base64_standard.encode(p.bytes).into_bytes(),
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut default_headers = HashMap::new();
|
let mut default_headers = HashMap::new();
|
||||||
|
@ -9,6 +9,7 @@ use alloy_signer::Signature;
|
|||||||
use alloy_sol_macro::sol;
|
use alloy_sol_macro::sol;
|
||||||
use alloy_sol_types::{SolCall, SolValue};
|
use alloy_sol_types::{SolCall, SolValue};
|
||||||
use alloy_transport_ws::WsConnect;
|
use alloy_transport_ws::WsConnect;
|
||||||
|
use base64::{engine::general_purpose::STANDARD as base64_standard, Engine};
|
||||||
use hmac::Hmac;
|
use hmac::Hmac;
|
||||||
use jwt::SignWithKey;
|
use jwt::SignWithKey;
|
||||||
use lib::types::core::*;
|
use lib::types::core::*;
|
||||||
@ -366,7 +367,9 @@ async fn handle_keyfile_vet(
|
|||||||
// additional checks?
|
// additional checks?
|
||||||
let encoded_keyfile = match payload.keyfile.is_empty() {
|
let encoded_keyfile = match payload.keyfile.is_empty() {
|
||||||
true => keyfile.ok_or(warp::reject())?,
|
true => keyfile.ok_or(warp::reject())?,
|
||||||
false => base64::decode(payload.keyfile).map_err(|_| warp::reject())?,
|
false => base64_standard
|
||||||
|
.decode(payload.keyfile)
|
||||||
|
.map_err(|_| warp::reject())?,
|
||||||
};
|
};
|
||||||
|
|
||||||
let decoded_keyfile = keygen::decode_keyfile(&encoded_keyfile, &payload.password_hash)
|
let decoded_keyfile = keygen::decode_keyfile(&encoded_keyfile, &payload.password_hash)
|
||||||
@ -543,7 +546,7 @@ async fn handle_import_keyfile(
|
|||||||
provider: Arc<Provider<PubSubFrontend>>,
|
provider: Arc<Provider<PubSubFrontend>>,
|
||||||
) -> Result<impl Reply, Rejection> {
|
) -> Result<impl Reply, Rejection> {
|
||||||
// if keyfile was not present in node and is present from user upload
|
// if keyfile was not present in node and is present from user upload
|
||||||
let encoded_keyfile = match base64::decode(info.keyfile.clone()) {
|
let encoded_keyfile = match base64_standard.decode(info.keyfile.clone()) {
|
||||||
Ok(k) => k,
|
Ok(k) => k,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
return Ok(warp::reply::with_status(
|
return Ok(warp::reply::with_status(
|
||||||
@ -762,7 +765,7 @@ async fn success_response(
|
|||||||
decoded_keyfile: Keyfile,
|
decoded_keyfile: Keyfile,
|
||||||
encoded_keyfile: Vec<u8>,
|
encoded_keyfile: Vec<u8>,
|
||||||
) -> Result<warp::reply::Response, Rejection> {
|
) -> Result<warp::reply::Response, Rejection> {
|
||||||
let encoded_keyfile_str = base64::encode(&encoded_keyfile);
|
let encoded_keyfile_str = base64_standard.encode(&encoded_keyfile);
|
||||||
let token = match generate_jwt(&decoded_keyfile.jwt_secret_bytes, &our.name) {
|
let token = match generate_jwt(&decoded_keyfile.jwt_secret_bytes, &our.name) {
|
||||||
Some(token) => token,
|
Some(token) => token,
|
||||||
None => {
|
None => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use base64::{engine::general_purpose::STANDARD as base64_standard, Engine};
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use rusqlite::Connection;
|
use rusqlite::Connection;
|
||||||
use std::collections::{HashMap, HashSet, VecDeque};
|
use std::collections::{HashMap, HashSet, VecDeque};
|
||||||
@ -201,7 +202,9 @@ async fn handle_request(
|
|||||||
serde_json::Number::from_f64(real).unwrap(),
|
serde_json::Number::from_f64(real).unwrap(),
|
||||||
),
|
),
|
||||||
SqlValue::Text(text) => serde_json::Value::String(text),
|
SqlValue::Text(text) => serde_json::Value::String(text),
|
||||||
SqlValue::Blob(blob) => serde_json::Value::String(base64::encode(blob)), // or another representation if you prefer
|
SqlValue::Blob(blob) => {
|
||||||
|
serde_json::Value::String(base64_standard.encode(blob))
|
||||||
|
} // or another representation if you prefer
|
||||||
_ => serde_json::Value::Null,
|
_ => serde_json::Value::Null,
|
||||||
};
|
};
|
||||||
map.insert(column_name.clone(), value_json);
|
map.insert(column_name.clone(), value_json);
|
||||||
@ -511,7 +514,7 @@ fn json_to_sqlite(value: &serde_json::Value) -> Result<SqlValue, SqliteError> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
serde_json::Value::String(s) => {
|
serde_json::Value::String(s) => {
|
||||||
match base64::decode(s) {
|
match base64_standard.decode(s) {
|
||||||
Ok(decoded_bytes) => {
|
Ok(decoded_bytes) => {
|
||||||
// convert to SQLite Blob if it's a valid base64 string
|
// convert to SQLite Blob if it's a valid base64 string
|
||||||
Ok(SqlValue::Blob(decoded_bytes))
|
Ok(SqlValue::Blob(decoded_bytes))
|
||||||
|
@ -13,15 +13,15 @@ license = "Apache-2.0"
|
|||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0.71"
|
anyhow = "1.0.71"
|
||||||
kit = { git = "https://github.com/kinode-dao/kit", rev = "659f59e" }
|
kit = { git = "https://github.com/kinode-dao/kit", rev = "659f59e" }
|
||||||
reqwest = { version = "0.11.22", features = ["blocking"] }
|
reqwest = { version = "0.12.4", features = ["blocking"] }
|
||||||
tokio = "1.28"
|
tokio = "1.28"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" }
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
rand = "0.8.4"
|
rand = "0.8.4"
|
||||||
ring = "0.16.20"
|
ring = "0.17.8"
|
||||||
rusqlite = { version = "0.30.0", features = ["bundled"] }
|
rusqlite = { version = "0.31.0", features = ["bundled"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user