From f986e24543cb23bbe68760b02f20331fc96f7020 Mon Sep 17 00:00:00 2001 From: Ihor M Date: Tue, 7 Jun 2022 18:20:30 +0200 Subject: [PATCH] refactoring --- src/auth_middleware.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/auth_middleware.rs b/src/auth_middleware.rs index 5995947..eb3c9b2 100644 --- a/src/auth_middleware.rs +++ b/src/auth_middleware.rs @@ -14,10 +14,10 @@ use std::task::{Context, Poll}; #[derive(Clone, Debug)] pub struct AuthContext { - subject: Subject, - token: String, - organization: Option, - scopes: BTreeMap>, + pub subject: Subject, + pub token: String, + pub organization: Option, + pub scopes: BTreeMap>, } impl AuthContext { @@ -127,6 +127,7 @@ fn extract_organization(maybe_organization: Option<&HeaderValue>) -> Option Transform for AuthMiddlewareFactory @@ -146,12 +147,6 @@ where } } -impl Default for AuthMiddlewareFactory { - fn default() -> AuthMiddlewareFactory { - AuthMiddlewareFactory() - } -} - pub struct AuthMiddleware { service: S, }