[backend/federation] Make resolvedActorId / authenticatedUserId mismatch a debug message instead of an exception
This commit is contained in:
parent
db7e51358f
commit
477f300c40
1 changed files with 9 additions and 5 deletions
|
@ -40,11 +40,15 @@ public class ActivityHandlerService(
|
||||||
|
|
||||||
var resolvedActor = await userResolver.ResolveAsync(activity.Actor.Id);
|
var resolvedActor = await userResolver.ResolveAsync(activity.Actor.Id);
|
||||||
if (authenticatedUserId == null)
|
if (authenticatedUserId == null)
|
||||||
throw GracefulException
|
throw GracefulException.UnprocessableEntity("Refusing to process activity without authenticatedUserId");
|
||||||
.UnprocessableEntity("Refusing to process activity without authenticatedUserId");
|
|
||||||
if (resolvedActor.Id != authenticatedUserId && authenticatedUserId != null)
|
if (resolvedActor.Id != authenticatedUserId)
|
||||||
throw GracefulException
|
{
|
||||||
.UnprocessableEntity($"Authenticated user id {authenticatedUserId} doesn't match resolved actor id {resolvedActor.Id}");
|
logger.LogDebug("Authenticated user id {authenticatedUserId} doesn't match resolved actor id {resolvedActorId}, skipping",
|
||||||
|
authenticatedUserId, resolvedActor.Id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (new Uri(activity.Actor.Id).Host != new Uri(activity.Id).Host)
|
if (new Uri(activity.Actor.Id).Host != new Uri(activity.Id).Host)
|
||||||
throw GracefulException
|
throw GracefulException
|
||||||
.UnprocessableEntity($"Activity identifier ({activity.Actor.Id}) host doesn't match actor identifier ({activity.Id}) host");
|
.UnprocessableEntity($"Activity identifier ({activity.Actor.Id}) host doesn't match actor identifier ({activity.Id}) host");
|
||||||
|
|
Loading…
Add table
Reference in a new issue