This commit is contained in:
Kitaiti Makoto 2023-01-05 04:14:25 +09:00
parent 699fdc30d9
commit 3580fb04fa
2 changed files with 17 additions and 7 deletions

View File

@ -18,11 +18,14 @@ use openssl::{
rsa::Rsa, rsa::Rsa,
sign::{Signer, Verifier}, sign::{Signer, Verifier},
}; };
use plume_common::{activity_pub::{ use plume_common::{
inbox::{AsActor, FromId}, activity_pub::{
sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source, SourceProperty, inbox::{AsActor, FromId},
ToAsString, ToAsUri, sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source,
}, utils::iri_percent_encode_seg}; SourceProperty, ToAsString, ToAsUri,
},
utils::iri_percent_encode_seg,
};
use webfinger::*; use webfinger::*;
#[derive(Queryable, Identifiable, Clone, AsChangeset, Debug)] #[derive(Queryable, Identifiable, Clone, AsChangeset, Debug)]
@ -85,7 +88,11 @@ impl Blog {
if instance.local { if instance.local {
inserted.fqn = iri_percent_encode_seg(&inserted.actor_id.clone()); inserted.fqn = iri_percent_encode_seg(&inserted.actor_id.clone());
} else { } else {
inserted.fqn = format!("{}@{}", iri_percent_encode_seg(&inserted.actor_id), instance.public_domain); inserted.fqn = format!(
"{}@{}",
iri_percent_encode_seg(&inserted.actor_id),
instance.public_domain
);
} }
} }

View File

@ -937,7 +937,10 @@ impl FromId<DbConn> for User {
.to_string(); .to_string();
if username.contains(&['<', '>', '&', '@', '\'', '"', ' ', '\t'][..]) { if username.contains(&['<', '>', '&', '@', '\'', '"', ' ', '\t'][..]) {
tracing::error!("preferredUsername includes invalid character(s): {}", &username); tracing::error!(
"preferredUsername includes invalid character(s): {}",
&username
);
return Err(Error::InvalidValue); return Err(Error::InvalidValue);
} }