/// - URL being in the allowlist (if it is active)
/// - URL not being in the blocklist (if it is active)
///
+/// `use_strict_allowlist` should be true only when parsing a remote community, or when parsing a
+/// post/comment in a local community.
pub(crate) fn check_is_apub_id_valid(
apub_id: &Url,
use_strict_allowlist: bool,
use crate::{
activities::verify_person_in_community,
+ check_is_apub_id_valid,
fetcher::object_id::ObjectId,
protocol::{
objects::{
Community::read(conn, community_id)
})
.await??;
+ check_is_apub_id_valid(¬e.id, community.local, &context.settings())?;
verify_person_in_community(
¬e.attributed_to,
&community.into(),
use crate::{
activities::verify_person_in_community,
+ check_is_apub_id_valid,
fetcher::object_id::ObjectId,
protocol::{
objects::{page::Page, tombstone::Tombstone},
.dereference(context, request_counter)
.await?;
let community = page.extract_community(context, request_counter).await?;
+ check_is_apub_id_valid(&page.id, community.local, &context.settings())?;
verify_person_in_community(&page.attributed_to, &community, context, request_counter).await?;
let thumbnail_url: Option<Url> = page.image.clone().map(|i| i.url);
use crate::{
+ check_is_apub_id_valid,
collections::{
community_moderators::ApubCommunityModerators,
community_outbox::ApubCommunityOutbox,
expected_domain: &Url,
settings: &Settings,
) -> Result<CommunityForm, LemmyError> {
+ check_is_apub_id_valid(&group.id, true, settings)?;
verify_domains_match(expected_domain, &group.id)?;
let name = group.preferred_username.clone();
let title = group.name.clone();