Update rauth, pin git repositories in Cargo.toml.

This commit is contained in:
Paul Makles
2021-01-25 21:35:47 +00:00
parent 99e2f874a1
commit 75a35831da
5 changed files with 266 additions and 186 deletions

430
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,13 +12,13 @@ many-to-many = "0.1.2"
impl_ops = "0.1.1"
ctrlc = { version = "3.0", features = ["termination"] }
async-tungstenite = { version = "0.10.0", features = ["async-std-runtime"] }
rauth = { git = "https://gitlab.insrt.uk/insert/rauth" }
rauth = { git = "https://gitlab.insrt.uk/insert/rauth", rev = "8f3ea627" }
async-std = { version = "1.8.0", features = ["tokio02", "attributes"] }
hive_pubsub = { version = "0.4.3", features = ["mongo"] }
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", branch = "master" }
rocket = { git = "https://github.com/SergioBenitez/Rocket", branch = "master", default-features = false }
rocket_cors = { git = "https://github.com/insertish/rocket_cors", branch = "master" }
rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", rev = "031948c1daaa146128d8a435be116476f2adde00" }
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "031948c1daaa146128d8a435be116476f2adde00", default-features = false }
mongodb = { version = "1.1.1", features = ["tokio-runtime"], default-features = false }
once_cell = "1.4.1"

View File

@@ -29,7 +29,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for User {
} else {
Outcome::Failure((
Status::InternalServerError,
rauth::util::Error::DatabaseError,
rauth::util::Error::DatabaseError { operation: "find_one", with: "user" },
))
}
}

View File

@@ -20,7 +20,7 @@ pub mod util;
use futures::join;
use log::info;
use rauth;
use rauth::{self, options::Options};
use rocket_cors::AllowedOrigins;
#[async_std::main]
@@ -55,10 +55,12 @@ async fn launch_web() {
.to_cors()
.expect("Failed to create CORS.");
let auth = rauth::auth::Auth::new(database::get_collection("accounts"));
let auth = rauth::auth::Auth::new(database::get_collection("accounts"), Options::new());
routes::mount(rauth::routes::mount(rocket::ignite(), "/auth", auth))
routes::mount(rocket::ignite())
.mount("/", rocket_cors::catch_all_options_routes())
.mount("/auth", rauth::routes::routes())
.manage(auth)
.manage(cors.clone())
.attach(cors)
.launch()

View File

@@ -12,7 +12,7 @@ use futures::{pin_mut, prelude::*};
use hive_pubsub::PubSub;
use log::{debug, info};
use many_to_many::ManyToMany;
use rauth::auth::{Auth, Session};
use rauth::{auth::{Auth, Session}, options::Options};
use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::{Arc, Mutex, RwLock};
@@ -84,7 +84,7 @@ async fn accept(stream: TcpStream) {
}
}
if let Ok(validated_session) = Auth::new(get_collection("accounts"))
if let Ok(validated_session) = Auth::new(get_collection("accounts"), Options::new())
.verify_session(new_session)
.await
{