mirror of
https://github.com/stoatchat/rust-authifier.git
synced 2026-07-01 22:04:53 -04:00
feat: update okapi and version bump (#60)
This commit is contained in:
Generated
+243
-232
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "authifier"
|
||||
version = "1.0.8"
|
||||
version = "1.0.9"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
authors = ["Pawel Makles <me@insrt.uk>"]
|
||||
@@ -57,7 +57,7 @@ async-std = { version = "1.9.0", features = [
|
||||
], optional = true }
|
||||
|
||||
# Schemas
|
||||
revolt_rocket_okapi = { version = "0.9.1", features = [
|
||||
revolt_rocket_okapi = { version = "0.10.0", features = [
|
||||
"swagger",
|
||||
], optional = true }
|
||||
revolt_okapi = { version = "0.9.1", optional = true }
|
||||
@@ -70,7 +70,7 @@ validator = "0.15.0"
|
||||
reqwest = { version = "0.11.10", features = ["json"], optional = true }
|
||||
|
||||
# Rocket
|
||||
rocket = { version = "0.5.0-rc.2", default-features = false, features = [
|
||||
rocket = { version = "0.5.1", default-features = false, features = [
|
||||
"json",
|
||||
], optional = true }
|
||||
|
||||
|
||||
@@ -78,13 +78,13 @@ impl<'r> FromRequest<'r> for Session {
|
||||
if let Some(session) = session {
|
||||
Outcome::Success(session)
|
||||
} else {
|
||||
Outcome::Failure((Status::Unauthorized, Error::InvalidSession))
|
||||
Outcome::Error((Status::Unauthorized, Error::InvalidSession))
|
||||
}
|
||||
} else {
|
||||
Outcome::Failure((Status::Unauthorized, Error::InvalidSession))
|
||||
Outcome::Error((Status::Unauthorized, Error::InvalidSession))
|
||||
}
|
||||
}
|
||||
(_, _) => Outcome::Failure((Status::Unauthorized, Error::MissingHeaders)),
|
||||
(_, _) => Outcome::Error((Status::Unauthorized, Error::MissingHeaders)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,11 +101,11 @@ impl<'r> FromRequest<'r> for Account {
|
||||
if let Ok(account) = authifier.database.find_account(&session.user_id).await {
|
||||
Outcome::Success(account)
|
||||
} else {
|
||||
Outcome::Failure((Status::InternalServerError, Error::InternalError))
|
||||
Outcome::Error((Status::InternalServerError, Error::InternalError))
|
||||
}
|
||||
}
|
||||
Outcome::Forward(_) => unreachable!(),
|
||||
Outcome::Failure(err) => Outcome::Failure(err),
|
||||
Outcome::Error(err) => Outcome::Error(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,13 +128,13 @@ impl<'r> FromRequest<'r> for MFATicket {
|
||||
if let Some(ticket) = ticket {
|
||||
Outcome::Success(ticket)
|
||||
} else {
|
||||
Outcome::Failure((Status::Unauthorized, Error::InvalidToken))
|
||||
Outcome::Error((Status::Unauthorized, Error::InvalidToken))
|
||||
}
|
||||
} else {
|
||||
Outcome::Failure((Status::Unauthorized, Error::InternalError))
|
||||
Outcome::Error((Status::Unauthorized, Error::InternalError))
|
||||
}
|
||||
}
|
||||
(_, _) => Outcome::Failure((Status::Unauthorized, Error::MissingHeaders)),
|
||||
(_, _) => Outcome::Error((Status::Unauthorized, Error::MissingHeaders)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,14 +156,14 @@ impl<'r> FromRequest<'r> for ValidatedTicket {
|
||||
if ticket.claim(authifier).await.is_ok() {
|
||||
Outcome::Success(ValidatedTicket(ticket))
|
||||
} else {
|
||||
Outcome::Failure((Status::InternalServerError, Error::InternalError))
|
||||
Outcome::Error((Status::InternalServerError, Error::InternalError))
|
||||
}
|
||||
} else {
|
||||
Outcome::Failure((Status::Forbidden, Error::InvalidToken))
|
||||
Outcome::Error((Status::Forbidden, Error::InvalidToken))
|
||||
}
|
||||
}
|
||||
Outcome::Forward(f) => Outcome::Forward(f),
|
||||
Outcome::Failure(err) => Outcome::Failure(err),
|
||||
Outcome::Error(err) => Outcome::Error(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,11 +179,11 @@ impl<'r> FromRequest<'r> for UnvalidatedTicket {
|
||||
if !ticket.validated {
|
||||
Outcome::Success(UnvalidatedTicket(ticket))
|
||||
} else {
|
||||
Outcome::Failure((Status::Forbidden, Error::InvalidToken))
|
||||
Outcome::Error((Status::Forbidden, Error::InvalidToken))
|
||||
}
|
||||
}
|
||||
Outcome::Forward(f) => Outcome::Forward(f),
|
||||
Outcome::Failure(err) => Outcome::Failure(err),
|
||||
Outcome::Error(err) => Outcome::Error(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ impl<'r> FromRequest<'r> for ShieldValidationInput {
|
||||
..Default::default()
|
||||
})
|
||||
} else {
|
||||
Outcome::Failure((Status::InternalServerError, Error::InternalError))
|
||||
Outcome::Error((Status::InternalServerError, Error::InternalError))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rocket_authifier"
|
||||
version = "1.0.8"
|
||||
version = "1.0.9"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
authors = ["Pawel Makles <me@insrt.uk>"]
|
||||
@@ -22,23 +22,21 @@ default = []
|
||||
|
||||
[dependencies]
|
||||
# Authifier
|
||||
authifier = { version = "1.0.5", path = "../authifier", features = [
|
||||
authifier = { version = "1.0.9", path = "../authifier", features = [
|
||||
"rocket_impl",
|
||||
"okapi_impl",
|
||||
] }
|
||||
|
||||
# Rocket
|
||||
rocket = { version = "0.5.0-rc.2", default-features = false, features = [
|
||||
"json",
|
||||
] }
|
||||
rocket_empty = { version = "0.1.1", features = ["schema"] }
|
||||
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
|
||||
rocket_empty = { version = "0.1.2", features = ["schema"] }
|
||||
|
||||
# Serde
|
||||
iso8601-timestamp = { version = "0.1.10" }
|
||||
serde = { version = "1.0.116", features = ["derive"] }
|
||||
|
||||
# Schemas
|
||||
revolt_rocket_okapi = { version = "0.9.1", features = ["swagger"] }
|
||||
revolt_rocket_okapi = { version = "0.10.0", features = ["swagger"] }
|
||||
revolt_okapi = { version = "0.9.1" }
|
||||
schemars = { version = "0.8.8" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user