move connection queries to periphery_client

This commit is contained in:
mbecker20
2025-10-12 00:08:59 -07:00
parent ded17e4840
commit 42a7b8c19b
4 changed files with 20 additions and 26 deletions
+3 -2
View File
@@ -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,
+3 -2
View File
@@ -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,
+14
View File
@@ -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)]
-22
View File
@@ -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`