Skip to content

Commit 40c58cb

Browse files
committed
restrict policy enforcement to negotiation scope
1 parent f1d8147 commit 40c58cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

policy-extension/src/main/java/org/eclipse/edc/extension/possiblepolicy/PossiblePolicyExtension.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import java.util.Map;
2828

29+
import static org.eclipse.edc.connector.contract.spi.validation.ContractValidationService.NEGOTIATION_SCOPE;
2930
import static org.eclipse.edc.policy.engine.spi.PolicyEngine.ALL_SCOPES;
3031

3132
@Extension(value = PossiblePolicyExtension.EXTENSION_NAME)
@@ -54,13 +55,13 @@ public String name() {
5455
public void initialize(ServiceExtensionContext context) {
5556
var monitor = context.getMonitor();
5657

57-
ruleBindingRegistry.bind("use", ALL_SCOPES);
58+
ruleBindingRegistry.bind("use", NEGOTIATION_SCOPE);
5859

5960
for (Map.Entry<String, String> entry : CONSTRAINT_KEY_MAP.entrySet()) {
60-
ruleBindingRegistry.bind(entry.getKey(), ALL_SCOPES);
61-
policyEngine.registerFunction(ALL_SCOPES, Permission.class, entry.getKey(),
61+
ruleBindingRegistry.bind(entry.getKey(), NEGOTIATION_SCOPE);
62+
policyEngine.registerFunction(NEGOTIATION_SCOPE, Permission.class, entry.getKey(),
6263
new ClientClaimConstraintFunction<>(monitor, entry.getValue(), VERBOSE));
63-
policyEngine.registerFunction(ALL_SCOPES, Prohibition.class, entry.getKey(),
64+
policyEngine.registerFunction(NEGOTIATION_SCOPE, Prohibition.class, entry.getKey(),
6465
new ClientClaimConstraintFunction<>(monitor, entry.getValue(), VERBOSE));
6566
}
6667
}

0 commit comments

Comments
 (0)