Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
705 changes: 274 additions & 431 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ actix-utils = "3.0.1"
actix-web = "4.9.0"
async-std = "1.13.0"
async-trait = "0.1.83"
axum = "0.7.9"
axum = "0.8.1"
bon = "3.3.2"
chrono = "0.4.39"
console_error_panic_hook = "0.1.2"
futures = "0.3.31"
http = "1.2.0"
leptos = "0.7.4"
leptos_actix = "0.7.4"
leptos_axum = "0.7.4"
leptos_meta = "0.7.4"
leptos_router = "0.7.4"
leptos = "0.8.0-beta"
leptos_actix = "0.8.0-beta"
leptos_axum = "0.8.0-beta"
leptos_meta = "0.8.0-beta"
leptos_router = "0.8.0-beta"
thiserror = "2.0.7"
sea-orm = "1.1.2"
sea-orm-migration = "1.1.2"
Expand All @@ -35,7 +35,7 @@ serde_json = "1.0.133"
tokio = "1.42.0"
tower-layer = "0.3.3"
tower-service = "0.3.3"
tower-sessions = "0.13.0"
tower-sessions = "0.14.0"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
utoipa = { version = "5.3.1", features = ["chrono", "uuid"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/leptos-axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tracing-subscriber.workspace = true
wasm-bindgen.workspace = true
wasm-tracing.workspace = true
utoipa.workspace = true
utoipa-swagger-ui = { version = "=8.1.0", features = ["axum", "vendored"] }
utoipa-swagger-ui = { version = "9.0.0", features = ["axum", "vendored"] }

[features]
default = ["ssr"]
Expand Down
2 changes: 1 addition & 1 deletion examples/sea-orm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ repository.workspace = true
version.workspace = true

[dependencies]
async-std = { workspace = true, features = ["attributes", "tokio1"] }
sea-orm = { workspace = true, features = [
"macros",
"runtime-tokio-native-tls",
Expand All @@ -27,3 +26,4 @@ sea-orm-migration = { workspace = true, features = [
shield-sea-orm = { path = "../../packages/storage/shield-sea-orm", features = [
"all-providers",
] }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion examples/sea-orm/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use sea_orm_migration::prelude::*;
use shield_sea_orm::migrations::Migrator;

#[async_std::main]
#[tokio::main]
async fn main() {
cli::run_cli(Migrator).await;
}
1 change: 0 additions & 1 deletion packages/core/shield/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ futures.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
thiserror.workspace = true
tracing.workspace = true
utoipa = { workspace = true, optional = true }

[features]
Expand Down
7 changes: 0 additions & 7 deletions packages/core/shield/src/shield.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{collections::HashMap, sync::Arc};

use futures::future::try_join_all;
use tracing::debug;

use crate::{
error::{ProviderError, SessionError, ShieldError},
Expand Down Expand Up @@ -105,8 +104,6 @@ impl<U: User> Shield<U> {
request: SignInRequest,
session: Session,
) -> Result<Response, ShieldError> {
debug!("sign in {:?}", request);

let provider = match self.providers.get(&request.provider_id) {
Some(provider) => provider,
None => return Err(ProviderError::ProviderNotFound(request.provider_id).into()),
Expand Down Expand Up @@ -137,8 +134,6 @@ impl<U: User> Shield<U> {
request: SignInCallbackRequest,
session: Session,
) -> Result<Response, ShieldError> {
debug!("sign in callback {:?}", request);

let provider = match self.providers.get(&request.provider_id) {
Some(provider) => provider,
None => return Err(ProviderError::ProviderNotFound(request.provider_id).into()),
Expand Down Expand Up @@ -170,8 +165,6 @@ impl<U: User> Shield<U> {
}

pub async fn sign_out(&self, session: Session) -> Result<Response, ShieldError> {
debug!("sign out");

let authenticated = {
let session_data = session.data();
let session_data = session_data
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/shield-axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ repository.workspace = true
version.workspace = true

[dependencies]
async-trait.workspace = true
axum.workspace = true
serde.workspace = true
serde_json.workspace = true
Expand Down
5 changes: 0 additions & 5 deletions packages/integrations/shield-axum/src/extract.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use async_trait::async_trait;
use axum::{extract::FromRequestParts, http::request::Parts};
use shield::{ConfigurationError, Session, Shield, ShieldError, User};

use crate::error::RouteError;

pub struct ExtractShield<U: User>(pub Shield<U>);

#[async_trait]
impl<S: Send + Sync, U: User + Clone + 'static> FromRequestParts<S> for ExtractShield<U> {
type Rejection = RouteError;

Expand All @@ -25,7 +23,6 @@ impl<S: Send + Sync, U: User + Clone + 'static> FromRequestParts<S> for ExtractS

pub struct ExtractSession(pub Session);

#[async_trait]
impl<S: Send + Sync> FromRequestParts<S> for ExtractSession {
type Rejection = RouteError;

Expand All @@ -44,7 +41,6 @@ impl<S: Send + Sync> FromRequestParts<S> for ExtractSession {

pub struct ExtractUser<U: User>(pub Option<U>);

#[async_trait]
impl<S: Send + Sync, U: User + Clone + 'static> FromRequestParts<S> for ExtractUser<U> {
type Rejection = RouteError;

Expand All @@ -63,7 +59,6 @@ impl<S: Send + Sync, U: User + Clone + 'static> FromRequestParts<S> for ExtractU

pub struct UserRequired<U: User>(pub U);

#[async_trait]
impl<S: Send + Sync, U: User + Clone + 'static> FromRequestParts<S> for UserRequired<U> {
type Rejection = RouteError;

Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/shield-axum/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ impl AuthRoutes {
pub fn router<U: User + Clone + 'static, S: Clone + Send + Sync + 'static>() -> Router<S> {
Router::new()
.route("/subproviders", get(subproviders::<U>))
.route("/sign-in/:providerId", post(sign_in::<U>))
.route("/sign-in/:providerId/:subproviderId", post(sign_in::<U>))
.route("/sign-in/callback/:providerId", get(sign_in_callback::<U>))
.route("/sign-in/{providerId}", post(sign_in::<U>))
.route("/sign-in/{providerId}/{subproviderId}", post(sign_in::<U>))
.route("/sign-in/callback/{providerId}", get(sign_in_callback::<U>))
.route(
"/sign-in/callback/:providerId/:subproviderId",
"/sign-in/callback/{providerId}/{subproviderId}",
get(sign_in_callback::<U>),
)
.route("/sign-out", post(sign_out::<U>))
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/shield-tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ shield = { path = "../../core/shield", version = "0.0.4" }
tower-layer.workspace = true
tower-service.workspace = true
tower-sessions.workspace = true
tracing.workspace = true
3 changes: 0 additions & 3 deletions packages/integrations/shield-tower/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{
use http::{Request, Response};
use shield::{Session, Shield, User};
use tower_service::Service;
use tracing::debug;

use crate::session::TowerSessionStorage;

Expand Down Expand Up @@ -80,8 +79,6 @@ where
Err(_err) => return Ok(Self::internal_server_error()),
};

debug!("{:?}", user.as_ref().map(|user| user.id()));

req.extensions_mut().insert(shield);
req.extensions_mut().insert(shield_session);
req.extensions_mut().insert(user);
Expand Down
2 changes: 0 additions & 2 deletions packages/providers/shield-oidc/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ impl<U: User> Provider for OidcProvider<U> {
}
};

debug!("signed in {:?} {:?}", user.id(), connection);

session.renew().await?;

{
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/shield-diesel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "shield-disel"
name = "shield-diesel"
description = "Diesel storage for Shield."

authors.workspace = true
Expand Down
Loading