Bump pageserver dependencies

This commit is contained in:
Kirill Bulatov
2022-02-09 11:06:26 +02:00
committed by Kirill Bulatov
parent b08e340f60
commit 76b74349cb
22 changed files with 516 additions and 456 deletions

View File

@@ -1,7 +1,6 @@
[package]
name = "zenith_utils"
version = "0.1.0"
authors = ["Eric Seppanen <eric@zenith.tech>"]
edition = "2021"
[dependencies]
@@ -13,7 +12,7 @@ lazy_static = "1.4.0"
pin-project-lite = "0.2.7"
postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="2949d98df52587d562986aad155dd4e889e408b7" }
postgres-protocol = { git = "https://github.com/zenithdb/rust-postgres.git", rev="2949d98df52587d562986aad155dd4e889e408b7" }
routerify = "2"
routerify = "3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
thiserror = "1.0"

View File

@@ -110,6 +110,7 @@ fn parse_token(header_value: &str) -> Result<&str, ApiError> {
Ok(token)
}
// TODO kb now test_auth fails, is it after jsonwebtoken update?
pub fn auth_middleware<B: hyper::body::HttpBody + Send + Sync + 'static>(
provide_auth: fn(&Request<Body>) -> Option<&JwtAuth>,
) -> Middleware<B, ApiError> {
@@ -123,7 +124,7 @@ pub fn auth_middleware<B: hyper::body::HttpBody + Send + Sync + 'static>(
let token = parse_token(header_value)?;
let data = auth
.decode(token)
.decode(dbg!(token))
.map_err(|_| ApiError::Unauthorized("malformed jwt token".to_string()))?;
req.set_context(data.claims);
}

View File

@@ -2,3 +2,7 @@ pub mod endpoint;
pub mod error;
pub mod json;
pub mod request;
/// Current fast way to applly simple http routing in varuious Zenith binaries.
/// Reexported for sake of uniform approach, that could be later replaced with better alternatives, if needed.
pub use routerify::{ext::RequestExt, RouterBuilder};