mirror of
https://github.com/moghtech/komodo.git
synced 2026-08-20 16:01:09 +00:00
move connection queries to periphery_client
This commit is contained in:
@@ -17,11 +17,12 @@ use komodo_client::{
|
||||
user::system_user,
|
||||
},
|
||||
};
|
||||
use periphery_client::transport::LoginMessage;
|
||||
use periphery_client::{
|
||||
api::PeripheryConnectionQuery, transport::LoginMessage,
|
||||
};
|
||||
use resolver_api::Resolve;
|
||||
use serror::{AddStatusCode, AddStatusCodeError};
|
||||
use transport::{
|
||||
PeripheryConnectionQuery,
|
||||
auth::{
|
||||
HeaderConnectionIdentifiers, LoginFlow, LoginFlowArgs,
|
||||
PublicKeyValidator, ServerLoginFlow,
|
||||
|
||||
@@ -18,10 +18,11 @@ use axum::{
|
||||
routing::get,
|
||||
};
|
||||
use axum_server::tls_rustls::RustlsConfig;
|
||||
use periphery_client::transport::LoginMessage;
|
||||
use periphery_client::{
|
||||
api::CoreConnectionQuery, transport::LoginMessage,
|
||||
};
|
||||
use serror::{AddStatusCode, AddStatusCodeError};
|
||||
use transport::{
|
||||
CoreConnectionQuery,
|
||||
auth::{
|
||||
ConnectionIdentifiers, HeaderConnectionIdentifiers,
|
||||
ServerLoginFlow,
|
||||
|
||||
@@ -23,6 +23,20 @@ pub mod terminal;
|
||||
|
||||
//
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct CoreConnectionQuery {
|
||||
/// Core host (eg demo.komo.do)
|
||||
pub core: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct PeripheryConnectionQuery {
|
||||
/// Server Id or name
|
||||
pub server: String,
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
|
||||
#[response(GetHealthResponse)]
|
||||
#[error(anyhow::Error)]
|
||||
|
||||
@@ -1,30 +1,8 @@
|
||||
use ::bytes::Bytes;
|
||||
use serde::Deserialize;
|
||||
|
||||
pub mod auth;
|
||||
pub mod channel;
|
||||
pub mod timeout;
|
||||
pub mod websocket;
|
||||
|
||||
pub trait TransportHandler {
|
||||
fn handle_incoming_bytes(
|
||||
&self,
|
||||
bytes: Bytes,
|
||||
) -> impl Future<Output = ()> + Send;
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct CoreConnectionQuery {
|
||||
/// Core host (eg demo.komo.do)
|
||||
pub core: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct PeripheryConnectionQuery {
|
||||
/// Server Id or name
|
||||
pub server: String,
|
||||
}
|
||||
|
||||
/// - Fixes ws addresses:
|
||||
/// - `server.domain` => `wss://server.domain`
|
||||
/// - `http://server.domain` => `ws://server.domain`
|
||||
|
||||
Reference in New Issue
Block a user