Add users authentication routes

This commit is contained in:
2025-11-03 22:17:29 +01:00
parent 830f47b61f
commit bc815a5cf1
21 changed files with 1417 additions and 451 deletions

View File

@@ -1,11 +1,12 @@
use clap::Parser;
use jwt_simple::algorithms::HS256Key;
use jwt_simple::prelude::{Clock, Duration, JWTClaims, MACLike};
use matrix_gateway::extractors::client_auth::TokenClaims;
use matrix_gateway::utils::base_utils::rand_str;
use matrixgw_backend::constants;
use matrixgw_backend::extractors::auth_extractor::TokenClaims;
use std::ops::Add;
use std::os::unix::prelude::CommandExt;
use std::process::Command;
use matrixgw_backend::utils::rand_utils::rand_string;
/// cURL wrapper to query MatrixGW
#[derive(Parser, Debug)]
@@ -59,7 +60,7 @@ fn main() {
subject: None,
audiences: None,
jwt_id: None,
nonce: Some(rand_str(10)),
nonce: Some(rand_string(10)),
custom: TokenClaims {
method: args.method.to_string(),
uri: args.uri,
@@ -78,7 +79,7 @@ fn main() {
let _ = Command::new("curl")
.args(["-X", &args.method])
.args(["-H", &format!("x-client-auth: {jwt}")])
.args(["-H", &format!("{}: {jwt}", constants::API_AUTH_HEADER)])
.args(args.run)
.arg(full_url)
.exec();