Compare commits
2 Commits
9c54433ada
...
23cfda38c6
| Author | SHA1 | Date | |
|---|---|---|---|
| 23cfda38c6 | |||
| 894dbe033c |
1163
matrixgw_backend/Cargo.lock
generated
1163
matrixgw_backend/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -4,27 +4,26 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11.8"
|
||||
env_logger = "0.11.9"
|
||||
log = "0.4.29"
|
||||
clap = { version = "4.5.57", features = ["derive", "env"] }
|
||||
lazy_static = "1.5.0"
|
||||
clap = { version = "4.5.59", features = ["derive", "env"] }
|
||||
anyhow = "1.0.101"
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
tokio = { version = "1.48.0", features = ["full"] }
|
||||
actix-web = "4.12.1"
|
||||
tokio = { version = "1.49.0", features = ["full"] }
|
||||
actix-web = "4.13.0"
|
||||
actix-session = { version = "0.11.0", features = ["redis-session"] }
|
||||
actix-remote-ip = "0.1.0"
|
||||
actix-cors = "0.7.1"
|
||||
light-openid = "1.1.0"
|
||||
bytes = "1.11.1"
|
||||
sha2 = "0.10.9"
|
||||
base16ct = { version = "0.3.0", features = ["alloc"] }
|
||||
futures-util = "0.3.31"
|
||||
sha2 = "0.11.0-rc.5"
|
||||
base16ct = { version = "1.0.0", features = ["alloc"] }
|
||||
futures-util = "0.3.32"
|
||||
jwt-simple = { version = "0.12.14", default-features = false, features = ["pure-rust"] }
|
||||
thiserror = "2.0.18"
|
||||
uuid = { version = "1.19.0", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.21.0", features = ["v4", "serde"] }
|
||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||
rand = "0.9.2"
|
||||
rand = "0.10.0"
|
||||
hex = "0.4.3"
|
||||
mailchecker = "6.0.19"
|
||||
matrix-sdk = { version = "0.16.0", features = ["e2e-encryption"] }
|
||||
@@ -32,7 +31,7 @@ matrix-sdk-ui = "0.16.0"
|
||||
url = "2.5.8"
|
||||
ractor = "0.15.10"
|
||||
serde_json = "1.0.149"
|
||||
lazy-regex = "3.5.1"
|
||||
lazy-regex = "3.6.0"
|
||||
actix-ws = "0.3.1"
|
||||
infer = "0.19.0"
|
||||
rust-embed = "8.11.0"
|
||||
|
||||
@@ -5,6 +5,7 @@ use matrix_sdk::authentication::oauth::registration::{
|
||||
ApplicationType, ClientMetadata, Localized, OAuthGrantType,
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::OnceLock;
|
||||
use url::Url;
|
||||
|
||||
/// Matrix gateway backend API
|
||||
@@ -89,16 +90,12 @@ pub struct AppConfig {
|
||||
storage_path: String,
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref ARGS: AppConfig = {
|
||||
AppConfig::parse()
|
||||
};
|
||||
}
|
||||
static ARGS: OnceLock<AppConfig> = OnceLock::new();
|
||||
|
||||
impl AppConfig {
|
||||
/// Get parsed command line arguments
|
||||
pub fn get() -> &'static AppConfig {
|
||||
&ARGS
|
||||
ARGS.get_or_init(AppConfig::parse)
|
||||
}
|
||||
|
||||
/// Get auto login email (if not empty)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::broadcast_messages::BroadcastSender;
|
||||
use crate::controllers::{HttpFailure, HttpResult};
|
||||
use crate::controllers::HttpResult;
|
||||
use crate::extractors::auth_extractor::{AuthExtractor, AuthenticatedMethod};
|
||||
use crate::extractors::matrix_client_extractor::MatrixClientExtractor;
|
||||
use crate::extractors::session_extractor::MatrixGWSession;
|
||||
@@ -63,9 +63,7 @@ pub async fn finish_oidc(
|
||||
|
||||
let prov = AppConfig::get().openid_provider();
|
||||
|
||||
let conf = OpenIDConfig::load_from_url(prov.configuration_url)
|
||||
.await
|
||||
.map_err(HttpFailure::OpenID)?;
|
||||
let conf = OpenIDConfig::load_from_url(prov.configuration_url).await?;
|
||||
|
||||
let (token, _) = conf
|
||||
.request_token(
|
||||
@@ -74,12 +72,8 @@ pub async fn finish_oidc(
|
||||
&req.code,
|
||||
&AppConfig::get().openid_provider().redirect_url,
|
||||
)
|
||||
.await
|
||||
.map_err(HttpFailure::OpenID)?;
|
||||
let (user_info, _) = conf
|
||||
.request_user_info(&token)
|
||||
.await
|
||||
.map_err(HttpFailure::OpenID)?;
|
||||
.await?;
|
||||
let (user_info, _) = conf.request_user_info(&token).await?;
|
||||
|
||||
if user_info.email_verified != Some(true) {
|
||||
log::error!("Email is not verified!");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use actix_web::http::StatusCode;
|
||||
use actix_web::{HttpResponse, ResponseError};
|
||||
use std::error::Error;
|
||||
use light_openid::errors::OpenIdError;
|
||||
|
||||
pub mod auth_controller;
|
||||
pub mod matrix;
|
||||
@@ -18,7 +18,7 @@ pub enum HttpFailure {
|
||||
#[error("this resource was not found")]
|
||||
NotFound,
|
||||
#[error("an unspecified open id error occurred: {0}")]
|
||||
OpenID(Box<dyn Error>),
|
||||
OpenID(#[from] OpenIdError),
|
||||
#[error("an unspecified internal error occurred: {0}")]
|
||||
InternalError(#[from] anyhow::Error),
|
||||
#[error("Actix web error: {0}")]
|
||||
|
||||
8
matrixgw_frontend/package-lock.json
generated
8
matrixgw_frontend/package-lock.json
generated
@@ -18,7 +18,7 @@
|
||||
"date-and-time": "^4.2.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"emoji-picker-react": "^4.17.4",
|
||||
"is-cidr": "^6.0.2",
|
||||
"is-cidr": "^6.0.3",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^19.2.4",
|
||||
"react-dom": "^19.2.4",
|
||||
@@ -2705,9 +2705,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-cidr": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-6.0.2.tgz",
|
||||
"integrity": "sha512-a4SY0KixgRXn67zSCooPNO4YRHZd1z6BIxrEBQUVNPteeajzrJLhZKnn81GVQO51uiCljTtGY+J3o6O3/DZpzg==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-6.0.3.tgz",
|
||||
"integrity": "sha512-tPdsizbDiISrc4PoII6ZfpmAokx0oDKeYqAUp5bXOfznauOFXfEeosKBRrl0o0SriE4xoRR05Czn4YPCFMjSHA==",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"cidr-regex": "^5.0.1"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"date-and-time": "^4.2.0",
|
||||
"dayjs": "^1.11.19",
|
||||
"emoji-picker-react": "^4.17.4",
|
||||
"is-cidr": "^6.0.2",
|
||||
"is-cidr": "^6.0.3",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^19.2.4",
|
||||
"react-dom": "^19.2.4",
|
||||
|
||||
Reference in New Issue
Block a user