pub mod abac;
pub mod acme;
pub mod app;
pub mod bootstrap_types;
pub mod bundled_apps;
pub mod core_settings;
pub mod create_perm;
pub mod dir_cache;
pub mod dns;
pub mod doc_format;
pub mod extensions;
pub mod extract;
pub mod file_access;
pub mod log;
pub mod maintenance;
pub mod middleware;
pub mod prelude;
pub mod profile_me_cache;
pub mod profile_visibility;
pub mod proxy_token_cache;
pub mod rate_limit;
pub mod request;
pub mod roles;
pub mod scheduler;
pub mod scope;
pub mod settings;
pub mod share_access;
pub mod ws_broadcast;
pub mod ws_bus;
use std::net::IpAddr;
use std::pin::Pin;
pub use app::{App, AppBuilderOpts, AppState, ServerMode};
pub use dir_cache::{DirCache, DirEntry};
pub use extract::{Auth, IdTag, OptionalAuth};
pub use middleware::{PermissionCheckFactory, PermissionCheckInput, PermissionCheckOutput};
pub use profile_me_cache::ProfileMeCache;
pub use profile_visibility::{CommunityRole, RequesterTier, SectionVisibility};
pub use proxy_token_cache::ProxyTokenCache;
pub use ws_broadcast::BroadcastManager;
pub type ActionVerifyFn = Box<
dyn for<'a> Fn(
&'a app::App,
cloudillo_types::types::TnId,
&'a str,
Option<&'a IpAddr>,
) -> Pin<
Box<
dyn Future<
Output = cloudillo_types::error::ClResult<
cloudillo_types::auth_adapter::ActionToken,
>,
> + Send
+ 'a,
>,
> + Send
+ Sync,
>;
pub type CreateCompleteTenantFn = Box<
dyn for<'a> Fn(
&'a app::App,
bootstrap_types::CreateCompleteTenantOptions<'a>,
) -> Pin<
Box<
dyn Future<Output = cloudillo_types::error::ClResult<cloudillo_types::types::TnId>>
+ Send
+ 'a,
>,
> + Send
+ Sync,
>;
pub type CreateActionFn = Box<
dyn for<'a> Fn(
&'a app::App,
cloudillo_types::types::TnId,
&'a str,
cloudillo_types::action_types::CreateAction,
) -> Pin<
Box<dyn Future<Output = cloudillo_types::error::ClResult<Box<str>>> + Send + 'a>,
> + Send
+ Sync,
>;
pub type SearchIndexFn = Box<dyn Fn(&app::App, cloudillo_types::types::TnId, &str) + Send + Sync>;
pub type SearchObjectFn =
Box<dyn Fn(&app::App, cloudillo_types::types::TnId, char, &str) + Send + Sync>;
pub fn search_index_object(
app: &app::App,
tn_id: cloudillo_types::types::TnId,
obj_tp: char,
obj_id: &str,
) {
if let Ok(f) = app.ext::<SearchObjectFn>() {
f(app, tn_id, obj_tp, obj_id);
}
}
pub fn search_index_file(app: &app::App, tn_id: cloudillo_types::types::TnId, file_id: &str) {
search_index_object(app, tn_id, 'F', file_id);
}
pub fn search_index_document(app: &app::App, tn_id: cloudillo_types::types::TnId, file_id: &str) {
if let Ok(f) = app.ext::<SearchIndexFn>() {
f(app, tn_id, file_id);
}
}
pub fn search_index_profile(app: &app::App, tn_id: cloudillo_types::types::TnId, id_tag: &str) {
search_index_object(app, tn_id, 'P', id_tag);
}
pub fn search_index_action(app: &app::App, tn_id: cloudillo_types::types::TnId, action_id: &str) {
search_index_object(app, tn_id, 'A', action_id);
}
pub type ActionSearchRulesFn =
Box<dyn Fn(&str, Option<&str>) -> Option<(Box<str>, Option<serde_json::Value>)> + Send + Sync>;
pub struct ScheduleEmailParams {
pub to: String,
pub template_name: String,
pub template_vars: serde_json::Value,
pub lang: Option<String>,
pub custom_key: Option<String>,
pub from_name_override: Option<String>,
}
pub type ScheduleEmailFn = Box<
dyn for<'a> Fn(
&'a app::App,
cloudillo_types::types::TnId,
ScheduleEmailParams,
) -> Pin<
Box<dyn Future<Output = cloudillo_types::error::ClResult<()>> + Send + 'a>,
> + Send
+ Sync,
>;
pub type OnFirstCertIssuedFn = Box<
dyn for<'a> Fn(
&'a app::App,
cloudillo_types::types::TnId,
&'a str,
) -> Pin<
Box<dyn Future<Output = cloudillo_types::error::ClResult<()>> + Send + 'a>,
> + Send
+ Sync,
>;
pub type EnsureProfileFn = Box<
dyn for<'a> Fn(
&'a app::App,
cloudillo_types::types::TnId,
&'a str,
) -> Pin<
Box<dyn Future<Output = cloudillo_types::error::ClResult<bool>> + Send + 'a>,
> + Send
+ Sync,
>;
pub fn register_settings(
registry: &mut settings::SettingsRegistry,
) -> cloudillo_types::error::ClResult<()> {
core_settings::register_settings(registry)
}