diff --git a/lib/Controller/RemoteController.php b/lib/Controller/RemoteController.php index 9c43a5778..cab9721df 100644 --- a/lib/Controller/RemoteController.php +++ b/lib/Controller/RemoteController.php @@ -411,8 +411,13 @@ public function memberships(string $circleId): DataResponse { * @throws MalformedArrayException * @throws SignatoryException * @throws SignatureException + * @throws UnknownInterfaceException */ private function extractEventFromRequest(): FederatedEvent { + // will throw exception if instance is not configured for this event. + $this->interfaceService->setCurrentInterfaceFromRequest($this->request); + $this->interfaceService->getCurrentInterface(); + $signed = $this->remoteStreamService->incomingSignedRequest(); $this->confirmRemoteInstance($signed); diff --git a/lib/Service/RemoteStreamService.php b/lib/Service/RemoteStreamService.php index e41348998..b913803dc 100644 --- a/lib/Service/RemoteStreamService.php +++ b/lib/Service/RemoteStreamService.php @@ -38,6 +38,7 @@ use OCA\Circles\Tools\Traits\TNCWellKnown; use OCA\Circles\Tools\Traits\TStringTools; use OCP\AppFramework\Http; +use OCP\IConfig; use OCP\IURLGenerator; use ReflectionClass; use ReflectionException; @@ -83,6 +84,7 @@ class RemoteStreamService extends NCSignature { * @param ConfigService $configService */ public function __construct( + private readonly IConfig $config, IURLGenerator $urlGenerator, RemoteRequest $remoteRequest, InterfaceService $interfaceService, @@ -364,6 +366,7 @@ public function retrieveSignatory(string $keyId, bool $refresh = true): NCSignat $request = new NCRequest(); $this->configService->configureRequest($request); + $request->setLocalAddressAllowed($this->config->getSystemValueBool('allow_local_remote_servers')); $this->downloadSignatory($remoteInstance, $keyId, ['auth' => $confirm], $request); $remoteInstance->setUidFromKey();