feat(nex-servers): add nex token get stub and start working on grpc server

This commit is contained in:
DJMrTV 2025-03-07 15:14:43 +01:00
commit 02c46fca1d
10 changed files with 347 additions and 12 deletions

View file

@ -6,3 +6,4 @@ pub mod email;
pub mod oauth;
mod pid_distribution;
pub mod people;
pub mod provider;

View file

@ -117,8 +117,6 @@ pub async fn generate_token(pool: &State<Pool>, data: Form<TokenRequestData<'_>>
let access_token = TokenReturnData::new(user.pid, pool).await;
Ok(Xml(TokenRequestReturnData{
access_token
}))

20
src/nnid/provider.rs Normal file
View file

@ -0,0 +1,20 @@
use std::net::Ipv4Addr;
use std::str::FromStr;
use rocket::get;
use serde::Serialize;
use crate::xml::Xml;
#[derive(Serialize)]
#[serde(rename = "nex_token")]
struct NexToken{
host: Ipv4Addr,
nex_password: String,
pid: i32,
port: u16,
token: String
}
#[get("/v1/api/provider/nex_token/@me?<game_server_id>")]
pub async fn get_nex_token(game_server_id: String) -> Option<Xml<NexToken>>{
None
}