mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 18:02:56 +00:00
- Make safekeeper read SAFEKEEPER_AUTH_TOKEN env variable with JWT token to connect to other safekeepers. - Set it in neon_local when auth is enabled. - Create simple rust http client supporting it, and use it in pull_timeline implementation. - Enable auth in all pull_timeline tests. - Make sk http_client() by default generate safekeeper wide token, it makes easier enabling auth in all tests by default.
21 lines
528 B
Rust
21 lines
528 B
Rust
pub mod client;
|
|
pub mod routes;
|
|
pub use routes::make_router;
|
|
|
|
pub use safekeeper_api::models;
|
|
|
|
use crate::SafeKeeperConf;
|
|
|
|
pub async fn task_main(
|
|
conf: SafeKeeperConf,
|
|
http_listener: std::net::TcpListener,
|
|
) -> anyhow::Result<()> {
|
|
let router = make_router(conf)
|
|
.build()
|
|
.map_err(|err| anyhow::anyhow!(err))?;
|
|
let service = utils::http::RouterService::new(router).unwrap();
|
|
let server = hyper::Server::from_tcp(http_listener)?;
|
|
server.serve(service).await?;
|
|
Ok(()) // unreachable
|
|
}
|