Skip to content

Commit

Permalink
rust-extensions:0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
amigin committed Nov 19, 2024
1 parent 2c53328 commit 6b5336f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ edition = "2021"

[dependencies]

my-service-bus = { tag = "1.0.5", git = "https://github.com/MyJetTools/my-service-bus-sdk.git", features = [
my-service-bus = { tag = "0.1.1", git = "https://github.com/MyJetTools/my-service-bus-sdk.git", features = [
"tcp_contracts",
"shared",

] }
my-http-server = { tag = "0.7.1", git = "https://github.com/MyJetTools/my-http-server.git", features = [
my-http-server = { tag = "0.8.2", git = "https://github.com/MyJetTools/my-http-server.git", features = [
"macros",
"controllers",
"static-files",
] }


my-tcp-sockets = { tag = "0.1.9", git = "https://github.com/MyJetTools/my-tcp-sockets.git" }
rust-extensions = { tag = "0.1.4", git = "https://github.com/MyJetTools/rust-extensions.git", features = [
my-tcp-sockets = { tag = "0.1.11", git = "https://github.com/MyJetTools/my-tcp-sockets.git" }
rust-extensions = { tag = "0.1.5", git = "https://github.com/MyJetTools/rust-extensions.git", features = [
"with-tokio",
"base64",
"vec-maybe-stack",
] }

my-logger = { tag = "1.1.0", git = "https://github.com/MyJetTools/my-logger.git" }
my-logger = { tag = "1.2.1", git = "https://github.com/MyJetTools/my-logger.git" }


tonic = { version = "*", features = ["tls", "tls-roots", "prost"] }
Expand Down
7 changes: 3 additions & 4 deletions src/http/auth/auth_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@ impl HttpServerMiddleware for AuthMiddleware {
async fn handle_request(
&self,
ctx: &mut HttpContext,
get_next: &mut HttpServerRequestFlow,
) -> Result<HttpOkResult, HttpFailResult> {
) -> Option<Result<HttpOkResult, HttpFailResult>> {
if let Some(header) = ctx
.request
.get_headers()
.try_get_case_insensitive(AUTH_HEADER)
{
if let Some(last) = header.as_str()?.split(' ').last() {
if let Some(last) = header.as_str().unwrap().split(' ').last() {
let token = SessionToken {
session: last.to_string(),
};
ctx.credentials = Some(Box::new(token));
}
}

get_next.next(ctx).await
None
}
}

0 comments on commit 6b5336f

Please sign in to comment.