Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Aug 29, 2024
1 parent aedf7e7 commit 2b25748
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
14 changes: 12 additions & 2 deletions libsql-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,12 @@ where

let make_replication_svc = Box::new({
let disable_namespaces = self.disable_namespaces;
move |store, client_auth, idle_shutdown, collect_stats, is_internal| -> BoxReplicationService {
move |store,
client_auth,
idle_shutdown,
collect_stats,
is_internal|
-> BoxReplicationService {
Box::new(ReplicationLogService::new(
store,
idle_shutdown,
Expand Down Expand Up @@ -1058,7 +1063,12 @@ where

let make_replication_svc = Box::new({
let disable_namespaces = self.disable_namespaces;
move |store, client_auth, idle_shutdown, collect_stats, is_internal| -> BoxReplicationService {
move |store,
client_auth,
idle_shutdown,
collect_stats,
is_internal|
-> BoxReplicationService {
Box::new(ReplicationLogService::new(
store,
idle_shutdown,
Expand Down
6 changes: 4 additions & 2 deletions libsql-server/src/rpc/replication/replication_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ impl ReplicationLogService {
req: &tonic::Request<T>,
namespace: NamespaceName,
) -> Result<(), Status> {
if self.service_internal && req.metadata().get("libsql-proxied").is_some() || !self.service_internal {
if self.service_internal && req.metadata().get("libsql-proxied").is_some()
|| !self.service_internal
{
super::auth::authenticate(
&self.namespaces,
req,
namespace,
&self.user_auth_strategy,
true,
)
.await
.await
} else {
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion libsql-server/src/rpc/replication/replication_log_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ impl ReplicationLogProxyService {
}

fn mark_proxied<T>(mut req: tonic::Request<T>) -> tonic::Request<T> {
req.metadata_mut().insert("libsql-proxied", AsciiMetadataValue::from_static("true"));
req.metadata_mut()
.insert("libsql-proxied", AsciiMetadataValue::from_static("true"));
req
}

Expand Down
2 changes: 1 addition & 1 deletion libsql-server/tests/embedded_replica/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ fn replicate_auth() {

assert!(db.sync().await.is_err());

// auth
// auth
let tmp = tempdir().unwrap();
let db = Database::open_with_remote_sync_connector(
tmp.path().join("embedded").to_str().unwrap(),
Expand Down

0 comments on commit 2b25748

Please sign in to comment.