TLS 1.3, channel persistence, membership signaling
- TLS 1.3 on TCP (rustls + tokio-rustls, optional self-signed cert) - Server-side channel CRUD with SQLite persistence - Gateway → voice-node membership bridge via broadcast channel
This commit is contained in:
parent
523680e05d
commit
5534cd01f7
37 changed files with 771 additions and 160 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::permissions::Permissions,
|
||||
|
|
@ -12,7 +12,7 @@ use crate::{
|
|||
|
||||
/// Fetch audit log entries for a guild (admin-only: requires VIEW_AUDIT_LOG or owner).
|
||||
pub async fn handle_audit_log_fetch(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{
|
||||
|
|
@ -11,7 +11,7 @@ use crate::{
|
|||
use super::send_err;
|
||||
|
||||
pub async fn handle_guild_create(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -67,7 +67,7 @@ pub async fn handle_guild_create(
|
|||
}
|
||||
|
||||
pub async fn handle_guild_delete(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::{permissions::Permissions, session},
|
||||
|
|
@ -13,7 +13,7 @@ use crate::{
|
|||
use super::{now_ms, send_err};
|
||||
|
||||
pub async fn handle_invite_create(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -89,7 +89,7 @@ pub async fn handle_invite_create(
|
|||
}
|
||||
|
||||
pub async fn handle_invite_accept(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -164,7 +164,7 @@ pub async fn handle_invite_accept(
|
|||
}
|
||||
|
||||
pub async fn handle_invite_delete(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::session,
|
||||
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
};
|
||||
|
||||
pub async fn handle_guild_list(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
crypto: &SessionCrypto,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::{permissions::Permissions, session},
|
||||
|
|
@ -13,7 +13,7 @@ use crate::{
|
|||
use super::send_err;
|
||||
|
||||
pub async fn handle_guild_member_join(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -63,7 +63,7 @@ pub async fn handle_guild_member_join(
|
|||
}
|
||||
|
||||
pub async fn handle_guild_member_leave(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -96,7 +96,7 @@ pub async fn handle_guild_member_leave(
|
|||
}
|
||||
|
||||
pub async fn handle_guild_member_kick(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::{permissions::Permissions, session},
|
||||
|
|
@ -15,7 +15,7 @@ use super::{require_perm, send_err};
|
|||
|
||||
/// Fetch the member list for a guild (visible to all members).
|
||||
pub async fn handle_member_list_fetch(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -65,7 +65,7 @@ pub async fn handle_member_list_fetch(
|
|||
|
||||
/// Assign a role to a user (admin only: requires MANAGE_ROLES).
|
||||
pub async fn handle_role_assign(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -129,7 +129,7 @@ pub async fn handle_role_assign(
|
|||
|
||||
/// Remove a role from a user (admin only: requires MANAGE_ROLES).
|
||||
pub async fn handle_role_unassign(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -192,7 +192,7 @@ pub async fn handle_role_unassign(
|
|||
|
||||
/// Fetch all roles defined in a guild (visible to all members).
|
||||
pub async fn handle_role_list_fetch(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ mod members_list;
|
|||
mod roles;
|
||||
|
||||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::permissions::Permissions,
|
||||
|
|
@ -16,7 +16,7 @@ use crate::{
|
|||
};
|
||||
|
||||
async fn send_err(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
code: crate::proto::ErrorCode,
|
||||
msg: &str,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
|
||||
use crate::{
|
||||
domain::{permissions::Permissions, session},
|
||||
|
|
@ -10,7 +10,7 @@ use crate::{
|
|||
use super::send_err;
|
||||
|
||||
pub async fn handle_role_create(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
@ -73,7 +73,7 @@ pub async fn handle_role_create(
|
|||
}
|
||||
|
||||
pub async fn handle_role_delete(
|
||||
stream: &mut TcpStream,
|
||||
stream: &mut (impl AsyncRead + AsyncWrite + Unpin),
|
||||
seq: &mut u32,
|
||||
session_id: &str,
|
||||
payload: &[u8],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue