From 57d30f21291db04041263359042a784a6d96fac3 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 20 Aug 2023 14:09:15 +0200 Subject: [PATCH] chore(fmt): run clippy fix Signed-off-by: kjuulh --- como_api/src/controllers/auth.rs | 20 ++++++++++---------- como_auth/src/auth.rs | 2 +- como_auth/src/oauth.rs | 2 +- como_auth/src/session.rs | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/como_api/src/controllers/auth.rs b/como_api/src/controllers/auth.rs index 5bf6a1c..91f103a 100644 --- a/como_api/src/controllers/auth.rs +++ b/como_api/src/controllers/auth.rs @@ -1,27 +1,27 @@ -use std::borrow::Cow; + use std::fmt::Display; use crate::router::AppState; -use async_sqlx_session::PostgresSessionStore; + use axum::extract::{FromRef, FromRequestParts, Query, State}; -use axum::headers::authorization::Basic; -use axum::headers::{Authorization, Cookie}; + +use axum::headers::{Cookie}; use axum::http::request::Parts; use axum::http::StatusCode; -use axum::http::{header::SET_COOKIE, HeaderMap}; + use axum::response::{ErrorResponse, IntoResponse, Redirect}; use axum::routing::get; use axum::{async_trait, Json, RequestPartsExt, Router, TypedHeader}; -use axum_sessions::async_session::{Session, SessionStore}; + use como_domain::users::User; use como_infrastructure::register::ServiceRegister; -use oauth2::basic::BasicClient; -use oauth2::{reqwest::async_http_client, AuthorizationCode, CsrfToken, Scope, TokenResponse}; -use oauth2::{RedirectUrl, TokenIntrospectionResponse}; + + + use serde::Deserialize; use serde_json::json; -use zitadel::oidc::introspection::introspect; + #[derive(Debug, Deserialize)] pub struct ZitadelAuthParams { diff --git a/como_auth/src/auth.rs b/como_auth/src/auth.rs index 4e8b3ce..9f09726 100644 --- a/como_auth/src/auth.rs +++ b/como_auth/src/auth.rs @@ -101,7 +101,7 @@ impl Auth for NoopAuthService { todo!() } - async fn get_user_from_session(&self, cookie: &str) -> anyhow::Result { + async fn get_user_from_session(&self, _cookie: &str) -> anyhow::Result { todo!() } } diff --git a/como_auth/src/oauth.rs b/como_auth/src/oauth.rs index bd2e9c1..a393caf 100644 --- a/como_auth/src/oauth.rs +++ b/como_auth/src/oauth.rs @@ -52,7 +52,7 @@ impl OAuthClient for NoopOAuthClient { Ok(Url::parse("http://localhost:3000/auth/zitadel").unwrap()) } - async fn exchange(&self, code: &str) -> anyhow::Result { + async fn exchange(&self, _code: &str) -> anyhow::Result { Ok(String::new()) } } diff --git a/como_auth/src/session.rs b/como_auth/src/session.rs index dce6a72..da2b0f8 100644 --- a/como_auth/src/session.rs +++ b/como_auth/src/session.rs @@ -56,7 +56,7 @@ pub struct User { #[async_trait] impl Session for PostgresSessionService { - async fn insert_user(&self, id: &str, user_id: &str) -> anyhow::Result { + async fn insert_user(&self, _id: &str, user_id: &str) -> anyhow::Result { let mut session = AxumSession::new(); session.insert( "user", @@ -98,11 +98,11 @@ pub struct InMemorySessionService {} #[async_trait] impl Session for InMemorySessionService { - async fn insert_user(&self, id: &str, user_id: &str) -> anyhow::Result { + async fn insert_user(&self, _id: &str, _user_id: &str) -> anyhow::Result { todo!() } - async fn get_user(&self, cookie: &str) -> anyhow::Result> { + async fn get_user(&self, _cookie: &str) -> anyhow::Result> { todo!() } }