-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Action startCompute is called by /initiateCompute endpoint of Ocean Node to check the access credentials of a specific consumer to a specific service of an asset. Currently, the action startCompute expects in the policyServer object information related to a single service, as shown below:
{
"action": "startCompute",
"serviceId": "ff294c2e2c7d01bd5f9701abc117737917bb1f91044ba6b2d0903fc806db0d65",
"consumerAddress": "0xd727fb9be39fa019d7c02fea19e54d688da3a662",
"policyServer": {
"successRedirectUri": "",
"sessionId": "",
"errorRedirectUri": "",
"responseRedirectUri": "",
"presentationDefinitionUri": ""
},
"ddo": {...}
}
However, /initiateCompute will pass in the policyServer object information about all services used in the C2D job. The structure of the policyServer object passed by /initializeCompute will be:
{
"policyServer": [
{ "documentId": "did1",
"serviceId": "service1",
"successRedirectUri": "",
"sessionId": "",
"errorRedirectUri": "",
"responseRedirectUri": "",
"presentationDefinitionUri": ""
},
{ "documentId": "did2",
"serviceId": "service2",
"successRedirectUri": "",
"sessionId": "",
"errorRedirectUri": "",
"responseRedirectUri": "",
"presentationDefinitionUri": ""
},
...
]
}
Therefore, the startCompute action needs to be updated as follows:
- read the
documentIdparameter from the request body. Here's the list of parameters sent by the node for thestartComputeaction.
The request body will look like this:
{
"action": "startCompute",
"documentId": "did:ope:...."
"serviceId": "ff294c2e2c7d01bd5f9701abc117737917bb1f91044ba6b2d0903fc806db0d65",
"consumerAddress": "0xd727fb9be39fa019d7c02fea19e54d688da3a662",
"policyServer": {
"successRedirectUri": "",
"sessionId": "",
"errorRedirectUri": "",
"responseRedirectUri": "",
"presentationDefinitionUri": ""
},
"ddo": {...}
}
- from the list passed in the
policyServerobject, find the item corresponding to thedocumentIdandserviceIdpassed in the request body; - retrieve the data from this item;
- perform the existing credentials verification process using the retrieved data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels