mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add optional rate limiting for oauth entrypoint
This commit is contained in:
1 parent
b3e4f516ea
commit
249751a1e9
4 files changed
+129
-2
No files matched your search
@@ -9,15 +9,18 @@ pub struct RcConfig {
|
||||
//pub data: std::path::PathBuf,
|
||||
pub account_provider: oj_rc_core::UserImpl,
|
||||
pub assets: std::path::PathBuf,
|
||||
pub rate_limit_fediverse: bool,
|
||||
}
|
||||
|
||||
impl RcConfig {
|
||||
pub async fn from_args(args: &crate::cli::CliArgs) -> Self {
|
||||
let conf = oj_rc_core::persist::config::ConfigImpl::load(&args.assets_robocraft).expect("Bad config data");
|
||||
log::info!("Fediverse auth --chill enabled? {}", args.chill);
|
||||
Self {
|
||||
account_provider: oj_rc_core::UserImpl::load(&args.data_robocraft, &conf).await.expect("Invalid Robocraft user data"),
|
||||
//data: args.data_robocraft.clone().into(),
|
||||
assets: args.assets_robocraft.clone().into(),
|
||||
rate_limit_fediverse: args.chill,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user