diff --git a/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java b/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java index eaf64e01e..faf485352 100644 --- a/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java +++ b/extensions/sovity-messenger/src/main/java/de/sovity/edc/extension/messenger/SovityMessengerExtension.java @@ -34,6 +34,7 @@ import org.eclipse.edc.runtime.metamodel.annotation.Provides; import org.eclipse.edc.spi.agent.ParticipantAgentService; import org.eclipse.edc.spi.iam.IdentityService; +import org.eclipse.edc.spi.iam.RequestScope; import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.system.ServiceExtension; @@ -102,7 +103,12 @@ private void setupSovityMessengerEmitter(ServiceExtensionContext context, Object MESSENGER_SCOPE, (ignored) -> Policy.Builder.newInstance().permission(Permission.Builder.newInstance().build()).build()); - policyEngine.registerPostValidator(MESSENGER_SCOPE, (ignored1, ignored2) -> true); + policyEngine.registerPostValidator( + MESSENGER_SCOPE, + (ignored, policyContext) -> { + policyContext.getContextData(RequestScope.Builder.class).scope("sovity.messenger:send"); + return true; + }); typeTransformerRegistry.register(new JsonObjectFromSovityMessageRequest());