fix auth issues
This commit is contained in:
parent
375a09d6f7
commit
44d00a3fd1
20 changed files with 88 additions and 27 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -2449,6 +2449,7 @@ dependencies = [
|
|||
"ctor",
|
||||
"rnex-rmc",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2471,6 +2472,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"ctor",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2503,6 +2505,7 @@ dependencies = [
|
|||
"ctor",
|
||||
"rnex-base-protos",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2533,6 +2536,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"ctor",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2563,6 +2567,7 @@ dependencies = [
|
|||
"rnex-base-protos",
|
||||
"rnex-rmc",
|
||||
"rnex-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2581,6 +2586,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"ctor",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2615,6 +2621,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"ctor",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2640,6 +2647,7 @@ dependencies = [
|
|||
"ctor",
|
||||
"rnex-base-protos",
|
||||
"rnex-rmc",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -28,9 +28,12 @@ members = [
|
|||
"rnex-server-nex-modules/rnex-node-holder",
|
||||
"rnex-server-nex-modules/rnex-base",
|
||||
"rnex-server-nex-modules/rnex-msg",
|
||||
"rnex-server-nex-modules/rnex-auth"
|
||||
, "prudpv1-proxy"]
|
||||
"rnex-server-nex-modules/rnex-auth",
|
||||
"prudpv1-proxy"
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
tracing = "0.1.44"
|
||||
|
||||
[workspace.lints.clippy]
|
||||
print_stdout = { level = "deny", priority = 1}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ cfg-if = "1.0.4"
|
|||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tokio = { version = "1.52.3", features = ["time", "sync"] }
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
friends = []
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ edition = "2024"
|
|||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ edition = "2024"
|
|||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ edition = "2024"
|
|||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
|
|
|
|||
|
|
@ -9,12 +9,9 @@ rnex-rmc = { path = "../../rnex-rmc" }
|
|||
cfg-if = "1.0.4"
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
rnex-util = {path = "../../rnex-util"}
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
datastore = ["database-support", "v3-8-15"]
|
||||
database-support = []
|
||||
nx = []
|
||||
third-notif-param = []
|
||||
v3-3-2 = []
|
||||
v3-4-0 = ["v3-3-2", "third-notif-param"]
|
||||
|
|
@ -22,9 +19,6 @@ v3-5-0 = ["v3-4-0"]
|
|||
v3-8-15 = ["v3-5-0"]
|
||||
v3-10-22 = ["v3-8-15"]
|
||||
v4-3-11 = ["v3-8-15"]
|
||||
friends = []
|
||||
rmc_struct_header = []
|
||||
big_pid = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ edition = "2024"
|
|||
|
||||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
tracing = "0.1.44"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ edition = "2024"
|
|||
[dependencies]
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tracing = "0.1.44"
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ edition = "2024"
|
|||
bytemuck = { version = "1.25.0", features = ["derive"] }
|
||||
ctor = "1.0.8"
|
||||
rnex-rmc = { path = "../../rnex-rmc" }
|
||||
tracing = "0.1.44"
|
||||
rnex-base-protos = { path = "../base-protos" }
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ edition = "2024"
|
|||
[dependencies]
|
||||
bytemuck = { version = "1.25.0", features = ["derive"] }
|
||||
thiserror = "2.0.18"
|
||||
tracing = "0.1.44"
|
||||
v-byte-helpers = { git = "https://github.com/RusticMaple/VByteMacros", version = "0.1.1" }
|
||||
rnex-util = { path = "../rnex-util" }
|
||||
tokio = { version = "1.52.3", features = ["sync", "io-util", "rt", "macros", "time"] }
|
||||
|
|
@ -15,6 +14,7 @@ rnex-rmc-macros = { path = "./macros" }
|
|||
paste = "1.0.15"
|
||||
rand = "0.10.2"
|
||||
hex = "0.4.3"
|
||||
tracing.workspace = true
|
||||
|
||||
[features]
|
||||
splatoon = ["v3-5-0"]
|
||||
|
|
@ -23,7 +23,7 @@ database-support = []
|
|||
nx = []
|
||||
third-notif-param = []
|
||||
v3-3-2 = []
|
||||
v3-4-0 = ["v3-3-2", "third-notif-param"]
|
||||
v3-4-0 = ["v3-3-2", "third-notif-param", "rmc_struct_header"]
|
||||
v3-5-0 = ["v3-4-0"]
|
||||
v3-8-15 = ["v3-5-0"]
|
||||
v3-10-22 = ["v3-8-15"]
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ impl RmcProtocolData {
|
|||
quote! {
|
||||
#[inline(always)]
|
||||
#attribs
|
||||
#[::rnex_rmc::tracing::instrument]
|
||||
async fn #raw_name (&self, data: &[u8]) #optional_return{
|
||||
let mut cursor = ::std::io::Cursor::new(data);
|
||||
#deser_params
|
||||
|
|
@ -303,12 +304,12 @@ impl RmcProtocolData {
|
|||
quote! {
|
||||
#[allow(unused_must_use)]
|
||||
#[automatically_derived]
|
||||
pub trait #raw_name: #name{
|
||||
pub trait #raw_name: #name + ::std::fmt::Debug{
|
||||
#proto_raw_methods
|
||||
#rmc_call_proto
|
||||
}
|
||||
#[automatically_derived]
|
||||
impl<T: #name> #raw_name for T{}
|
||||
impl<T: #name + ::std::fmt::Debug> #raw_name for T{}
|
||||
}
|
||||
.to_token_stream()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ use std::{collections::HashMap, fmt::Debug, io::Cursor, ops::Deref, sync::Arc, t
|
|||
|
||||
pub use rand;
|
||||
pub use rnex_rmc_macros::*;
|
||||
use rnex_util::{SendingBufferConnection, SplittableBufferConnection, result::ResultExtension};
|
||||
use rnex_util::{
|
||||
SendingBufferConnection, SplittableBufferConnection, result::ResultExtension,
|
||||
tracing::Instrument,
|
||||
};
|
||||
use tokio::{
|
||||
sync::{Mutex, Notify},
|
||||
task,
|
||||
|
|
@ -322,6 +325,7 @@ impl<T: RemoteDisconnectable> RmcCallable for OnlyRemote<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
async fn handle_incoming<T: RmcCallable + Send + Sync + Debug + 'static>(
|
||||
sending_conn: SendingBufferConnection,
|
||||
remote: Arc<T>,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ pub const ERROR_MASK: u32 = 1 << 31;
|
|||
|
||||
#[derive(Pod, Zeroable, Copy, Clone, Debug)]
|
||||
#[repr(transparent)]
|
||||
pub struct QResult(u32);
|
||||
pub struct QResult(pub u32);
|
||||
|
||||
impl QResult {
|
||||
pub fn success(error_code: ErrorCode) -> Self {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
fmt,
|
||||
fmt::{self, Debug},
|
||||
io::{self, Read, Write},
|
||||
string::FromUtf8Error,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use std::{
|
||||
collections::HashSet,
|
||||
fmt::Debug,
|
||||
hash::Hash,
|
||||
io::{Read, Write},
|
||||
str::FromStr,
|
||||
|
|
@ -9,11 +10,11 @@ use std::{
|
|||
use crate::serialization::{Error, Result, RmcSerialize};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct StringSet<T: FromStr + ToString + Eq>(pub HashSet<T>)
|
||||
pub struct StringSet<T: FromStr + ToString + Eq + Debug>(pub HashSet<T>)
|
||||
where
|
||||
<T as FromStr>::Err: std::error::Error + Send + Sync + 'static;
|
||||
|
||||
impl<T: FromStr + ToString + Eq + Hash> PartialEq for StringSet<T>
|
||||
impl<T: FromStr + ToString + Eq + Hash + Debug> PartialEq for StringSet<T>
|
||||
where
|
||||
<T as FromStr>::Err: std::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: FromStr + ToString + Eq + Hash> ToString for StringSet<T>
|
||||
impl<T: FromStr + ToString + Eq + Hash + Debug> ToString for StringSet<T>
|
||||
where
|
||||
<T as FromStr>::Err: std::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
|
|
@ -35,7 +36,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: FromStr + ToString + Eq + Hash> FromStr for StringSet<T>
|
||||
impl<T: FromStr + ToString + Eq + Hash + Debug> FromStr for StringSet<T>
|
||||
where
|
||||
<T as FromStr>::Err: std::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
|
|
@ -57,7 +58,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: FromStr + ToString + Eq + Hash> RmcSerialize for StringSet<T>
|
||||
impl<T: FromStr + ToString + Eq + Hash + Debug> RmcSerialize for StringSet<T>
|
||||
where
|
||||
<T as FromStr>::Err: std::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
use std::{
|
||||
hash::{DefaultHasher, Hasher},
|
||||
net::SocketAddrV4,
|
||||
sync::{LazyLock},
|
||||
sync::LazyLock,
|
||||
};
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use nex_account::{
|
||||
grpc,
|
||||
grpc_client,
|
||||
};
|
||||
use nex_account::{grpc, grpc_client};
|
||||
use rnex_auth_protos::{
|
||||
LocalAuthProtocol,
|
||||
auth::{Auth, ConnectionData, ConnectionDataOld},
|
||||
};
|
||||
use rnex_prudp::kerberos::{Ticket, TicketInternalData};
|
||||
use rnex_reggie_protos::reggie::{RemoteEdgeNodeManagement};
|
||||
use rnex_reggie_protos::reggie::RemoteEdgeNodeManagement;
|
||||
use rnex_rmc::{
|
||||
any::Any,
|
||||
qresult::QResult,
|
||||
|
|
@ -350,3 +347,46 @@ impl Auth for AuthHandler {
|
|||
Err(ErrorCode::Core_Exception)
|
||||
}
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::io::Cursor;
|
||||
|
||||
use rnex_auth_protos::auth::ConnectionData;
|
||||
use rnex_rmc::{
|
||||
qresult::QResult,
|
||||
serialization::RmcSerialize,
|
||||
util::{PID, date_time::DateTime},
|
||||
};
|
||||
|
||||
type A = (QResult, PID, Vec<u8>, ConnectionData, String);
|
||||
|
||||
#[test]
|
||||
fn test() {
|
||||
let data: Vec<u8> = vec![
|
||||
117, 78, 111, 185, 170, 86, 1, 87, 12, 184, 207, 248, 138, 244, 200, 253, 115, 80, 239,
|
||||
214, 101, 196, 158, 106, 17, 107, 196, 210, 174, 2, 57, 126, 192, 37, 185, 250, 1, 237,
|
||||
21, 26, 95, 138, 247, 179, 204, 145, 61, 62, 68, 192, 16, 57, 73, 59, 123, 29, 219,
|
||||
181, 235, 252, 19, 241, 47, 54, 215, 231, 0, 42, 20, 15, 139, 27, 135, 88, 25, 193,
|
||||
172, 242, 13, 244, 128, 118, 37, 244, 102, 138, 8, 40, 182, 242, 146, 92, 104, 53, 4,
|
||||
52, 212, 47, 145, 120, 8, 78, 127, 150, 29, 210, 68, 203, 36, 241, 96, 189, 18, 153,
|
||||
109, 121,
|
||||
];
|
||||
let data: A = (
|
||||
QResult(65537),
|
||||
1132,
|
||||
data,
|
||||
ConnectionData {
|
||||
station_url:
|
||||
"prudps:/PID=2;sid=1;stream=10;type=2;address=45.85.147.85;port=17001;CID=1"
|
||||
.into(),
|
||||
special_protocols: [].into(),
|
||||
special_station_url: "".into(),
|
||||
date_time: DateTime(135993837066),
|
||||
},
|
||||
"branch:origin/project/wup-agmj build:3_8_15_2004_0".to_owned(),
|
||||
);
|
||||
|
||||
let test = data.to_data().unwrap();
|
||||
A::deserialize(&mut Cursor::new(&test[..])).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,6 +391,7 @@ impl DatastoreUser {
|
|||
ErrorCode::DataStore_NotFound
|
||||
})?;
|
||||
info!("done running");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Dawg...
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use crate::user::MessagingUser;
|
|||
|
||||
pub mod user;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MessagingManager {
|
||||
users_by_pid: RwLock<HashMap<PID, WeakPassthroughInitModule<MessagingUser>>>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use rnex_msg_protos::{
|
|||
use rnex_rmc::{any::Any, response::ErrorCode, rmc_struct, util::PID};
|
||||
use rnex_server::{PassthroughInitModule, WeakPassthroughInitModule};
|
||||
|
||||
#[derive(Debug)]
|
||||
#[rmc_struct(MessagingProtocol)]
|
||||
pub struct MessagingUser {
|
||||
pub msgm: PassthroughInitModule<MessagingManager>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue