You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the connector responds to a catalog request, it checks both the access and the contract policies for each ContractDefinition. Therefore, the requesting connector will not see contract offers if the contract policy is not fulfilled at the time of the request.
Expected Behavior
During catalog request, the connector evaluates whether the requesting agent fulfils a ContractDefinition's access policy, but not the contract policy, as the contract policy should be advertised to requesting agents.
Observed Behavior
The connector evaluates whether the access and contract policies are fulfilled.
Steps to Reproduce
Steps to reproduce the behavior:
Create an implementation of AtomicConstraintFunction<Permission> that always returns false in sample 04.0's transfer-file module and register it with the PolicyEngine in the TransferFileExtension.
Bind the key used to register the function as well as the action type USE to all scopes using the RuleBindingRegistry.
Create a second policy in the TransferFileExtension, adding an action with type USE and a constraint using the key from steps 1 and 2 as the value for the left operand. Operator and right operand can be chosen arbitrarily.
Add the new policy as the ContractDefinition's contract policy, do not add it as the access policy.
Start both connectors as described in the sample's README.
Make a catalog request from consumer to provider and see an empty array of contract offers in the response: curl -X GET -H 'X-Api-Key: password' "http://localhost:9192/api/v1/data/catalog?providerUrl=http://localhost:8282/api/v1/ids/data"
See in the provider logs that there was a problem evaluating the constraint defined in the contract policy.
Possible Implementation
The ContractDefinitionServiceImpl always evaluates access and contract policies when filtering ContractDefinitions for a ParticipantAgent. Here, only the access policies should be evaluated. The evaluation of the contract policies (e.g. during contract negotiation) should happen separately.
Also, the ContractDefinitionServiceImpl always uses the policy scope contract.negotiation, even though the service is also used during catalog requests.
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the Bug
When the connector responds to a catalog request, it checks both the access and the contract policies for each
ContractDefinition
. Therefore, the requesting connector will not see contract offers if the contract policy is not fulfilled at the time of the request.Expected Behavior
During catalog request, the connector evaluates whether the requesting agent fulfils a
ContractDefinition's
access policy, but not the contract policy, as the contract policy should be advertised to requesting agents.Observed Behavior
The connector evaluates whether the access and contract policies are fulfilled.
Steps to Reproduce
Steps to reproduce the behavior:
AtomicConstraintFunction<Permission>
that always returns false in sample 04.0'stransfer-file
module and register it with thePolicyEngine
in theTransferFileExtension
.USE
to all scopes using theRuleBindingRegistry
.TransferFileExtension
, adding an action with typeUSE
and a constraint using the key from steps 1 and 2 as the value for the left operand. Operator and right operand can be chosen arbitrarily.ContractDefinition's
contract policy, do not add it as the access policy.README
.curl -X GET -H 'X-Api-Key: password' "http://localhost:9192/api/v1/data/catalog?providerUrl=http://localhost:8282/api/v1/ids/data"
Possible Implementation
The
ContractDefinitionServiceImpl
always evaluates access and contract policies when filteringContractDefinitions
for aParticipantAgent
. Here, only the access policies should be evaluated. The evaluation of the contract policies (e.g. during contract negotiation) should happen separately.Also, the
ContractDefinitionServiceImpl
always uses the policy scopecontract.negotiation
, even though the service is also used during catalog requests.The text was updated successfully, but these errors were encountered: