Skip to content

Commit f5d9aee

Browse files
committed
Add integrity protecting external content
Signed-off-by: steve lasker <stevenlasker@hotmail.com>
1 parent 79b1d9d commit f5d9aee

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

  • content/developers/api-reference/attachments-api

content/developers/api-reference/attachments-api/index.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,49 @@ The response will include basic information about the attachment:
214214
}
215215
```
216216
217+
### Integrity Protecting External Content
218+
219+
To integrity protect content located external to the DataTrails platform, exclude the `"arc_attribute_type": "arc_attachment"`, `"arc_blob_identity"` and `"arc_display_name"` as not being relevant to external content.
220+
221+
```json
222+
cat > /tmp/event.json <<EOF
223+
{
224+
"operation": "Record",
225+
"behaviour": "RecordEvidence",
226+
"event_attributes": {
227+
"arc_blob_hash_value": "$BLOB_HASH",
228+
"arc_blob_hash_alg": "SHA256",
229+
"arc_file_name": "$BLOB_FILE"
230+
}
231+
}
232+
EOF
233+
```
234+
235+
- Post to the Integrity protected content as an Event:
236+
237+
```bash
238+
curl -X POST \
239+
-H "@$HOME/.datatrails/bearer-token.txt" \
240+
-H "Content-type: application/json" \
241+
-d "@/tmp/event.json" \
242+
https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events \
243+
| jq
244+
```
245+
246+
- Capture the new Event ID from above:
247+
248+
```bash
249+
EVENT_ID=<event-id>
250+
```
251+
252+
- Query the newly created Event, with integrity protection:
253+
254+
```bash
255+
curl -H "@$HOME/.datatrails/bearer-token.txt" \
256+
https://app.datatrails.ai/archivist/v2/$ASSET_ID/events/$EVENT_ID \
257+
| jq
258+
```
259+
217260
## Attachment OpenAPI Docs
218261
219262
{{< openapi url="https://raw.githubusercontent.com/datatrails/datatrails-openapi/main/doc/attachmentsv2.swagger.json" >}}

0 commit comments

Comments
 (0)