From 6f0fc86d5e676b8fbe9ba1f2dcc99f47bbd0d975 Mon Sep 17 00:00:00 2001 From: Alex Coseru Date: Thu, 23 Jun 2022 20:31:00 +0300 Subject: [PATCH] More details on allowed algos (#1032) * More details on allowed algos * Update did-ddo.md * Update did-ddo.md * Update did-ddo.md * Update did-ddo.md * Update did-ddo.md --- content/concepts/did-ddo.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/content/concepts/did-ddo.md b/content/concepts/did-ddo.md index 8edf3fb1..ec9463c0 100644 --- a/content/concepts/did-ddo.md +++ b/content/concepts/did-ddo.md @@ -142,7 +142,7 @@ The `container` object has the following attributes defining the Docker image fo | **`entrypoint`** | `string` | **✓** | The command to execute, or script to run inside the Docker image. | | **`image`** | `string` | **✓** | Name of the Docker image. | | **`tag`** | `string` | **✓** | Tag of the Docker image. | -| **`checksum`** | `string` | **✓** | Checksum of the Docker image. | +| **`checksum`** | `string` | **✓** | Digest of the Docker image. (ie: sha256:xxxxx) | ```json { @@ -161,7 +161,7 @@ The `container` object has the following attributes defining the Docker image fo "entrypoint": "node $ALGO", "image": "ubuntu", "tag": "latest", - "checksum": "44e10daa6637893f4276bb8d7301eb35306ece50f61ca34dcab550" + "checksum": "sha256:44e10daa6637893f4276bb8d7301eb35306ece50f61ca34dcab550" }, "consumerParameters": {} } @@ -368,7 +368,7 @@ An asset with a service of `type` `compute` has the following additional attribu Array of string - If empty, then any published algorithm is allowed. Otherwise, only published algorithms by some publishers are allowed. + If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. If not empty any algo published by the defined publishers is allowed. @@ -386,7 +386,7 @@ An asset with a service of `type` `compute` has the following additional attribu Array of publisherTrustedAlgorithms - If empty, then any published algorithm is allowed. (see below). + If not defined, then any published algorithm is allowed. If empty array, then no algorithm is allowed. Otherwise only the algorithms defined in the array are allowed. (see below). @@ -400,19 +400,16 @@ The `publisherTrustedAlgorithms ` is an array of objects with the following stru | Attribute | Type | Required | Description | | ------------------------------ | -------- | -------- | ------------------------------------------------------------------------- | | **`did`** | `string` | **✓** | The DID of the algorithm which is trusted by the publisher. | -| **`filesChecksum`** | `string` | **✓** | Hash of algorithm's `files` section (as `string`). | -| **`containerSectionChecksum`** | `string` | **✓** | Hash of algorithm's `metadata.algorithm.container` section (as `string`). | +| **`filesChecksum`** | `string` | **✓** | Hash of algorithm's files (as `string`). | +| **`containerSectionChecksum`** | `string` | **✓** | Hash of algorithm's image details (as `string`). | -To produce `filesChecksum`: - -```js -sha256(JSON.Stringify(algorithm_ddo.services[0].files)) -``` +To produce `filesChecksum`, call the Provider FileInfoEndpoint with parameter withChecksum = True. +If algorithm has multiple files, `filesChecksum` is a concatenated string of all files checksums (ie: checksumFile1+checksumFile2 , etc) To produce `containerSectionChecksum`: ```js -sha256(JSON.Stringify(algorithm_ddo.metadata.algorithm.container)) +sha256(algorithm_ddo.metadata.algorithm.container.entrypoint + algorithm_ddo.metadata.algorithm.container.checksum) ``` Example: