@@ -173,7 +173,6 @@ pub async fn user_auth_for_datasets(
173173 Some ( ParseableResourceType :: Stream ( stream) ) ,
174174 ) => {
175175 if !PARSEABLE . check_or_load_stream ( stream, tenant_id) . await {
176- tracing:: warn!( "unable to find stream" ) ;
177176 return Err ( actix_web:: error:: ErrorUnauthorized ( format ! (
178177 "Stream not found: {table_name}"
179178 ) ) ) ;
@@ -254,11 +253,14 @@ pub fn create_intracluster_auth_headermap(
254253 reqwest:: header:: AUTHORIZATION ,
255254 reqwest:: header:: HeaderValue :: from_bytes ( auth. as_bytes ( ) ) . unwrap ( ) ,
256255 ) ;
257- } else if let Some ( auth) = req. get ( actix_web:: http:: header:: COOKIE ) {
258- map. insert (
259- reqwest:: header:: COOKIE ,
260- reqwest:: header:: HeaderValue :: from_bytes ( auth. as_bytes ( ) ) . unwrap ( ) ,
261- ) ;
256+ } else if req. contains_key ( actix_web:: http:: header:: COOKIE ) {
257+ // multiple cookies
258+ for cookie in req. get_all ( actix_web:: http:: header:: COOKIE ) {
259+ map. insert (
260+ reqwest:: header:: COOKIE ,
261+ reqwest:: header:: HeaderValue :: from_bytes ( cookie. as_bytes ( ) ) . unwrap ( ) ,
262+ ) ;
263+ }
262264 } else {
263265 map. insert (
264266 reqwest:: header:: AUTHORIZATION ,
@@ -303,3 +305,33 @@ pub async fn login_sync(
303305 } )
304306 . await
305307}
308+
309+ pub async fn logout_sync (
310+ session : SessionKey ,
311+ tenant_id : & Option < String > ,
312+ ) -> Result < ( ) , anyhow:: Error > {
313+ for_each_live_node ( tenant_id, move |node| {
314+ let url = format ! (
315+ "{}{}/o/logout/sync" ,
316+ node. domain_name,
317+ base_path_without_preceding_slash( ) ,
318+ ) ;
319+ let _session = session. clone ( ) ;
320+
321+ async move {
322+ INTRA_CLUSTER_CLIENT
323+ . post ( url)
324+ . header ( header:: AUTHORIZATION , node. token )
325+ . header ( header:: CONTENT_TYPE , "application/json" )
326+ . json ( & json ! (
327+ {
328+ "sessionKey" : _session
329+ }
330+ ) )
331+ . send ( )
332+ . await ?;
333+ Ok :: < ( ) , anyhow:: Error > ( ( ) )
334+ }
335+ } )
336+ . await
337+ }
0 commit comments