|
|
@ -1,16 +1,19 @@
|
|
|
|
use crate::{
|
|
|
|
use std::collections::HashMap;
|
|
|
|
common::{authentication::msg::AuthenticationResponse, ConnectionId, Destination, Map},
|
|
|
|
use std::io;
|
|
|
|
manager::{
|
|
|
|
use std::sync::Arc;
|
|
|
|
ConnectionInfo, ConnectionList, ManagerAuthenticationId, ManagerCapabilities,
|
|
|
|
|
|
|
|
ManagerChannelId, ManagerRequest, ManagerResponse,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
server::{Server, ServerCtx, ServerHandler},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
use async_trait::async_trait;
|
|
|
|
use async_trait::async_trait;
|
|
|
|
use log::*;
|
|
|
|
use log::*;
|
|
|
|
use std::{collections::HashMap, io, sync::Arc};
|
|
|
|
|
|
|
|
use tokio::sync::{oneshot, RwLock};
|
|
|
|
use tokio::sync::{oneshot, RwLock};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use crate::common::authentication::msg::AuthenticationResponse;
|
|
|
|
|
|
|
|
use crate::common::{ConnectionId, Destination, Map};
|
|
|
|
|
|
|
|
use crate::manager::{
|
|
|
|
|
|
|
|
ConnectionInfo, ConnectionList, ManagerAuthenticationId, ManagerCapabilities, ManagerChannelId,
|
|
|
|
|
|
|
|
ManagerRequest, ManagerResponse,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
use crate::server::{Server, ServerCtx, ServerHandler};
|
|
|
|
|
|
|
|
|
|
|
|
mod authentication;
|
|
|
|
mod authentication;
|
|
|
|
pub use authentication::*;
|
|
|
|
pub use authentication::*;
|
|
|
|
|
|
|
|
|
|
|
@ -183,9 +186,9 @@ pub struct DistantManagerServerConnection {
|
|
|
|
|
|
|
|
|
|
|
|
#[async_trait]
|
|
|
|
#[async_trait]
|
|
|
|
impl ServerHandler for ManagerServer {
|
|
|
|
impl ServerHandler for ManagerServer {
|
|
|
|
|
|
|
|
type LocalData = DistantManagerServerConnection;
|
|
|
|
type Request = ManagerRequest;
|
|
|
|
type Request = ManagerRequest;
|
|
|
|
type Response = ManagerResponse;
|
|
|
|
type Response = ManagerResponse;
|
|
|
|
type LocalData = DistantManagerServerConnection;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async fn on_request(&self, ctx: ServerCtx<Self::Request, Self::Response, Self::LocalData>) {
|
|
|
|
async fn on_request(&self, ctx: ServerCtx<Self::Request, Self::Response, Self::LocalData>) {
|
|
|
|
let ServerCtx {
|
|
|
|
let ServerCtx {
|
|
|
@ -315,12 +318,13 @@ impl ServerHandler for ManagerServer {
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
mod tests {
|
|
|
|
|
|
|
|
use tokio::sync::mpsc;
|
|
|
|
|
|
|
|
|
|
|
|
use super::*;
|
|
|
|
use super::*;
|
|
|
|
use crate::client::UntypedClient;
|
|
|
|
use crate::client::UntypedClient;
|
|
|
|
use crate::common::FramedTransport;
|
|
|
|
use crate::common::FramedTransport;
|
|
|
|
use crate::server::ServerReply;
|
|
|
|
use crate::server::ServerReply;
|
|
|
|
use crate::{boxed_connect_handler, boxed_launch_handler};
|
|
|
|
use crate::{boxed_connect_handler, boxed_launch_handler};
|
|
|
|
use tokio::sync::mpsc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn test_config() -> Config {
|
|
|
|
fn test_config() -> Config {
|
|
|
|
Config {
|
|
|
|
Config {
|
|
|
|