diff --git a/fastn-core/src/commands/serve.rs b/fastn-core/src/commands/serve.rs index 8c69eca160..8dc4aeb36a 100644 --- a/fastn-core/src/commands/serve.rs +++ b/fastn-core/src/commands/serve.rs @@ -18,11 +18,11 @@ fn handle_redirect( /// path: // /// #[tracing::instrument(skip_all)] -async fn serve_file<'o, 'm: 'o>( - config: &'m mut fastn_core::RequestConfig<'o>, +async fn serve_file<'m>( + config: &'m mut fastn_core::RequestConfig, path: &camino::Utf8Path, ) -> fastn_core::http::Response { - if let Some(r) = handle_redirect(config.config, path) { + if let Some(r) = handle_redirect(&config.config, path) { return r; } @@ -123,8 +123,8 @@ async fn serve_file<'o, 'm: 'o>( } } -async fn serve_cr_file<'o, 'm: 'o>( - req_config: &'m mut fastn_core::RequestConfig<'o>, +async fn serve_cr_file<'m>( + req_config: &'m mut fastn_core::RequestConfig, path: &camino::Utf8Path, cr_number: usize, ) -> fastn_core::http::Response { @@ -302,7 +302,7 @@ pub async fn serve( // if request goes with mount-point /todos/api/add-todo/ // so it should say not found and pass it to proxy - let cookies = req_config.request.cookies(); + let cookies = req_config.request.cookies().clone(); let file_response = serve_file(&mut req_config, path.as_path()).await; // If path is not present in sitemap then pass it to proxy @@ -339,7 +339,7 @@ pub async fn serve( if let Some(user_data) = fastn_core::auth::get_user_data_from_cookies( platform, requested_field, - cookies, + &cookies, ) .await? { diff --git a/fastn-core/src/config/mod.rs b/fastn-core/src/config/mod.rs index 982bf4d5a2..d674494afe 100644 --- a/fastn-core/src/config/mod.rs +++ b/fastn-core/src/config/mod.rs @@ -43,14 +43,14 @@ pub struct Config { } #[derive(Debug, Clone)] -pub struct RequestConfig<'a> { +pub struct RequestConfig { pub named_parameters: Vec<(String, ftd::Value)>, pub extra_data: std::collections::BTreeMap, pub downloaded_assets: std::collections::BTreeMap, pub current_document: Option, pub dependencies_during_render: Vec, - pub request: &'a fastn_core::http::Request, - pub config: &'a Config, + pub request: fastn_core::http::Request, + pub config: Config, /// If the current module being parsed is a markdown file, `.markdown` contains the name and /// content of that file pub markdown: Option<(String, String)>, @@ -60,10 +60,10 @@ pub struct RequestConfig<'a> { pub module_package_map: std::collections::BTreeMap, } -impl<'a> RequestConfig<'a> { +impl RequestConfig { pub fn new( - config: &'a Config, - request: &'a fastn_core::http::Request, + config: &Config, + request: &fastn_core::http::Request, document_id: &str, base_url: &str, ) -> Self { @@ -73,8 +73,8 @@ impl<'a> RequestConfig<'a> { downloaded_assets: Default::default(), current_document: None, dependencies_during_render: vec![], - request, - config, + request: request.clone(), + config: config.clone(), markdown: None, document_id: document_id.to_string(), translated_data: Default::default(), @@ -234,15 +234,15 @@ impl<'a> RequestConfig<'a> { return Ok(true); } let access_identities = fastn_core::user_group::access_identities( - self.config, - self.request, + &self.config, + &self.request, &document_name, true, ) .await?; let belongs_to = fastn_core::user_group::belongs_to( - self.config, + &self.config, document_readers.as_slice(), access_identities.iter().collect_vec().as_slice(), )?; @@ -267,15 +267,15 @@ impl<'a> RequestConfig<'a> { let document_writers = sitemap.writers(document_name.as_str(), &self.config.package.groups); let access_identities = fastn_core::user_group::access_identities( - self.config, - self.request, + &self.config, + &self.request, &document_name, false, ) .await?; return fastn_core::user_group::belongs_to( - self.config, + &self.config, document_writers.as_slice(), access_identities.iter().collect_vec().as_slice(), ); diff --git a/fastn-core/src/doc.rs b/fastn-core/src/doc.rs index 3dd32177f4..56b6a49130 100644 --- a/fastn-core/src/doc.rs +++ b/fastn-core/src/doc.rs @@ -29,7 +29,7 @@ fn cached_parse( pub async fn interpret_helper<'a>( name: &str, source: &str, - lib: &'a mut fastn_core::Library2022<'_>, + lib: &'a mut fastn_core::Library2022, base_url: &str, download_assets: bool, line_number: usize, @@ -113,7 +113,7 @@ pub async fn interpret_helper<'a>( } pub async fn resolve_import<'a>( - lib: &'a mut fastn_core::Library2<'_>, + lib: &'a mut fastn_core::Library2, state: &mut ftd::ftd2021::InterpreterState, module: &str, ) -> ftd::ftd2021::p1::Result { @@ -160,7 +160,7 @@ pub async fn resolve_import<'a>( // source, foreign_variable, foreign_function pub async fn resolve_import_2022<'a>( - lib: &'a mut fastn_core::Library2022<'_>, + lib: &'a mut fastn_core::Library2022, _state: &mut ftd::interpreter::InterpreterState, module: &str, caller_module: &str, @@ -292,7 +292,7 @@ pub async fn resolve_import_2022<'a>( pub async fn resolve_foreign_variable2022( variable: &str, doc_name: &str, - lib: &mut fastn_core::Library2022<'_>, + lib: &mut fastn_core::Library2022, base_url: &str, download_assets: bool, caller_module: &str, @@ -353,7 +353,7 @@ pub async fn resolve_foreign_variable2022( module: &str, package: &fastn_core::Package, files: &str, - lib: &mut fastn_core::RequestConfig<'_>, + lib: &mut fastn_core::RequestConfig, base_url: &str, download_assets: bool, // true: in case of `fastn build` ) -> ftd::ftd2021::p1::Result { @@ -537,7 +537,7 @@ pub async fn resolve_foreign_variable2022( } async fn download( - lib: &mut fastn_core::Library2022<'_>, + lib: &mut fastn_core::Library2022, download_assets: bool, package: &fastn_core::Package, path: &str, @@ -585,7 +585,7 @@ pub async fn resolve_foreign_variable2( variable: &str, doc_name: &str, state: &ftd::ftd2021::InterpreterState, - lib: &mut fastn_core::Library2<'_>, + lib: &mut fastn_core::Library2, base_url: &str, download_assets: bool, ) -> ftd::ftd2021::p1::Result { @@ -620,7 +620,7 @@ pub async fn resolve_foreign_variable2( async fn get_assets_value( package: &fastn_core::Package, files: &str, - lib: &mut fastn_core::Library2<'_>, + lib: &mut fastn_core::Library2, base_url: &str, download_assets: bool, // true: in case of `fastn build` ) -> ftd::ftd2021::p1::Result { diff --git a/fastn-core/src/library/fastn_dot_ftd.rs b/fastn-core/src/library/fastn_dot_ftd.rs index f74f03c514..1085ec864b 100644 --- a/fastn-core/src/library/fastn_dot_ftd.rs +++ b/fastn-core/src/library/fastn_dot_ftd.rs @@ -1,6 +1,6 @@ use crate::utils::HasElements; -async fn i18n_data(lib: &fastn_core::Library<'_>) -> String { +async fn i18n_data(lib: &fastn_core::Library) -> String { let lang = match lib.config.config.package.language { Some(ref lang) => { realm_lang::Language::from_2_letter_code(lang).unwrap_or(realm_lang::Language::English) @@ -19,7 +19,7 @@ async fn i18n_data(lib: &fastn_core::Library<'_>) -> String { let current_document_last_modified_on = fastn_core::utils::get_current_document_last_modified_on( - lib.config.config, + &lib.config.config, lib.document_id.as_str(), ) .await; @@ -243,7 +243,7 @@ fn construct_fastn_cli_variables(_lib: &fastn_core::Library) -> String { ) } -pub(crate) async fn get2022_(lib: &fastn_core::Library<'_>) -> String { +pub(crate) async fn get2022_(lib: &fastn_core::Library) -> String { #[allow(clippy::format_in_format_args)] let mut fastn_base = format!( indoc::indoc! {" @@ -267,7 +267,7 @@ pub(crate) async fn get2022_(lib: &fastn_core::Library<'_>) -> String { ); if let Ok(number_of_documents) = futures::executor::block_on( - fastn_core::utils::get_number_of_documents(lib.config.config), + fastn_core::utils::get_number_of_documents(&lib.config.config), ) { fastn_base = format!( indoc::indoc! {" @@ -299,7 +299,7 @@ pub(crate) async fn get2022_(lib: &fastn_core::Library<'_>) -> String { fastn_base } -pub(crate) async fn get(lib: &fastn_core::Library<'_>) -> String { +pub(crate) async fn get(lib: &fastn_core::Library) -> String { #[allow(clippy::format_in_format_args)] let mut fastn_base = format!( indoc::indoc! {" @@ -406,7 +406,7 @@ pub(crate) async fn get(lib: &fastn_core::Library<'_>) -> String { } if let Ok(number_of_documents) = futures::executor::block_on( - fastn_core::utils::get_number_of_documents(lib.config.config), + fastn_core::utils::get_number_of_documents(&lib.config.config), ) { fastn_base = format!( indoc::indoc! {" @@ -435,7 +435,7 @@ pub(crate) async fn get(lib: &fastn_core::Library<'_>) -> String { if let Some(last_modified_on) = futures::executor::block_on(fastn_core::utils::get_current_document_last_modified_on( - lib.config.config, + &lib.config.config, lib.document_id.as_str(), )) { @@ -812,7 +812,7 @@ pub(crate) async fn get(lib: &fastn_core::Library<'_>) -> String { fastn_base } -pub(crate) async fn get2(lib: &fastn_core::Library2<'_>) -> String { +pub(crate) async fn get2(lib: &fastn_core::Library2) -> String { let lib = fastn_core::Library { config: lib.config.clone(), markdown: lib.markdown.clone(), @@ -824,7 +824,7 @@ pub(crate) async fn get2(lib: &fastn_core::Library2<'_>) -> String { get(&lib).await } -pub(crate) async fn get2022(lib: &fastn_core::Library2022<'_>) -> String { +pub(crate) async fn get2022(lib: &fastn_core::Library2022) -> String { let lib = fastn_core::Library { config: lib.clone(), markdown: lib.markdown.clone(), diff --git a/fastn-core/src/library/mod.rs b/fastn-core/src/library/mod.rs index 1a997fb24d..2e172386e7 100644 --- a/fastn-core/src/library/mod.rs +++ b/fastn-core/src/library/mod.rs @@ -6,8 +6,8 @@ pub(crate) mod toc; pub use fastn_core::Library2022; #[derive(Debug)] -pub struct Library<'a> { - pub config: fastn_core::RequestConfig<'a>, +pub struct Library { + pub config: fastn_core::RequestConfig, /// If the current module being parsed is a markdown file, `.markdown` contains the name and /// content of that file pub markdown: Option<(String, String)>, @@ -19,7 +19,7 @@ pub struct Library<'a> { pub base_url: String, } -impl Library<'_> { +impl Library { pub async fn get_with_result( &self, name: &str, @@ -46,7 +46,7 @@ impl Library<'_> { async fn get_for_package( name: &str, packages: &mut Vec, - lib: &fastn_core::Library<'_>, + lib: &fastn_core::Library, ) -> Option { let package = packages.last()?; if name.starts_with(package.name.as_str()) { @@ -120,7 +120,7 @@ impl Library<'_> { async fn get_data_from_package( name: &str, package: &fastn_core::Package, - lib: &Library<'_>, + lib: &Library, ) -> Option { let path = lib.config.config.get_root_for_package(package); fastn_core::Config::download_required_file(&lib.config.config.root, name, package) @@ -147,8 +147,8 @@ impl Library<'_> { } #[derive(Debug)] -pub struct Library2<'a> { - pub config: fastn_core::RequestConfig<'a>, +pub struct Library2 { + pub config: fastn_core::RequestConfig, /// If the current module being parsed is a markdown file, `.markdown` contains the name and /// content of that file pub markdown: Option<(String, String)>, @@ -158,7 +158,7 @@ pub struct Library2<'a> { pub packages_under_process: Vec, } -impl Library2<'_> { +impl Library2 { pub(crate) async fn push_package_under_process( &mut self, package: &fastn_core::Package, @@ -236,7 +236,7 @@ impl Library2<'_> { return get_for_package(format!("{}/", name.trim_end_matches('/')).as_str(), self).await; - async fn get_for_package(name: &str, lib: &mut fastn_core::Library2<'_>) -> Option { + async fn get_for_package(name: &str, lib: &mut fastn_core::Library2) -> Option { let package = lib.get_current_package().ok()?; if name.starts_with(package.name.as_str()) { if let Some(r) = get_data_from_package(name, &package, lib).await { @@ -291,7 +291,7 @@ impl Library2<'_> { async fn get_data_from_package( name: &str, package: &fastn_core::Package, - lib: &mut Library2<'_>, + lib: &mut Library2, ) -> Option { lib.push_package_under_process(package).await.ok()?; let packages = lib.config.config.all_packages.borrow(); diff --git a/fastn-core/src/library2022/mod.rs b/fastn-core/src/library2022/mod.rs index a2ae8c1f92..162a72abfb 100644 --- a/fastn-core/src/library2022/mod.rs +++ b/fastn-core/src/library2022/mod.rs @@ -13,9 +13,9 @@ impl KeyValueData { } } -pub type Library2022<'m> = fastn_core::RequestConfig<'m>; +pub type Library2022 = fastn_core::RequestConfig; -impl Library2022<'_> { +impl Library2022 { pub async fn get_with_result( &mut self, name: &str, @@ -75,7 +75,7 @@ impl Library2022<'_> { async fn get_for_package( name: &str, - lib: &mut fastn_core::Library2022<'_>, + lib: &mut fastn_core::Library2022, current_processing_module: &str, ) -> Option<(String, String, usize)> { let package = lib.get_current_package(current_processing_module).ok()?; @@ -139,7 +139,7 @@ impl Library2022<'_> { async fn get_data_from_package( name: &str, package: &fastn_core::Package, - lib: &mut fastn_core::Library2022<'_>, + lib: &mut fastn_core::Library2022, ) -> Option<(String, usize)> { lib.push_package_under_process(name, package).await.ok()?; let packages = lib.config.all_packages.borrow(); @@ -267,7 +267,9 @@ impl Library2022<'_> { .await } "pg" => processor::pg::process(value, kind, doc).await, - "package-tree" => processor::package_tree::process(value, kind, doc, self.config).await, + "package-tree" => { + processor::package_tree::process(value, kind, doc, &self.config).await + } "query" => processor::query::process(value, kind, doc, self).await, t => Err(ftd::interpreter::Error::ParseError { doc_id: self.document_id.to_string(), diff --git a/fastn-core/src/library2022/processor/document.rs b/fastn-core/src/library2022/processor/document.rs index eb59b8d692..6ceb04c8c7 100644 --- a/fastn-core/src/library2022/processor/document.rs +++ b/fastn-core/src/library2022/processor/document.rs @@ -136,7 +136,7 @@ pub async fn document_name<'a>( value: ftd::ast::VariableValue, _kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'a>, - req_config: &fastn_core::RequestConfig<'_>, + req_config: &fastn_core::RequestConfig, ) -> ftd::interpreter::Result { let doc_id = req_config.doc_id().unwrap_or_else(|| { doc.name diff --git a/fastn-core/src/library2022/processor/fetch_file.rs b/fastn-core/src/library2022/processor/fetch_file.rs index 36075b3840..74d8251104 100644 --- a/fastn-core/src/library2022/processor/fetch_file.rs +++ b/fastn-core/src/library2022/processor/fetch_file.rs @@ -2,7 +2,7 @@ pub async fn fetch_files( value: ftd::ast::VariableValue, kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'_>, - req_config: &fastn_core::RequestConfig<'_>, + req_config: &fastn_core::RequestConfig, ) -> ftd::interpreter::Result { if !kind.is_string() { return ftd::interpreter::utils::e2( diff --git a/fastn-core/src/library2022/processor/http.rs b/fastn-core/src/library2022/processor/http.rs index 2acf5c8d8f..5e5c6fb245 100644 --- a/fastn-core/src/library2022/processor/http.rs +++ b/fastn-core/src/library2022/processor/http.rs @@ -2,7 +2,7 @@ pub async fn process( value: ftd::ast::VariableValue, kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'_>, - req_config: &fastn_core::RequestConfig<'_>, + req_config: &fastn_core::RequestConfig, ) -> ftd::interpreter::Result { let (headers, line_number) = if let Ok(val) = value.get_record(doc.name) { (val.2.to_owned(), val.5.to_owned()) @@ -58,13 +58,13 @@ pub async fn process( }; let (_, mut url, conf) = - fastn_core::config::utils::get_clean_url(req_config.config, url.as_str()).map_err(|e| { - ftd::interpreter::Error::ParseError { + fastn_core::config::utils::get_clean_url(&req_config.config, url.as_str()).map_err( + |e| ftd::interpreter::Error::ParseError { message: format!("invalid url: {:?}", e), doc_id: doc.name.to_string(), line_number, - } - })?; + }, + )?; let mut body = vec![]; for header in headers.0 { diff --git a/fastn-core/src/library2022/processor/query.rs b/fastn-core/src/library2022/processor/query.rs index bec69b00d8..e4b168b27d 100644 --- a/fastn-core/src/library2022/processor/query.rs +++ b/fastn-core/src/library2022/processor/query.rs @@ -2,7 +2,7 @@ pub async fn process( value: ftd::ast::VariableValue, kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'_>, - req_config: &mut fastn_core::RequestConfig<'_>, + req_config: &mut fastn_core::RequestConfig, ) -> ftd::interpreter::Result { // TODO: document key should be optional diff --git a/fastn-core/src/library2022/processor/sql.rs b/fastn-core/src/library2022/processor/sql.rs index ddf5f8e0f6..f1a3eca3bd 100644 --- a/fastn-core/src/library2022/processor/sql.rs +++ b/fastn-core/src/library2022/processor/sql.rs @@ -23,7 +23,7 @@ pub async fn process( value: ftd::ast::VariableValue, kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'_>, - config: &fastn_core::RequestConfig<'_>, + config: &fastn_core::RequestConfig, ) -> ftd::interpreter::Result { let db_config = fastn_core::library2022::processor::sql::get_db_config()?; let db_type = db_config.db_type.as_str(); diff --git a/fastn-core/src/library2022/processor/sqlite.rs b/fastn-core/src/library2022/processor/sqlite.rs index b9afa018c1..91a7e6e8fe 100644 --- a/fastn-core/src/library2022/processor/sqlite.rs +++ b/fastn-core/src/library2022/processor/sqlite.rs @@ -28,7 +28,7 @@ pub async fn process( value: ftd::ast::VariableValue, kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'_>, - config: &fastn_core::RequestConfig<'_>, + config: &fastn_core::RequestConfig, db_config: &fastn_core::library2022::processor::sql::DatabaseConfig, ) -> ftd::interpreter::Result { let (headers, query) = get_p1_data("package-data", &value, doc.name)?; diff --git a/fastn-core/src/library2022/processor/user_group.rs b/fastn-core/src/library2022/processor/user_group.rs index bafeea8472..9ba9b06d9f 100644 --- a/fastn-core/src/library2022/processor/user_group.rs +++ b/fastn-core/src/library2022/processor/user_group.rs @@ -65,7 +65,7 @@ pub fn get_identities( let doc_id = fastn_core::library2022::utils::document_full_id(req_config, doc)?; let identities = - fastn_core::user_group::get_identities(req_config.config, doc_id.as_str(), true).map_err( + fastn_core::user_group::get_identities(&req_config.config, doc_id.as_str(), true).map_err( |e| ftd::ftd2021::p1::Error::ParseError { message: e.to_string(), doc_id, @@ -97,7 +97,7 @@ pub async fn is_reader<'a>( value: ftd::ast::VariableValue, _kind: ftd::interpreter::Kind, doc: &ftd::interpreter::TDoc<'a>, - req_config: &fastn_core::RequestConfig<'_>, + req_config: &fastn_core::RequestConfig, ) -> ftd::interpreter::Result { let doc_id = fastn_core::library2022::utils::document_full_id(req_config, doc)?; let is_reader = req_config.can_read(&doc_id, false).await.map_err(|e| { diff --git a/fastn-core/src/package/app.rs b/fastn-core/src/package/app.rs index b0be2cf914..d349f08ae2 100644 --- a/fastn-core/src/package/app.rs +++ b/fastn-core/src/package/app.rs @@ -94,10 +94,7 @@ impl AppTemp { } // Takes the path /-/// or /mount-point// -pub async fn can_read( - config: &fastn_core::RequestConfig<'_>, - path: &str, -) -> fastn_core::Result { +pub async fn can_read(config: &fastn_core::RequestConfig, path: &str) -> fastn_core::Result { use itertools::Itertools; // first get the app let readers_groups = if let Some((_, _, _, Some(app))) = config @@ -129,7 +126,7 @@ pub async fn can_read( let mut app_identities = vec![]; for ug in user_groups.iter() { - app_identities.extend(ug.get_identities(config.config)?) + app_identities.extend(ug.get_identities(&config.config)?) } let auth_identities = @@ -137,7 +134,7 @@ pub async fn can_read( .await?; return fastn_core::user_group::belongs_to( - config.config, + &config.config, user_groups.as_slice(), auth_identities.iter().collect_vec().as_slice(), ); diff --git a/fastn-core/src/package/package_doc.rs b/fastn-core/src/package/package_doc.rs index 7539527892..38d054ccaa 100644 --- a/fastn-core/src/package/package_doc.rs +++ b/fastn-core/src/package/package_doc.rs @@ -363,8 +363,8 @@ impl From for fastn_core::http::Response { } #[tracing::instrument(skip_all)] -pub(crate) async fn read_ftd<'o, 'm: 'o>( - config: &'m mut fastn_core::RequestConfig<'o>, +pub(crate) async fn read_ftd<'m>( + config: &'m mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, @@ -385,15 +385,15 @@ pub(crate) async fn read_ftd<'o, 'm: 'o>( } #[tracing::instrument(name = "read_ftd_2022", skip_all)] -pub(crate) async fn read_ftd_2022<'o, 'm: 'o>( - config: &'m mut fastn_core::RequestConfig<'o>, +pub(crate) async fn read_ftd_2022<'m>( + config: &'m mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, test: bool, ) -> fastn_core::Result { let font_style = config.config.get_font_style(); - let c = config.config; + let c = &config.config.clone(); let current_package = config .config @@ -454,15 +454,15 @@ pub(crate) async fn read_ftd_2022<'o, 'm: 'o>( #[allow(clippy::await_holding_refcell_ref)] #[tracing::instrument(name = "read_ftd_2023", skip_all)] -pub(crate) async fn read_ftd_2023<'o, 'm: 'o>( - config: &'m mut fastn_core::RequestConfig<'o>, +pub(crate) async fn read_ftd_2023<'m>( + config: &'m mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, download_assets: bool, ) -> fastn_core::Result { let package_name = config.config.package.name.to_string(); let font_style = config.config.get_font_style(); - let c = config.config; + let c = &config.config.clone(); let current_package = config .config @@ -529,8 +529,8 @@ pub(crate) async fn read_ftd_2023<'o, 'm: 'o>( Ok(FTDResult::Html(file_content.into())) } -pub(crate) async fn process_ftd<'o, 'm: 'o>( - config: &'m mut fastn_core::RequestConfig<'o>, +pub(crate) async fn process_ftd<'m>( + config: &'m mut fastn_core::RequestConfig, main: &fastn_core::Document, base_url: &str, build_static_files: bool, diff --git a/fastn-core/src/package/user_group.rs b/fastn-core/src/package/user_group.rs index 8de4829a67..6824c4b5f5 100644 --- a/fastn-core/src/package/user_group.rs +++ b/fastn-core/src/package/user_group.rs @@ -607,7 +607,7 @@ pub mod processor { ) -> ftd::ftd2021::p1::Result { let doc_id = fastn_core::library::document::document_full_id(req_config, doc)?; let identities = - super::get_identities(req_config.config, doc_id.as_str(), true).map_err(|e| { + super::get_identities(&req_config.config, doc_id.as_str(), true).map_err(|e| { ftd::ftd2021::p1::Error::ParseError { message: e.to_string(), doc_id, @@ -642,7 +642,7 @@ pub mod processor { pub async fn is_reader<'a>( section: &ftd::ftd2021::p1::Section, doc: &'a ftd::ftd2021::p2::TDoc<'_>, - req_config: &fastn_core::RequestConfig<'_>, + req_config: &fastn_core::RequestConfig, ) -> ftd::ftd2021::p1::Result { let doc_id = fastn_core::library::document::document_full_id(req_config, doc)?; let is_reader = req_config.can_read(&doc_id, false).await.map_err(|e| {