Add users authentication routes
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user