License
This commit is contained in:
parent
ab707c1907
commit
9729fb0c09
4 changed files with 27 additions and 15 deletions
16
LICENSE
Normal file
16
LICENSE
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
Copyright (c) [2025] [Methanium]
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
This software is protected by copyright. Copying, editing,
|
||||||
|
distributing, publicly performing, or any other use of this software
|
||||||
|
or its components, in source or binary form, is strictly prohibited without the express
|
||||||
|
written permission of the copyright holder.
|
||||||
|
|
||||||
|
FUTURE LICENSE ACCEPTANCE:
|
||||||
|
It is the copyright holder's intention to release this software in the future
|
||||||
|
under a license yet to be defined, which will, among other things,
|
||||||
|
allow private, non-commercial use. This statement does not constitute
|
||||||
|
a current license grant and does not alter the above
|
||||||
|
prohibition on use, copying, or modification. Until the formal
|
||||||
|
publication of such a future license, all rights remain
|
||||||
|
reserved.
|
||||||
|
|
@ -26,7 +26,7 @@ fn client() -> Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_user(user_id: Uuid) -> Option<AuthUser> {
|
pub async fn get_user(user_id: Uuid) -> Option<AuthUser> {
|
||||||
let url = format!("https://auth.tensamin.methanium.net/api/get/{}", user_id);
|
let url = format!("https://auth.tensamin.net/api/get/{}", user_id);
|
||||||
let client = client();
|
let client = client();
|
||||||
let res = client.get(&url).send().await.ok()?;
|
let res = client.get(&url).send().await.ok()?;
|
||||||
let json = res.text().await.ok()?;
|
let json = res.text().await.ok()?;
|
||||||
|
|
@ -65,10 +65,7 @@ pub async fn get_user(user_id: Uuid) -> Option<AuthUser> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_iota_id(user_id: Uuid) -> Option<Uuid> {
|
pub async fn get_iota_id(user_id: Uuid) -> Option<Uuid> {
|
||||||
let url = format!(
|
let url = format!("https://auth.tensamin.net/api/get/iota-id/{}", user_id);
|
||||||
"https://auth.tensamin.methanium.net/api/get/iota-id/{}",
|
|
||||||
user_id
|
|
||||||
);
|
|
||||||
|
|
||||||
let client = client();
|
let client = client();
|
||||||
let res = client
|
let res = client
|
||||||
|
|
@ -92,7 +89,7 @@ pub async fn get_iota_id(user_id: Uuid) -> Option<Uuid> {
|
||||||
}
|
}
|
||||||
pub async fn is_private_key_valid(user_id: Uuid, pk_hash: &str) -> bool {
|
pub async fn is_private_key_valid(user_id: Uuid, pk_hash: &str) -> bool {
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://auth.tensamin.methanium.net/api/get/private-key-hash/{}/",
|
"https://auth.tensamin.net/api/get/private-key-hash/{}/",
|
||||||
user_id
|
user_id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -124,10 +121,7 @@ pub async fn is_private_key_valid(user_id: Uuid, pk_hash: &str) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub async fn get_public_key(user_id: Uuid) -> Option<String> {
|
pub async fn get_public_key(user_id: Uuid) -> Option<String> {
|
||||||
let url = format!(
|
let url = format!("https://auth.tensamin.net/api/{}/public-key", user_id);
|
||||||
"https://auth.tensamin.methanium.net/api/{}/public-key",
|
|
||||||
user_id
|
|
||||||
);
|
|
||||||
|
|
||||||
let client = client();
|
let client = client();
|
||||||
let res = client
|
let res = client
|
||||||
|
|
@ -148,7 +142,7 @@ pub async fn get_public_key(user_id: Uuid) -> Option<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_register() -> Option<Uuid> {
|
pub async fn get_register() -> Option<Uuid> {
|
||||||
let url = "https://auth.tensamin.methanium.net/api/register/init".to_string();
|
let url = "https://auth.tensamin.net/api/register/init".to_string();
|
||||||
let client = client();
|
let client = client();
|
||||||
let res = client.get(&url).send().await.ok()?;
|
let res = client.get(&url).send().await.ok()?;
|
||||||
let json = res.text().await.ok()?;
|
let json = res.text().await.ok()?;
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ impl ClientConnection {
|
||||||
.add_data_str(DataTypes::sender_id, sender_id.to_string())
|
.add_data_str(DataTypes::sender_id, sender_id.to_string())
|
||||||
.add_data_str(DataTypes::call_secret, call_secret.unwrap());
|
.add_data_str(DataTypes::call_secret, call_secret.unwrap());
|
||||||
|
|
||||||
target_rho.message_iota_to_client(distribute).await;
|
target_rho.message_to_client(distribute).await;
|
||||||
|
|
||||||
// Handle call group invitation logic here
|
// Handle call group invitation logic here
|
||||||
// This would require implementing CallGroup::Caller and related functionality
|
// This would require implementing CallGroup::Caller and related functionality
|
||||||
|
|
|
||||||
|
|
@ -254,14 +254,16 @@ impl IotaConnection {
|
||||||
let receiver_id = cv.get_receiver();
|
let receiver_id = cv.get_receiver();
|
||||||
let sender_id = cv.get_sender();
|
let sender_id = cv.get_sender();
|
||||||
if !self.get_user_ids().await.contains(&sender_id) {
|
if !self.get_user_ids().await.contains(&sender_id) {
|
||||||
self.send_error_response(&cv.get_id()).await;
|
self.send_message(CommunicationValue::new(
|
||||||
|
CommunicationType::error_invalid_user_id,
|
||||||
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(target_rho) = rho_manager::get_rho_con_for_user(receiver_id).await {
|
if let Some(target_rho) = rho_manager::get_rho_con_for_user(receiver_id).await {
|
||||||
target_rho.message_to_iota(cv).await;
|
target_rho.message_to_iota(cv).await;
|
||||||
} else {
|
} else {
|
||||||
let error = CommunicationValue::new(CommunicationType::error)
|
let error = CommunicationValue::new(CommunicationType::error_no_iota)
|
||||||
.with_id(cv.get_id())
|
.with_id(cv.get_id())
|
||||||
.with_sender(cv.get_sender());
|
.with_sender(cv.get_sender());
|
||||||
self.send_message(error).await;
|
self.send_message(error).await;
|
||||||
|
|
@ -311,7 +313,7 @@ impl IotaConnection {
|
||||||
if let Some(rho_conn) = self.get_rho_connection().await {
|
if let Some(rho_conn) = self.get_rho_connection().await {
|
||||||
let updated_cv = cv.with_sender(self.get_iota_id().await);
|
let updated_cv = cv.with_sender(self.get_iota_id().await);
|
||||||
let receiver_id = updated_cv.get_receiver();
|
let receiver_id = updated_cv.get_receiver();
|
||||||
rho_conn.message_iota_to_client(updated_cv).await;
|
rho_conn.message_to_client(updated_cv).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue